søndag 6. september 2015

Nailed it!

Finally got a stable, velocity sensitive version of the Prophet VS keyboard scanner working.

One last bug, double triggering of some notes took a long time an thorough research to figure out. I chose to quadruple the core speed from 16 to 64 MHz as some of the sends seemed to get delayed, possibly by the interrupt routines.

 However, this sees to have triggered bouncing in the top switch readings. As a key start switch always leads to a note on event (through timeouts), this would lead to notes that never got turned off. Why? Because off is only sent when the start switch opens, and this has happened long before the timeout if the key isn't really pressed.

The solution is to check if the start switch is still on before sending a timeout (or possibly resetting hasSentNoteOn on start key opening).

Debugging - each row corresponds to an event - note on/off, as read directly from the output bus. The bright green shows how long each note was pressed, the reds show notes that were turned on but never off. dark green-ish are where notes were turned off. Yellow shows notes with velocity 1, which means that velocity by itself didn't make the notes hang.

The reason velocity didn't work straight away wasn't that hard to find. I have always only measured the most significant bits of the data transmission to be able to use two probes for kybd and kyint. When timing out, the velocity had all the 6 msbits set to 0 so I assumed velocity should be 0. Not so. 0 is always read as "no more data" by the main mcu, so the minimum velocity has to be 1!

Ingen kommentarer:

Legg inn en kommentar