MIDIFunc and MIDIdef are the standard, recommended way to receive MIDI note on/off, controller, pitch bend, aftertouch, poly-touch and program change messages.
NOTE:IMPORTANT: Before MIDI can be received, SuperCollider needs to be told to connect to the MIDI subsystem and connect to the available devices.
You need to do this once after launching SuperCollider, or recompiling the class library.
There are some examples in the wild using the MIDIIn class directly to receive MIDI. This is not recommended for normal use. The exceptions are sysex (system exclusive) and sysrt (MIDI clock) messages, which are currently supported only by MIDIIn. See the example below.
This class connects to the operating system's MIDI layer, and obtains the lists of available MIDI sources and destinations. The information about the hardware is stored in MIDIClient.sources and MIDIClient.destinations as MIDIEndPoint objects. MIDIClient must be initialized before MIDI can be received. See the note above.
The lowest-level MIDI input class. MIDIFunc and MIDIdef use this class so that you don't have to. It is strongly recommended to avoid using this class directly.