Lights support for generic Amazon keyboard

Trouble with Synthesia, your keyboard, or adapter? Think you found a bug?
When describing problems, always mention your OS and game version (shown at the bottom of the title screen).
  • If your keyboard has USB or MIDI ports, there is a tremendously high chance (>99%) it will work with Synthesia. See what you'll need on the keyboards page.
  • If you have a Logitech webcam and can't get your keyboard/adapter to work, see this post.
Post Reply
Posts: 1

Post 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.
Posts: 12823

Post 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:
Post Reply