ojacques/SynthesiaKontrol

Not working on KK S61 MK1, Windows

johnawerner opened this issue · 1 comments

Unfortunately this was not working with my KK S61 MK1, on Windows. The S61 was found and the CoolDemoSweep function worked. But after that, the lowest C key would remain dimly lit, and no other keys would light in response to the MIDI events coming from Synthesia. The MIDI events were being written to the command window.

Edit:
After studying the code more and thinking it over, I have a better grasp on the issue.

The main issue is local instances of bufferC being created that hide the global instance. This occurs in both notes_off() and CoolDemoSweep(). Instead of setting the elements of bufferC to 0x00, the code makes an assignment, similar to:
bufferC = [0x00] * NB_KEYS
This assignment creates a local instance of bufferC, it does not update the global instance defined in init().

This causes an issue for my S61 MK1 keyboard because the buffer is too long by one byte. This is caused by the global instance and the local instance in notes_off() being 249 bytes, and being written to the device using:
device.write([0x82] + bufferC)

An additional problem is the color used for the thumb keys. The MK1 ignores the most significant bit of the RGB byte values. This makes 0x80 equivalent to 0x00, and causes any MIDI event using a thumb channel to not light the key.

I have a version that fixes these issues, and I'm working on a fix for a small issue in CoolDemoSweep(). (Caused by calculating the index into bufferC using x*3-2 when the loop index equals 0.) If you'd like, I will update the code so you can test it. I'm new to GitHub, so I'm not sure of the best way to do this.

I've decided to write my own version, but I will give you and others full credit for the work you've done.