DryWetMIDI provides ability to send MIDI data to or receive it from MIDI devices. For that purpose there are following types:
- IInputDevice (see Input device);
- IOutputDevice (see Output device);
- DevicesConnector (see Devices connector).
The library provides implementations for both
IOutputDevice: InputDevice and OutputDevice correspondingly which represent MIDI devices visible by the operating system. Both classes implement IDisposable interface so you should always dispose them to free devices for using by another applications.
You can use
OutputDevice built-in implementations of
IOutputDevice on Windows and macOS only. Of course you can create your own implementations of
All classes that interact with devices work with interfaces mentioned above, so you can create custom implementation of your devices (see examples in Input device and Output device articles) and use it for playback or recording, for example.
MIDI devices API classes are placed in the Melanchall.DryWetMidi.Multimedia namespace.
To understand what is an input and an output device in DryWetMIDI take a look at the following image:
So, as you can see, although a MIDI port is MIDI IN for MIDI device, it will be an output device in DryWetMIDI because your application will send MIDI data to this port. MIDI OUT of MIDI device will be an input device in DryWetMIDI because a program will receive MIDI data from the port.
If some error occured during sending or receiving a MIDI event, the ErrorOccurred event will be fired holding an exception caused the error.