[solved] debug output shows different keys pressed, but notes are the same?

Hi,

I have a project for which I want to use an old Roland 37 keys keyboard. Apparently, it follows the Fatar DF type scheme, but with inversed diodes, so I set

set kb 1 din\_inverted on

and configured the jumper into the pull down position on the DIO_MATRIX board. I am on an STM32F407G-DISC1.

Interestingly, when using midibox_kb_v1_016 from the download page (precompiled), it works ok (there is still a problem where a number of keys generate wrong note numbers, but at least I get note on and off events for each key and velocity data is correct). However, when using midibox_ng_v1_035 from the download page (again, precompiled), I get absolutely nothing.

Currently, I cannot compile from the source code, but is the MB NG precompiled version up to date?

Best, ilmenator

Just to make the two cases more comparable, here are the specific configurations:

NG:

# KEYBOARD hardware KEYBOARD n=1 rows=8 dout\_sr1=1 dout\_sr2=2 din\_sr1=1 din\_sr2=2 din\_inverted=on break\_inverted=0 din\_key\_offset=32 \ make\_debounced=0 \ scan\_velocity=1 scan\_optimized=0 note\_offset=32 \ delay\_fastest=5 delay\_fastest\_black\_keys=0 delay\_slowest=100 EVENT\_KB id=1 type=NoteOn chn=1 key=any use\_key\_number=1 range=0:127 ports=00000000000011001000 lcd\_pos=1:1:1 label="Note %n" KEYBOARD n=2 rows=0 dout\_sr1=0 dout\_sr2=0 din\_sr1=0 din\_sr2=0 din\_inverted=0 break\_inverted=0 din\_key\_offset=32 \ make\_debounced=0 \ scan\_velocity=1 scan\_optimized=0 note\_offset=36 \ delay\_fastest=5 delay\_fastest\_black\_keys=0 delay\_slowest=100

 

KB:

[106059.595] kb 1 [106059.597] kb 1 debug on [106059.597] kb 1 midi\_ports 0x1011 [106059.597] kb 1 midi\_chn 1 [106059.597] kb 1 note\_offset 36 [106059.597] kb 1 rows 8 [106059.597] kb 1 velocity on [106059.597] kb 1 release\_velocity off [106059.597] kb 1 optimized off [106059.597] kb 1 dout\_sr1 1 [106059.597] kb 1 dout\_sr2 2 [106059.597] kb 1 din\_sr1 1 [106059.597] kb 1 din\_sr2 2 [106059.597] kb 1 din\_key\_offset 32 [106059.597] kb 1 din\_inverted on [106059.597] kb 1 break\_inverted off [106059.598] kb 1 make\_debounced off [106059.598] kb 1 break\_is\_make off [106059.598] kb 1 delay\_fastest 50 [106059.599] kb 1 delay\_fastest\_black\_keys 0 [106059.599] kb 1 delay\_fastest\_release 150 [106059.600] kb 1 delay\_fastest\_release\_black\_keys 0 [106059.600] kb 1 delay\_slowest 1000 [106059.600] kb 1 delay\_slowest\_release 1000 [106059.600] kb 1 ain\_pitchwheel off [106059.600] kb 1 ctrl\_pitchwheel 128 (PitchBend) [106059.600] kb 1 ain\_pitchwheel\_inverted off [106059.600] kb 1 ain\_modwheel off [106059.600] kb 1 ctrl\_modwheel 1 (CC) [106059.600] kb 1 ain\_modwheel\_inverted off [106059.600] kb 1 ain\_expression off [106059.600] kb 1 ctrl\_expression 11 (CC) [106059.600] kb 1 ain\_expression\_inverted off [106059.600] kb 1 ain\_sustain off [106059.600] kb 1 ctrl\_sustain 64 (CC) [106059.600] kb 1 ain\_sustain\_inverted off [106059.600] kb 1 ain\_sustain\_switch off [106059.600] kb 1 ain\_bandwidth\_ms 0 [106059.600] AIN Calibration Mode disabled.

 

