Releases: microsoft/MIDI
Updated: Core SDK Shape Developer Preview 1
PLEASE READ THIS ENTIRE POST
Note: Rather than create a new release, I've updated this one. I won't usually do that, but really this was about getting a first release that folks can compile against, and the previous NuGet package failed there. The source code in the zip is out of date.
I know many DAW and audio developers are new to WinRT, so this release is to help you get started with it and also to be able to look at the SDK in the context of your own project, and provide feedback. The Core SDK is neither complete in shape nor functional. The packages in this release are for Intel x64 architecture only, not Arm64.
ALMOST ALL SDK CALLS WILL FAIL WITH AN EXCEPTION. THIS IS BY DESIGN
The implementation of almost every method call is this:
throw hresult_not_implemented();
One exception to that (no pun intended) is the MidiServices::SdkVersion
call. That will return a valid string. You can use that to verify you can call methods/properties and that the toolchain is working for you. Additionally, there's now a DummyClass which you can use to verify calls work. See the SDK Test project for an example of calling that.
The intent here is to provide a set of .winmd and .dll files that developers can use to make sure they are able to reference the WinRT library and call functions in their code.
Please refer to this documentation for getting set up:
For developers (C++) who need to access the DLL and WinMD directly, here are the steps. Right now, everything is part of the same NuGet package and installation is somewhat manual. That will change in the future as we break everything out by the type of client.
Current Way for Visual Studio:
- Set up a local NuGet Package Repository on your dev PC. On my setup, it's the "publish" folder under the "midi" root of the GitHub project. Easiest way to do this is to go into the NuGet Package Manager, click the settings button, and then add a local repo. I called mine "MIDI Services Local" and have the SDK NuGet generation steps throw the files in that folder.
- Put the downloaded NuGet package in that folder
- In the Project, add a NuGet reference to the package (Manage NuGet Packages)
- After that, until the .targets are set up properly, there's one manual step: in the same project, click "Add Reference" and then "Browse" to the project file's packages subfolder, then to the folder for this NuGet package, and in there, down to the runtimes\win10-x64\native folder (there will be a .winmd a .dll, and a .pri file in there) and reference the .winmd directly. This will force C++/WinRT to generate the projection. And, if you were building the sample project, remove the error about the missing Microsoft.Devices.Midi2.h file.
Alternative way for all tools:
- If you do not have Visual Studio 2022 installed, and don't plan to use it, then install the latest VC runtime for your platform. NOTE: The first preview here will only work with setups that have Visual Studio 2022 installed as it has a dependency on the debug VC++ runtimes. Working on it.
- Download the NuGet package.
- Change the file extension of the package to .zip from .nuget
- Inside the file, copy the .winmd and .dll files from runtimes\win10-x64\native\ to your project. Put them both in the same folder.
- In Visual Studio, add a reference to the .winmd file (see Get Started documentation in this repo for more information on this, including using with other toolchains.)
The root namespace is Microsoft::Devices::Midi2
Everything (SDK calls, namespaces, etc.) is subject to change, but it is getting more solidified over time. Feedback and discussion welcome in GitHub and on Discord.
Note: the C# projection is in the same NuGet package. Please see the Gett Started documentation for how to use the C# NuGet.