MIDI over Bluetooth

I have done a major overhaul of Bluetooth in Oram. It is working well for me but I invite users to test.

There is a menu item in the admin menu called, “Bluetooth”. This takes you to the Bluetooth configuration view.

The first option “Enable Bluetooth” toggles the Bluetooth service. When the service is running, more options appear. The state of the service is remembered between restarts.

An entry for each Bluetooth controller is listed. By default this will be just the builtin / onboard RPi adapter but you can add another USB adapter and that will also show. Only one adapter may be enabled and they may initially all be disabled. Select an adapter to enable it. The selected controller is remembered between reboots. You can bold press on a controller to rename it. By default they are called the same as the Zynthian hostname.

Whilst the Bluetooth configuration view is open and a controller is enabled, the Zynthian will be scanning for Bluetooth devices. Each device will appear below the menu divider, “Devices”.

If a device checkbox is unchecked, the device is not trusted and will not connect. If it subsequently goes out of range or is switche off it will not reappear in the list.

If a device checkbox is checked, the device is trusted and should connect. When it is connected a Bluetooth icon appears between the checkbox and the device name. A trusted device will remain in the list even if it is not in range or turned on. (Each controller holds its own table of enabled devices, i.e. you could enable a device on the internal controller but it won’t necessarily be enabled on the USB adapter.)

Short select a trusted device to disable and remove it. It will disappear from the list. If it is in range it will reappear, unchecked.

Connected devices will provide their functionality if supported by Zynthian. HID (mouse, keyboard, etc.) should work.

BLE MIDI devices will create a MIDI input and output port that can be configured in MIDI Input and MIDI Output admin menus and can be connected / routed in chain option menus, like any other MIDI port.

Be aware that the onboard Bluetooth adapter has poor signal strength. It can be challenging to get a Bluetooth device to reliably connect, even at very short distances. It may be useful, especially if you have a custom build with the RPi positioning more sympathetic to this. This is why an external device may be advantageous.

Some possible enhancements that are not currently implemented:

  • Ability to rename devices
  • Indication of RSSI level
  • Indication of device type (HID, BLE MIDI, etc.)
  • Indication of battery level
  • Ability to block devices
  • Pairing authentication - currently authentication is disabled and any device can be trusted at Zynthian end only
5 Likes