Hm… does it make a difference if you replace din_inverted=on with din_inverted=1?

I used a 76key Roland synthkeybed in the past which has also DF layout with inverted diodes. That worked pretty much okay… except for the velocity… it seems that the velocity gets scanned a lot slower when using inverted keybeds… the resolution was quite low. But that’s a while ago…

Heck, yes! That was a good hint, thanks!

Now I only need to find out why some of the notes are shifted… What I get is this:

So, the first two Make/Break groups work ok, but for some strange reason the first two keys of the third one are shifted upwards. What I don’t get is why the remainder of that group (except for the seventh key) is giving me the correct notes??

Ok, that has to do with the din_key_offset parameter - if I set din_key_offset=0 then the notes are ok up until G3. Which apparently means, that the right half of the keyboard is connected through the second connector, starting with the third Make/Break group of keys. However, the fifths group starts with C1 again, going up to E1 on the uppermost key (which should be C4)…

Here is the debug output from pressing the C1 key:

[127304.986] --- [127304.986] DOUT SR1.7: 00000000 00000000 [127304.986] DOUT SR1.6: 10000000 00000000 [127304.987] DOUT SR1.5: 00000000 00000000 [127304.987] DOUT SR1.4: 00000000 00000000 [127304.987] DOUT SR1.3: 00000000 00000000 [127304.987] DOUT SR1.2: 00000000 00000000 [127304.987] DOUT SR1.1: 00000000 00000000 [127304.987] DOUT SR1.0: 00000000 00000000 [127304.987] DOUT SR2.7: 11111111 11111111 [127304.987] DOUT SR2.6: 11111111 11111111 [127304.987] DOUT SR2.5: 11111111 11111111 [127304.987] DOUT SR2.4: 11111111 11111111 [127304.988] DOUT SR2.3: 11111111 11111111 [127304.988] DOUT SR2.2: 11111111 11111111 [127304.988] DOUT SR2.1: 11111111 11111111 [127304.988] DOUT SR2.0: 11111111 11111111 [127304.989] KB1: DOUT#1.D6 / DIN#1.D0: pressed --\> key= 0, break contact, note=C-1 (36) [127304.989] Entry: timestamp\_break=4683 timestamp\_make=0 [127304.990] --- [127304.990] DOUT SR1.7: 10000000 00000000 [127304.990] DOUT SR1.6: 10000000 00000000 [127304.991] DOUT SR1.5: 00000000 00000000 [127304.991] DOUT SR1.4: 00000000 00000000 [127304.991] DOUT SR1.3: 00000000 00000000 [127304.991] DOUT SR1.2: 00000000 00000000 [127304.991] DOUT SR1.1: 00000000 00000000 [127304.991] DOUT SR1.0: 00000000 00000000 [127304.991] DOUT SR2.7: 11111111 11111111 [127304.991] DOUT SR2.6: 11111111 11111111 [127304.992] DOUT SR2.5: 11111111 11111111 [127304.992] DOUT SR2.4: 11111111 11111111 [127304.992] DOUT SR2.3: 11111111 11111111 [127304.992] DOUT SR2.2: 11111111 11111111 [127304.992] DOUT SR2.1: 11111111 11111111 [127304.992] DOUT SR2.0: 11111111 11111111 [127304.992] KB1: DOUT#1.D7 / DIN#1.D0: pressed --\> key= 0, make contact, note=C-1 (36) [127304.992] Entry: timestamp\_break=4683 timestamp\_make=4730 [127304.993] PRESSED note=C-1, delay=47, velocity=71 (played from a white key) [127305.820] --- [127305.820] DOUT SR1.7: 00000000 00000000 [127305.820] DOUT SR1.6: 10000000 00000000 [127305.820] DOUT SR1.5: 00000000 00000000 [127305.820] DOUT SR1.4: 00000000 00000000 [127305.821] DOUT SR1.3: 00000000 00000000 [127305.821] DOUT SR1.2: 00000000 00000000 [127305.821] DOUT SR1.1: 00000000 00000000 [127305.821] DOUT SR1.0: 00000000 00000000 [127305.821] DOUT SR2.7: 11111111 11111111 [127305.821] DOUT SR2.6: 11111111 11111111 [127305.821] DOUT SR2.5: 11111111 11111111 [127305.821] DOUT SR2.4: 11111111 11111111 [127305.822] DOUT SR2.3: 11111111 11111111 [127305.822] DOUT SR2.2: 11111111 11111111 [127305.822] DOUT SR2.1: 11111111 11111111 [127305.822] DOUT SR2.0: 11111111 11111111 [127305.822] KB1: DOUT#1.D7 / DIN#1.D0: depressed --\> key= 0, make contact, note=C-1 (36) [127305.822] Entry: timestamp\_break=0 timestamp\_make=0 [127305.823] RELEASED note=C-1 [127305.830] --- [127305.830] DOUT SR1.7: 00000000 00000000 [127305.830] DOUT SR1.6: 00000000 00000000 [127305.830] DOUT SR1.5: 00000000 00000000 [127305.830] DOUT SR1.4: 00000000 00000000 [127305.830] DOUT SR1.3: 00000000 00000000 [127305.831] DOUT SR1.2: 00000000 00000000 [127305.831] DOUT SR1.1: 00000000 00000000 [127305.831] DOUT SR1.0: 00000000 00000000 [127305.831] DOUT SR2.7: 11111111 11111111 [127305.831] DOUT SR2.6: 11111111 11111111 [127305.831] DOUT SR2.5: 11111111 11111111 [127305.831] DOUT SR2.4: 11111111 11111111 [127305.832] DOUT SR2.3: 11111111 11111111 [127305.832] DOUT SR2.2: 11111111 11111111 [127305.832] DOUT SR2.1: 11111111 11111111 [127305.833] DOUT SR2.0: 11111111 11111111 [127305.833] KB1: DOUT#1.D6 / DIN#1.D0: depressed --\> key= 0, break contact, note=C-1 (36) [127305.833] Entry: timestamp\_break=0 timestamp\_make=0

