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. Central & Peripheral Modes Bluetooth LE - much like USB - has two general device roles. Connections consist of a 'central', that inititialises the link and a 'peripheral'. Most BLE MIDI hardware will act as peripheral devices with the computer, phone or tablet being the 'central'. Central mode - Connecting common BLE MIDI hardware This usually involves scanning for and activating Bluetooth devices before they can be used for MIDI transport. Procedures and requirements depend a lot on your Android version: 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:
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. Peripheral Mode or 'Software Defined Radio' - TouchDAW as a virtual BLE MIDI device
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 (The option will only be visible when Bluetooth is enabled at the device level).
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'. 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 much of your MIDI gear will probably no longer work as it used to 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
BLE MIDI - some technical considerations
Bluetooth LE is a packet based system, that exchanges data in packets of limited size at a limited maximum frequency. The BLE MIDI specifications demand that sender and receiver should negotiate a 'minimum connection interval' that is not larger than 15ms, while the absolute minimum interval between two packets is defined as 7.5ms. Maximum packet size is usually ~520 bytes. In practise BLE MIDI devices mostly negotiate a packet-size no larger than 185 bytes. 180+ bytes of course is plenty big enough for the usual 3 byte MIDI message. However: Using an extra packet for every single MIDI message means that even a moderately complex chord consisting of three notes will take 3 * 15 milliseconds to make it over the air. And as the 15ms recommendation is just that, higher 'minimum connection intervals' will occur. Plus actual transmission on radio networks is under influence of various other things and will not necessarily operate as how some specification imagines it.
So even from a theoretical point of view and assuming that everything would work as good as it possibly can, BLE is at the very edge of being usable for musical input. In the end it's kind of an equivalent to portable Bluetooth speakers: In the interest of convenience you are supposed to accept that new technology actually is a significant step backwards: Even on standard 1980's DIN MIDI connections it will not take more than 1 millisecond to transmit a single Note message. Now there are some ways to optimize things a bit and Apple's original specification already described them: The operating system's implementation should take care of actively bundling as many MIDI messages as possible into a single BLE packet using running status whenever possible. Ideally that would mean that whatever happens in the 15 milliseconds between two connection intervals is written into some temporary buffer before being sent off. MIDI messages inside a BLE packet can carry individual timestamps so the temporal relation between them can be preserved and could be recreated by the receiver. Apparently the only operating systems that indeed do so are Apple's (I have not looked at iOS, but would assume that it will roughly be the same as on macOS). CoreMIDI aggressively aggregates what a DAW has to send and transmitted BLE packets will often be up to 182 bytes in size and contain MIDI that covers timespans that according to the timestamps within them are up to 100ms long. This of course only obscures the transport inherent 15ms latency and puts a lot of demand on the receiver, who would need to make sure that messages are being played out according to timestamps, while the absolute latency will indeed become even higher. The approach does however achieve that things will remain to be somewhat usable even if there are larger amounts of data to be sent: The approximately 50 single messages combined in one BLE packet will all together take ~ 100 +- 15 milliseconds to make it to the other side. Each of them sent in an extra BLE packet - as Windows will do - would take 50 * 15 = 750ms. To illustrate that with a real world example: A DAW's initial data dump to a Mackie Controller may consist of up to ~300 MIDI messages. There will be lots of sysex containing LCD text, notes that set button states, CC data for encoders and timecode etc. Logic Audio on macOS Monterey will achieve to transmit that data in a total of 28 BLE packets. There are packets containing only single messages (sysex), but most of them will consist of many running status combined messages - up to 86 per BLE packet. The total absolute time it takes to transmit that data is about 600ms. Things are in the same ballpark with Live and Reaper on macOS, the optimization obviously is in the operating system. And while not perfect it at least makes it somehow possible to run a DAW controller over Bluetooth LE on macOS. Looking at a Windows DAW on the other hand: Cakewalk set to use UWP MIDI and a Mackie Controller on a BLE MIDI connection sends a total of 311 single MIDI messages initially. Each MIDI message uses its own BLE packet, sometimes containing no more than 2 bytes of valid MIDI data. Even sysex messages that would easily fit into the 185 byte size limit are often split into multiple packets further increasing the overhead. The total time it takes to transmit that data is about 10 seconds (Timestamps indicate a range of ~6 seconds, but things are sent in multiple bursts as if the Bluetooth stack completely blocks at points). Now if this was a one-time initial action it might somehow be acceptable, but equally large text and button-state updates will occur whenever you change fader banks or encoder assignments. Even when things are just running and the DAW only sends timecode, audio levels and maybe some automation data to set motorfaders, the amount of data to be transmitted is not exactly neglectable. What then happens is that hundreds and thousands of packets pile up in the Windows Bluetooth stack and the controller gets further and further behind the DAW timewise. When you press stop, Cakewalk stops but the controller will continue to 'play' for seconds or even minutes depending on how long the DAW was actually running. It's just hilarious. Way to go Microsoft! (I'm already very much looking forward to having this attributed to the 'garbage Android app'. It's common knowledge after all: If something goes wrong on this planet, it must obviously be TouchDAW's fault.) Further reading: Here is an interesting (not overly scientific) scientific paper from the 'Interaction Lab' at McGill University in Canada: Practical Considerations for MIDI over Bluetooth Low Energy as a Wireless Interface |
||||
|