Share via


Achievement Unlocked: MIDI support added to Windows 8.1 apps

[This is a copy of the blog post I originally wrote and published on behalf of the WSDS team. The original post can be found here: aka.ms/Img05f]

Since the release of Windows 8 Developer Preview I have been pushing our Multimedia group to add MIDI support for Windows Store apps. On April 4th, 2014 I achieved victory. This year at //build we announced the preview release of the Musical Instrument Digital Interface (MIDI) APIs for Windows Store apps. With this announcement you can now create Windows Store apps that can interface with the veritable plethora of MIDI keyboards, synthesizers and mixers that have shipped over the last three decades. That’s right you can now add a touch first XAML interface to your Roland JP-6 via any Windows 8.1 device! This means that musicians, audio engineers, DJs and lighting designers can be empowered to create unique experiences with your software while leveraging the full range of Microsoft Windows 8.1 devices.

The new MIDI APIs are not simple wrappers around the classic Win32 MIDI APIs. These new APIs have been built from the ground up. Our intent here is to create a consistent and extensible platform for the future of MIDI app development. We have focused on simplicity and ease of use. We parse the MIDI data for you and offer it up using the standard WinRT object oriented architecture. We hope that this will allow any WinRT programmer to leverage their existing knowledge to quickly come up to speed on these new APIs. That said we haven’t forgotten about all that custom MIDI parsing code you’ve been using in your apps since the dawn of MIDI. We also make the raw data available to you to party on as you see fit.

There are a number of things to consider before writing a new MIDI enabled app or adding MIDI support to an existing app. First and foremost the new MIDI APIs are still in preview (as of this writing). This is why you see “WindowsPreview” as the namespace prefix rather than “Windows”. Because these APIs are still in preview there is a chance that they may change when the final version is released. That said the current preview version of these APIs comes with a “go live” license. In essence we believe that these new APIs are solid and stable enough to enable you to use them in your apps right now. We will almost certainly tweak the APIs based on your feedback, so you may need to mod your app when the final version is released. That said we will continue to support the preview APIs for existing apps until such time that a vast majority of apps have migrated to the final release. So rest assured the MIDI preview APIs are ready to rock.

There are a few other “gotchas” when developing apps using the new MIDI APIs:

  1. Due to some technical strangeness you need to make sure to build your app for the platform that you are on. Using “Any CPU” is not going to work. What this means is that if you have a 64 bit installation of Windows you need to change your build configuration to target x64. Typically you can target x86 on an x64 system and be just fine thanks to “Windows on Windows”. Unfortunately with these new MIDI APIs you need to make sure to target the exact version of the OS. This means x64 on x64, x86 on x86 and of course ARM on ARM. Because of this you are going to need to provide an x86, x64 and ARM version of your app when submitting to the store. Hopefully this will change with the final release.
  2. The new MIDI APIs only work on Windows 8.1. So you need to make sure you are using Visual Studio 2013 and target Windows 8.1. This really shouldn’t be much of an issue as the migration from Windows 8 to Windows 8.1 is seamless and easy.
  3. You also need to make sure to download the new APIs via NuGet. Visual Studio 2013’s NuGet package manager (under the “project” menu) allows you to easily download the APIs and automatically add a reference to your project. That's right, for the first time we've made new APIs available via NuGet! Cool huh.

I hope you are as excited about the advent MIDI support in WinRT as I am. I can’t wait to see the new and innovative MIDI apps you add to the store.

 

Resources:

Windows Preview API

MIDI Windows Runtime sample

NuGet: Windows Runtime API for MIDI Preview 1.0.0

 

-James 

"Music is a higher revelation than all wisdom and philosophy." ~ Ludwig von Beethoven