Giter VIP home page Giter VIP logo

rtmidi.core's Introduction

RtMidi.Core

icon

Build status NuGet

MIDI support on both Windows (64-bit or 32-bit) and Mac OS X (64-bit) for .Net Standard 2.0 with support for both input and output midi devices, and support the following midi messages:

  • Channel Pressure
  • Control Change
  • Note On / Off
  • Pitch Bend
  • Polyphonic Key Pressure
  • Program Change
  • Non-Registered Parameter Number (NRPN) (used to send/receive 14-bit parameter and value)
  • System Exclusive (SysEx)

See changelog for version history.

Example

// List all available MIDI API's
foreach (var api in MidiDeviceManager.Default.GetAvailableMidiApis())
    Console.WriteLine($"Available API: {api}");

// Listen to all available midi devices
void ControlChangeHandler(IMidiInputDevice sender, in ControlChangeMessage msg)
{   
    Console.WriteLine($"[{sender.Name}] ControlChange: Channel:{msg.Channel} Control:{msg.Control} Value:{msg.Value}");
} 

var devices = new List<IMidiInputDevice>();
try
{
    foreach (var inputDeviceInfo in MidiDeviceManager.Default.InputDevices)
    {
        Console.WriteLine($"Opening {inputDeviceInfo.Name}");

        var inputDevice = inputDeviceInfo.CreateDevice();
        devices.Add(inputDevice);
        
        inputDevice.ControlChange += ControlChangeHandler;
        inputDevice.Open();
    }

    Console.WriteLine("Press any key to stop...");
    Console.ReadKey();
    
}
finally
{
    foreach (var device in devices)
    {
        device.ControlChange -= ControlChangeHandler;
        device.Dispose();
    }
}

RtMidi Version

We are using a fork off rtmidi master branch with a few changes (you can see a diff here between our fork and official repository) to make it possible to build on the platforms we are interested in and with changes to better support .Net P/Invoke.

You can find our fork at micdah/rtmidi.

Acknowledgements

Special thanks to the contributors (in alphabetical order):

rtmidi.core's People

Contributors

micdah avatar mat1jaczyyy avatar mgulubov avatar xul13 avatar

rtmidi.core's Issues

Make DeviceInfo Classes Public

Make RtMidi.Core.Devices.Infos classes public so that they can be inherited from outside the project.
The reasoning is that these classes cannot be mocked and thus objects that use them cannot be properly unit tested.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.