Haukcode.MidiDevice
1.0.5
dotnet add package Haukcode.MidiDevice --version 1.0.5
NuGet\Install-Package Haukcode.MidiDevice -Version 1.0.5
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Haukcode.MidiDevice" Version="1.0.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Haukcode.MidiDevice" Version="1.0.5" />
<PackageReference Include="Haukcode.MidiDevice" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Haukcode.MidiDevice --version 1.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Haukcode.MidiDevice, 1.0.5"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Haukcode.MidiDevice@1.0.5
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Haukcode.MidiDevice&version=1.0.5
#tool nuget:?package=Haukcode.MidiDevice&version=1.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Haukcode.MidiDevice
Cross-platform USB MIDI device I/O for .NET — no native library dependencies.
Key Features
- Enumerate, open, send, and receive on Windows, macOS, and Linux ARM64 (Raspberry Pi)
IObservable<MidiMessage>stream via System.Reactive- Strongly-typed message records:
NoteOnMessage,ControlChangeMessage,SysExMessage, and more - Full MIDI byte stream parser — running status, SysEx framing, interleaved real-time messages
- Pure managed C# with P/Invoke only — WinMM / CoreMIDI / ALSA rawmidi
Installation
dotnet add package Haukcode.MidiDevice
On Linux, libasound2 must be present (apt-get install libasound2).
Quick Start
// Enumerate
var inputs = MidiDeviceManager.GetInputDevices();
// Open and subscribe
using var device = MidiInputDevice.Open(inputs.First(d => d.Name.Contains("LPD8")));
device.Messages.Subscribe(msg =>
{
if (msg is ControlChangeMessage cc)
Console.WriteLine($"CC ch={cc.Channel} #{cc.ControlNumber} = {cc.Value}");
});
// Send
var outputs = MidiDeviceManager.GetOutputDevices();
using var output = MidiOutputDevice.Open(outputs.First());
output.Send(new NoteOnMessage(Channel: 0, NoteNumber: 36, Velocity: 127));
output.SendRaw([0xF0, 0x47, 0x7F, 0x30, 0xF7]); // SysEx
Platform Support
| Platform | Backend | Architecture |
|---|---|---|
| Windows | WinMM (winmm.dll) |
x64, x86, ARM64 |
| macOS | CoreMIDI | x64, Apple Silicon |
| Linux | ALSA rawmidi (libasound.so.2) |
x64, ARM64 |
Links
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- System.Reactive (>= 6.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.