Page 1 of 1
Posted: 12-06-21 11:29 am
by yingted
I'm testing out a Vangoa keyboard, one of the US$100-US$200 generic keyboards off Amazon. They seem to have the same control module, a variable number of keys, Bluetooth, and some have lights.

Example products:
88 keys, folding, lights, 10-day shipping, US$151.99:
88 keys, folding, lights, one-day shipping, US$179.99:

They're advertised as working with POP Piano, using its "Universal Keyboard Lights" driver. Unfortunately, lights do not work out of the box with Synthesia.

The keyboard exposes two Bluetooth devices, GZUT-MUSIC, an audio device, and GZUT-MIDI, a MIDI device.
On its MIDI input, the low channels all get synthesized. Channel 10 is sound effects, and lights are switched on/off with the following:
SysEx 0x4d 0x4c 0x4e 0x45 pitch 0x02*is_on
That is, SysEx with a 6-byte data, "MLNE" followed by a pitch and a value byte. Sending 0 turns the light off, sending 1 or 2 turns it on.

One quirk is that the BLE-MIDI timestamp high bits need to be set to 0, or neither synthesizing nor lights work. Most MIDI stacks seem to do this, but bluez on Linux does not.

I tested on Windows, Android, and Linux. Lights aside, it works okay on Windows, but sometimes crashes. Android needs a special BLE-MIDI to MIDI app, and the latency is bad. Linux also needs a BLE-MIDI to MIDI app, but you can recompile bluez with --enable-midi instead. If you use bluez, you also need to zero the timestamp high bits (or just all timestamp bits) in midi.c or the device will ignore it.

Posted: 12-17-21 12:01 pm
by Nicholas
yingted wrote: 12-06-21 11:29 am... it works okay on Windows, but sometimes crashes.
What crashes? The keyboard?
yingted wrote: 12-06-21 11:29 am... in midi.c
Which midi.c? Which source code are you using?
yingted wrote: 12-06-21 11:29 am... lights are switched on/off with the following...
I foresee the list of different proprietary key light communication methods growing longer and longer over the years. :grimace: