With the proliferation of Bluetooth enabled devices, IoT (internet of things), wireless technology is one of the hottest trends today with wide-reaching applications to audio, automotive, medical and other industries. Gibson R&D is actively involved with wireless technology both in the hardware and software space and a member of the Bluetooth SIG, responsible for the development and evolution of the Bluetooth specification. As a Gibson Brand, Cakewalk is committed to embracing the advantages of wireless technology. This year, we’re excited to integrate wireless MIDI technology into all versions of SONAR – our flagship recording, editing, and mixing software.
In the 2017.03 release of SONAR we worked closely with Microsoft to add support for Bluetooth LE MIDI devices via the new UWP MIDI API. In November of 2016, we added support for Microsoft’s new low-latency WASAPI shared mode API’s, which including support for Bluetooth audio devices via WASAPI. With these enhancements, SONAR now has built-in support for wireless audio and MIDI via Bluetooth.
In this blog post we’ll delve into some of the technical details behind some of the these features.
Bluetooth is here to stay
There are dozens of wireless data standards today. So why is Bluetooth so popular?
Wireless standards may be grouped into a few classes:
- Optimized for short-range communications (Bluetooth),
- Wide area communications (801.11g/n/a, DECT etc, 802.11 over AVB),
- Nationwide or global coverage (cellular networks 3G, 4G LTE, etc)
- Personal area networks (Bluetooth LE, UWB, etc).
By far the most ubiquitous wireless protocol in use for audio devices is Bluetooth. This is primarily due to low-cost of Bluetooth hardware, ease of use, widespread adoption and availability of devices with built-in Bluetooth support – cars, cellular phones, headphones, speakers, even door locks are equipped with Bluetooth functionality today.
AVB (Audio Video Bridging) is one of the more promising networking technologies for audio due to its high bandwidth capabilities and scalability, and has also generated a lot of buzz in the audio community. Although wired AVB has gained a fair amount of traction with many pro audio interfaces as well as the automotive industry, wireless AVB unfortunately has been slow to develop.
Bluetooth may have gotten a bad rap in the past for error prone device discovery and pairing, high latency and glitchy audio playback. With the adoption of more recent Bluetooth standards such as BT 4.0 and higher, stability has greatly increased and the latency is much improved. With the addition of MIDI data transmission via the Bluetooth LE specification, Bluetooth is now a complete media streaming solution. Bluetooth 5 continues to evolve, adding 4X the range, 2X the speed, and 8X the data broadcasting capacity compared to Bluetooth 4. Longer range powers whole home and building coverage, for more robust and reliable connections.
Universal Windows Platform (UWP) vs WIN32 desktop apps
In current versions of Windows there are two kinds of applications.
- Win32 apps or “classic” windows applications like SONAR
- “Modern” UWP applications that are built using newer Windows programming interfaces.
Microsoft has been encouraging developers to build UWP applications for some time. Unfortunately UWP applications run in a sandbox, have limited ways to communicate with other Win32 applications like plug-ins and have limited access to the file system and hardware. This presents challenges for applications like SONAR, which use these services heavily.
Recently, Microsoft announced a UWP desktop bridging mechanism to package Win32 applications as UWP. While this is a step in the right direction, there are still limitations to overcome.
The most widely used MIDI programming interface is the classic MME (Multimedia extensions) API that has been in existence since 1991. DirectMusic was another somewhat lesser-used, higher-level API for MIDI. MME has been in use by DAW applications for decades. While audio support in Windows has progressed a lot from MME via ASIO, WDM, and WASAPI, MIDI support in Windows has seen no updates until recently.
In Windows 10, Microsoft introduced the new UWP MIDI API. The idea was to provide a more modern and extensible way for UWP applications to communicate with MIDI devices and provide support for newer MIDI protocols / interfaces. Since this API was designed for UWP applications, it was not adopted by most DAW vendors who are building Win32 applications.
Recently, in Sept 2016 Microsoft released a UWP wrapper to allow Win32 applications to also use the UWP MIDI API through a translation layer. Cakewalk evaluated this API and found it viable. Details about this announcement and more info about UWP MIDI can be found in this Microsoft blog post.
Advantages of UWP MIDI
- UWP is the new API platform so any changes to MIDI functionality will be available only via UWP and not the older MIDI APIs
- Can be used by both UWP apps as well as Win32 apps (using the Win32 wrapper)
- Supports Bluetooth LE MIDI (BLE-MIDI) protocol
- Handles multi-client access to MIDI ports
- Much simpler API to use overall
Bluetooth LE MIDI support
The Windows 10 Anniversary Edition, includes in-box support for Bluetooth LE MIDI (BLE-MIDI) that was developed by an MMA working group. Bluetooth Low Energy (BLE) is a wireless connection specification supported by the majority of mobile computing devices. BLE can extend battery life for mobile devices using connected accessories (such as MIDI keyboards and controllers) that don’t continuously stream data.
Bluetooth MIDI can be used by any application via the Windows 10 UWP MIDI API. As long as the PC has a Bluetooth LE capable radio, no additional hardware is necessary to talk to Bluetooth MIDI peripherals such as keyboards, pedals and controllers. Note that the PC itself can’t be a Bluetooth peripheral as of now, since Microsoft hasn’t implemented that yet.
Bluetooth Audio Support
Windows has built-in support for Bluetooth audio devices. As of the November 2016 update, SONAR supports Bluetooth audio via WASAPI. After you pair a Bluetooth audio device in Windows, the devices will be listed in SONAR when the audio driver mode is set to WASAPI (shared mode or exclusive). All standard Bluetooth audio devices are supported including microphones, speakers as well as input/output devices. SONAR will also respond to the transport control buttons that are found on many Bluetooth headphones. i.e. You can start, stop and seek the timeline using these headset buttons.
Using Bluetooth devices in SONAR
UWP MIDI is a new MIDI driver mode in current versions of SONAR. Similar to audio driver modes, you can pick the MIDI driver mode under Preferences | MIDI | Playback and Recording.
To see a Bluetooth MIDI device in SONAR you must pair it to your PC before you start up SONAR. Bluetooth MIDI devices will then show up as available MIDI devices when the MIDI driver mode is set to UWP in SONAR.
To use Bluetooth Audio devices ensure that your audio driver mode is set to WASAPI (shared or exclusive)
Bluetooth audio or MIDI devices will have varying internal latency depending on the hardware. In SONAR however you should always set the audio buffer latency as low as it can go without glitching. This will ensure that SONAR doesn’t add additional latency to the signal flow when using Bluetooth devices.
Examples of Wireless devices
The Jamstik+ SmartGuitar is a wireless MIDI guitar controller that sends MIDI data over Bluetooth to SONAR.
The puc+ is a portable MIDI device that allows you to wirelessly connect any USB-MIDI or 5-pin MIDI controllers to SONAR. This can be handy if you have a keyboard or MIDI device that is too far from your DAW or you don’t have a MIDI interface on your PC.
Check out this video of the Jamstik+ in action in SONAR:
2 Replies to “Wireless Audio and MIDI in SONAR”
what kinds of latencies are you seeing with the puc? I have a Yamaha MD-BT01 and seeing quite large latency playing my wx-5 in sonar. What are the kinds of tweaks that a user can do to minimize this latency?
Overall I’m excited about this development and over time things will get better(faster,etc).
Thanks for the article!
Thanks Phil, we’re doing some more research into latency and hope to have a follow-up soon!