MIDI:
Filter:
Guides | External Control > MIDI

MIDI

about MIDI

Practical usage overview

Begin with the Using MIDI help file.

Receiving MIDI input

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.

Sending MIDI output

See the MIDIOut help file for details.

Summary of MIDI classes

MIDIClient
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.
MIDIFunc
The optimal way to receive the most typical MIDI messages: note on/off, controller, pitch bend, aftertouch, poly-touch and program change.
MIDIdef
Related to MIDIFunc, this class keeps several MIDIFunc objects in global storage, by name. Especially helpful for live or interactive use.
MIDIOut
Supports MIDI output to hardware ports or inter-application MIDI buses.
MIDIEndPoint
Represents a MIDI port published by the operating system. It contains a device name, port name and unique identifier (uid).
MIDIIn
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.

Examples

MIDI input:

MIDI output:

Receiving system exclusive messages: