Bluetooth LE MIDI


BLE MIDI was an Apple defined de-facto standard until it became official part of the MIDI specification in 2016.

In recent years BLE MIDI has grown into something like "everybody's darling". macOS, iOS and Android all have native support for it and even Windows can handle it, although it will only be available in UWP programs (UWP == 'Universal Windows Platform' - probably still mostly x86 PCs). There is quite a large number of musical input hardware and BLE interfacing solutions for standard MIDI gear available on the market today.

Bluetooth LE sure has its advantages. Its low energy consumption especially makes it ideal for battery-powered devices. Setup can be relatively pain-free and in some situations it can indeed present a usable alternative to WiFi or other wireless approaches.

There are points that make the whole idea a bit questionable, though. Technically as well as in terms of usability. Usability on Android in particular will depend a lot on the system version. Up to version 11 Android's overly broad permission groupings will frequently stand in the way of making BLE MIDI a pleasure to use.

Android 11 and lower

Android has traditionally tied Bluetooth LE functionality into the wider 'Location' context. That makes sense to some degree - proximity to Bluetooth devices, especially BLE 'beacons' made for just that purpose, can potentially be used to track a device's location. Requiring a device's GPS receiver to be active and apps to be allowed to read the user's exact location in order to use Bluetooth peripherals on the other hand makes no sense at all. That's how it is on Android versions up to 11, though. If you are on an older system version you will have to go through some hoops to use BLE MIDI devices with TouchDAW:
  1. Activate the system's global 'Location' option in the 'Settings' app.
  2. TouchDAW does not hold the 'Location' permission and I am never going to ask for it. You will need a third party app to scan for and connect BLE MIDI devices:
    Install either MIDI BLE Connect or Bluetooth MIDI Connect
    from the Play Store (Both apps are free and do not contain ads).
  3. Run the app, grant it the required permissions and let it scan for devices. Once things got found, touch the one you want and it will be connected to Android's MIDI system
  4. After this the MIDI device should appear on the Bluetooth page in TouchDAW's MIDI Port setup dialogs and can be selected like any other MIDI device.

Important: Do not 'back' out of the connector app, use the task switcher to change to TouchDAW! Unused BLE MIDI devices get removed rather quickly and your device might be gone before TouchDAW has a chance to open it when you quit the connector app.

After one of the apps linked above is installed it can also be launched with a long-click on the Bluetooth button in TouchDAW's MIDI Port dialogs.

On Android 11 and lower you will need to rescan for devices and reconnect them when starting the app and the device had been out of scope!



Android 12+

frees most Bluetooth devices from 'Location' permissions and you can now scan for and connect to BLE MIDI devices from within TouchDAW. The global 'Location' setting can stay off.

In the port setup dialog touch and hold the Bluetooth button. The first time you do so, Android will prompt you with a runtime permission dialog as shown on the right. The 'Nearby Devices' permission is still required, but it won't allow apps to determine your location.

▶ If you choose to 'not allow' access here, Android won't give the app a chance to ask again, but will directly fail any actions guarded by the permission. If you change your mind use the system's app settings to revert your decision (touch and hold the app's icon, select 'App Info' and go to 'Permissions')


After being granted the permission, TouchDAW will kick off a device scan and list what it finds in the dialog. Select the device(s) you want to use and touch the then enabled 'Connect Selected' button. This does not yet select the device for use on the app's MIDI connection, but only hooks it up to Android's MIDI subsystem, ie. it turns generic BLE devices into BLE MIDI devices.

The dialog then switches back to the original Bluetooth page where you can select a single device for use on the given MIDI port.

If only a single device has been discovered and you already know it is the one to use on the MIDI port, you can long-click the 'Connect Selected' button. That skips all intermediate steps, selects the device for use on the port and closes the setup dialog.

If one of TouchDAW's ports is set to use a BLE MIDI device it will automatically rescan for the device and reconnect it if it is around when the app starts.



Software Defined Radio - TouchDAW as a virtual BLE MIDI Peripheral

TouchDAW 2.2.5 can turn your phone or tablet into a Bluetooth LE MIDI device that can then be connected to computers like any other 'real' Bluetooth MIDI device. This is an experimental feature that uses the system's BLE APIs in ways not officially promoted or documented. Apart from some minor restrictions caused by limited and missing system APIs it works surprisingly well. To enable it, turn on the 'BLE Peripheral Mode' preference at Setup / MIDI Ports / MIDI Options (Note that the option will only be visible when Bluetooth is enabled).

Your mileage on older system versions - especially Android 6 & 7 - may vary.
With Android on Chrome OS this is almost certainly not going to work!

The first of the mentioned restrictions is related to the name the virtual device will be seen under: Normally that would be the Android device's name (like 'Pixel 4a', 'Galaxy S10' or eq.). Android's BLE advertisements however are strictly size limited. If your device's name is longer than 8 characters, including it in advertisements would fail and in turn nothing would get advertised. The APIs do not allow to set a name, so TouchDAW can not make sure the name will fit by truncating it if needed. What it can and eventually will do is instruct the Bluetooth stack to not include the device name at all. Computers will then show the raw Bluetooth address in their UIs instead of a friendly name. You can circumvent this, by eventually renaming your 'Galaxy S10' (10 characters, so too long). This can normally be done under 'About Device' in Android's settings.

In TouchDAW the virtual device will appear as 'BLE Peripheral' on the Bluetooth page of MIDI Port dialogs (see screenshots above). To activate it, select it like any other MIDI device, close the dialog and leave the app's setup. On Android 12+ TouchDAW will then prompt you for the 'Nearby Devices' permission unless you had previously scanned for Bluetooth devices. On older system versions this seems to slip through without requiring any permissions, but the system's 'Location' option will still need to be on.

Once the MIDI port is opened, TouchDAW will start to send BLE advertisements that will make it visible to other devices and computers as a BLE MIDI device. How to proceed depends on the operating system of the device that opens the peripheral:

Mac

Open 'Audio MIDI Setup', go to its 'MIDI Studio' and bring up the 'Bluetooth Configuration'. The Mac will then scan for BLE MIDI devices and list them as shown below. Click the 'Connect' button behind the device you want to use and a new Bluetooth device will appear in the 'MIDI Studio'. MIDI programs will see a new MIDI port that may be named 'Bluetooth' or 'Bluetooth (Device name)'.

macOS stores its newly created MIDI device and sets up a fixed relation between it and the Bluetooth device's hardware address. This becomes a problem the next time you try to use it, because Android will randomize the Bluetooth address and will never come back as 'the same' device. In consequence an already installed MIDI device will remain 'offline' and a new one will show up in the 'Bluetooth Configuration'.
To avoid filling up the 'MIDI Studio' with dead devices, you may want to remove offline instances before connecting new ones.

Windows

Windows 10 & 11 will need to be paired with the Android device via Windows' Bluetooth settings. Once that is the case they will automatically hook up the virtual peripheral as a BLE MIDI device and make it available to programs that use UWP MIDI APIs. Windows completely forgets BLE devices when they disconnect and shut down. The next time the device is advertised Windows will create a new instance. It is therefore not affected by Android's address randomization. In general the virtual peripheral should work pretty much like any other hardware BLE MIDI device.

Apart from some serious performance issues (see 'Technical Considerations' below) the biggest problem on Windows will be that hardly any program uses UWP MIDI APIs. Cakewalk and Cubase can now be set to use them, but most of your MIDI gear will probably no longer work when you do so. Please refer to the programs' respective documentation:

Cakewalk - Universal Windows Platform MIDI support
Cubase 12 - WinRT MIDI and Windows Bluetooth MIDI support

Android

Use of the virtual peripheral is the same as with other BLE MIDI devices. Address randomization is not a problem as Android does not store long term references for Bluetooth MIDI devices.



Potential issues with BLE MIDI and troubleshooting them
  • To pair or not to pair?
    Bluetooth MIDI peripherals should in theory not require OS level pairing before becoming connectable. However, while usually at least no pairing codes need to be exchanged, things are a bit murky here:
    Windows insists on devices being hooked up via the system's Bluetooth control panel, before they can be used. Their status will then change from "paired" to "connected" when actively in use.
    Android may show a pairing notification that needs to be confirmed when first connecting a new BLE MIDI device. It disappears rather quickly, watch out! Things won't work if you miss it and discovered devices will quickly get removed.

  • Device not discoverable?
    BLE peripherals will only work with a single host at a time. Make sure things are not in use anywhere else. Try power-cycling the peripheral in case. On older Android versions keep in mind that the system's 'Location' option will need to be active.

  • Device getting removed shortly after connection?
    Bluetooth on Android has traditionally been a mess. The software stack has been swaped out entirely multiple times and device hardware is as fragmented and diverse as it can get. Things are improoving, but incompatibilities between Bluetooth stacks, chipsets etc. can not be ruled out. I have seen devices working just fine with a Mac, but only connecting on Android for a brief period of time before the MidiManager unhooks them again.

  • Virtual peripheral connects, but no MIDI received?
    On both macOS and Windows BLE MIDI ports will be created and removed dynamically when devices connect and disconnect. After connections were made, it may be necessary to (re)enable MIDI ports in DAWs and other MIDI software.

  • Latency too high?
    Bluetooth LE is borderline usable for musical input in terms of connection speed. Even the lowest latency achievable as per its specifications will theoretically not be good enough to make anybody used to a real piano very happy.
    If things are particularily bad: Move your devices closer together. Unpair and remove unused Bluetooth devices from the system. Turn off WiFi.
    Do not attempt to use BLE MIDI as a DAW Controller connection in Windows UWP programs! The sheer amount of messages sent by DAWs combined with the non-existent OS-side message bundling optimizations will make hundreds of messages pile up in Windows' Bluetooth stack. It's just not usable (see 'Technical considerations' below)



BLE MIDI - some technical considerations