And this is for pressing the G#3 key:

[127332.400] --- [127332.400] DOUT SR1.7: 00000000 00000000 [127332.400] DOUT SR1.6: 00000000 10000000 [127332.400] DOUT SR1.5: 00000000 00000000 [127332.400] DOUT SR1.4: 00000000 00000000 [127332.400] DOUT SR1.3: 00000000 00000000 [127332.400] DOUT SR1.2: 00000000 00000000 [127332.400] DOUT SR1.1: 00000000 00000000 [127332.400] DOUT SR1.0: 00000000 00000000 [127332.401] DOUT SR2.7: 11111111 11111111 [127332.401] DOUT SR2.6: 11111111 11111111 [127332.401] DOUT SR2.5: 11111111 11111111 [127332.401] DOUT SR2.4: 11111111 11111111 [127332.401] DOUT SR2.3: 11111111 11111111 [127332.401] DOUT SR2.2: 11111111 11111111 [127332.402] DOUT SR2.1: 11111111 11111111 [127332.402] DOUT SR2.0: 11111111 11111111 [127332.402] KB1: DOUT#1.D6 / DIN#2.D0: pressed --\> key= 0, break contact, note=C-1 (36) [127332.402] Entry: timestamp\_break=33407 timestamp\_make=0 [127332.405] --- [127332.405] DOUT SR1.7: 00000000 10000000 [127332.405] DOUT SR1.6: 00000000 10000000 [127332.405] DOUT SR1.5: 00000000 00000000 [127332.405] DOUT SR1.4: 00000000 00000000 [127332.405] DOUT SR1.3: 00000000 00000000 [127332.405] DOUT SR1.2: 00000000 00000000 [127332.405] DOUT SR1.1: 00000000 00000000 [127332.405] DOUT SR1.0: 00000000 00000000 [127332.406] DOUT SR2.7: 11111111 11111111 [127332.406] DOUT SR2.6: 11111111 11111111 [127332.406] DOUT SR2.5: 11111111 11111111 [127332.406] DOUT SR2.4: 11111111 11111111 [127332.406] DOUT SR2.3: 11111111 11111111 [127332.406] DOUT SR2.2: 11111111 11111111 [127332.407] DOUT SR2.1: 11111111 11111111 [127332.407] DOUT SR2.0: 11111111 11111111 [127332.407] KB1: DOUT#1.D7 / DIN#2.D0: pressed --\> key= 0, make contact, note=C-1 (36) [127332.407] Entry: timestamp\_break=33407 timestamp\_make=33454 [127332.407] PRESSED note=C-1, delay=47, velocity=71 (played from a white key) [127332.506] --- [127332.506] DOUT SR1.7: 00000000 00000000 [127332.506] DOUT SR1.6: 00000000 10000000 [127332.506] DOUT SR1.5: 00000000 00000000 [127332.506] DOUT SR1.4: 00000000 00000000 [127332.506] DOUT SR1.3: 00000000 00000000 [127332.506] DOUT SR1.2: 00000000 00000000 [127332.506] DOUT SR1.1: 00000000 00000000 [127332.506] DOUT SR1.0: 00000000 00000000 [127332.506] DOUT SR2.7: 11111111 11111111 [127332.507] DOUT SR2.6: 11111111 11111111 [127332.507] DOUT SR2.5: 11111111 11111111 [127332.507] DOUT SR2.4: 11111111 11111111 [127332.507] DOUT SR2.3: 11111111 11111111 [127332.507] DOUT SR2.2: 11111111 11111111 [127332.507] DOUT SR2.1: 11111111 11111111 [127332.508] DOUT SR2.0: 11111111 11111111 [127332.508] KB1: DOUT#1.D7 / DIN#2.D0: depressed --\> key= 0, make contact, note=C-1 (36) [127332.508] Entry: timestamp\_break=0 timestamp\_make=0 [127332.508] RELEASED note=C-1 [127332.541] --- [127332.541] DOUT SR1.7: 00000000 00000000 [127332.541] DOUT SR1.6: 00000000 00000000 [127332.541] DOUT SR1.5: 00000000 00000000 [127332.541] DOUT SR1.4: 00000000 00000000 [127332.541] DOUT SR1.3: 00000000 00000000 [127332.541] DOUT SR1.2: 00000000 00000000 [127332.541] DOUT SR1.1: 00000000 00000000 [127332.541] DOUT SR1.0: 00000000 00000000 [127332.542] DOUT SR2.7: 11111111 11111111 [127332.542] DOUT SR2.6: 11111111 11111111 [127332.542] DOUT SR2.5: 11111111 11111111 [127332.542] DOUT SR2.4: 11111111 11111111 [127332.542] DOUT SR2.3: 11111111 11111111 [127332.542] DOUT SR2.2: 11111111 11111111 [127332.542] DOUT SR2.1: 11111111 11111111 [127332.543] DOUT SR2.0: 11111111 11111111 [127332.543] KB1: DOUT#1.D6 / DIN#2.D0: depressed --\> key= 0, break contact, note=C-1 (36) [127332.543] Entry: timestamp\_break=0 timestamp\_make=0

The make contact is different, but the note I get is still the same…

I am still trying to figure out why I get the same note events when pressing different keys (with reportedly different make contacts, as in the debug report above). Any clues on how this could be cured?

Thanks, ilmenator

I guess you don’t have any further informations about the keybed itself? 

What I did on a yamaha keybed some time ago is using jumper cables to check out where which BK / MK / row is. But in that case the local yamaha support was kind enough to send me the schematic of the keybed… so in the end it was not that hard… 

That’s right, I’ve been trying to find the service notes for this keybed (Roland Pro-E) for over a year now, but it seems this machine is so uncool that noone bothers…

Did you ask your local ROLAND-service? :wink: I’ll visit them the next days… I’ll ask them kindly :wink:

Here is the solution to the problem: by changing

rows=8

into

rows=10

the notes output for each of the 37 keys is correct, not just for the first 32.