You'll then use that ID when getting an input or output device. You'll want to get the ID of the MIDI device you plan to use. NET (installed with Windows 10), plus a little imagination.
Then follow the examples in the scripts for how to send and receive events.
To use the MIDI API from PowerShell, copy the compiled C# DLL () from the /bin/debug folder to the folder where your script resides (or some other convenient location) and update the import path in the script to point to it. The samples were written using a Novation LaunchPad, but are generic enough (with the exception of the text banner scrolling) to work on anything. The code here includes MIDI send, and basic MIDI receive (note on/off, plus continuous controller messages, and program change). If you can automate it from PowerShell, you'll now be able to have it either send information to a MIDI device (sounds, lighting, etc.), or be triggered from a MIDI controller (like programmable touch pads and other controllers). This library enables you to use Windows 10 MIDI APIs from PowerShell. Here's a simple example to list the MIDI devices on the system. Upcoming PowerShell Book on Amazon What does the script look like?
Wikipedia page with overview and descriptionġ0 Cool things you can do with Windows PowerShell In Windows 10 (and in 8.1 as I recall) you can optionally set PowerShell to be the default command prompt for the power-user menu you get when right-clicking the start button on the task bar. PowerShell version 5 comes with Windows 10. PowerShell 1.0 was released in November 2006 and targeted Windows XP and later.
Folks also make script libraries available for others to use both for free and for sale. PowerShell can be extended through cmdlets (command-lets) written typically in C# or Visual Basic. Also, given the typical audience, the official documentation is.challenging. It does require some programming savvy, so it's not something you can use to drag and drop components to build out a script. It first found favor with network/system administrators, but has since expanded to include client and IoT developers, as well as web folks, among the users. PowerShell is the advanced command prompt/shell built into Windows. We don't have MIDI routing in Windows yet, but we do have PowerShell, which lets you do a fair bit of automation and other system-level hacking. With the release of Windows 10 and our new, modern, multi-client MIDI API, I thought it was time to build out something like this for Windows users. I've been totally jealous of that for some time. I first heard about this when watching a Sonic State podcast and learning that Nick uses (or used at the time) a little Korg Nano control to switch between people on Skype and/or change which input was active on the podcasting program. Folks on the Mac use MIDI controllers and the built-in scripting language to control things like app switching, or to send commands to specific apps.