stuartkeith / padkontrol

A Python module used to interact with the Korg PadKontrol MIDI controller via its native mode.
MIT License
7 stars 7 forks source link

Decimal point in LED #4

Closed Razz21 closed 4 years ago

Razz21 commented 5 years ago

Hi, is it possible to send decimal point message to LED display? ASCII character did not show and I cant figure this out.

stuartkeith commented 5 years ago

Hi, I don't have a padkontrol any more unfortunately, but the ASCII character for period (.) should be supported. Do you have an example of the string you're passing?

Razz21 commented 5 years ago

Thanks for response. 3 character alphanumeric string, like 'ab1', is displayed properly - 'ab1', 3 character string with unsupported character do not display invalid symbol, for example 'a@1' is displayed as 'a1'. Period symbol do not display when passing as string '...', or even 4th character '3.00'. According to this old docs https://static.twoday.net/kpkproject/files/Padkontrol-Sysex-Imp.pdf table 3.2-2, valid symbols for LCD display are (20~7F) ASCII characters, but most of the not-alphanumeric symbols are not displayed at all.

stuartkeith commented 5 years ago

I just looked at a photo of the padkontrol (it's been a while) and realised you might mean the small decimal point LEDs that are separate from the seven segment LEDs. I'd forgotten those were there.

The light function (https://github.com/stuartkeith/padkontrol/blob/master/padkontrol.py#L105) mentions you can pass either a pad number or a button constant to turn on that light, but looking at the PDF, you can also control the LEDs directly.

If you look at 3-2 Native KORG mode Messages > (1) Native KORG mode Display LEDs in the docs, it mentions LED Number 00~0F, 10~22, 30~47 = PAD1~16, SW LED, 7Seg.LED.

PAD1~16 and SW LED are already implemented in the library, but I've never tried the 7Seg.LED values.

So the values 30~47 seem to be linked to the seven segment LEDs. I'm hoping that means 3*7 segments, plus the decimal points in between, and then it's just a matter of finding out which values in that range toggle the decimal points. send_sysex(pk.light(0x30 + 7, True)) might turn it the first decimal point on, but that's just a stab in the dark.

Then (maybe) you can call pk.led to set the ASCII characters as normal, and then pk.light to light up the decimal points. Not as nice as being able to do it in one led call, but from the doc, it doesn't seem like that's supported. Unless you try toggling bits on the ASCII characters or something, seeing if there's undocumented behaviour there.

It's a bit difficult to be much help when I don't have a padkontrol, but maybe this might help, or at least serve as a starting point. Let me know how it goes!

Razz21 commented 5 years ago

I probably misread/ misunderstood this part in docs. This command send_sysex(pk.light(0x30 + 7, True)) turned middle DP on. I should to be able to generate even custom symbols now. Thank you very much!!

stuartkeith commented 5 years ago

Glad it worked!