This document explains technical details of the MIDI hardware interface class, MIDIIn.
MIDIIn is a simple and direct interface. When MIDI events come into SuperCollider, MIDIIn evaluates simple handler functions.
Certain MIDI messages are supported only through MIDIIn. These are: sysex, sysrt, smpte.
See the Using MIDI helpfile for practical considerations and techniques for using MIDI in SC.
MIDIIn links MIDI input received from the operating system to a set of user defined functions. Only one set of MIDI input handling functions can be active at a time, they are stored in the following class variables:
noteOff, noteOn, polytouch, control, program, touch, bend, sysex, sysrt, smpte
The first argument these functions receive is an unique identifier that specifies the source of the data.
searches for a connected MIDIEndPoint by name.
Add a Function or similar object to be evaluated whenever a particular MIDI message is received. This method is preferable to the setters below, since it will not overwrite any existing functions.
what |
A Symbol indicating the message type to wait for, one of |
func |
A Function or similar object to be evaluated when a message of the specified type is received. See the setters below for the arguments which will be passed at evaluation time. |
Remove a Function or similar object from the list of those to be evaluated whenever a particular MIDI message is received. This method is preferable to the setters below, since it will leave any existing functions in place.
what |
A Symbol indicating the message type, one of |
func |
The Function or similar object to be removed. |
Replace a Function or similar object in the list to be evaluated whenever a particular MIDI message is received with another one. This method is preferable to the setters below, since it will not overwrite any existing functions.
what |
A Symbol indicating the message type to wait for, one of |
func |
The Function or similar object to be replaced. |
newFunc |
A Function or similar object to be evaluated when a message of the specified type is received. See the setters below for the arguments which will be passed at evaluation time. |
By default this flag is true
and SuperCollider interprets incoming MIDI noteOn message with velocity 0 as noteOff messages. In case you do not want this automatic translation, you can set this flag to false
Connect to all possible MIDI inputs.
verbose |
If set to true (default) it will print out the ports found in MIDIClient.init. |
Disconnect from all MIDI inputs.
The methods below allow you to register a function to respond to a particular message type.
(value) |
a Function evaluated whenever a MIDI noteOn message is received. It is passed the following arguments:
|
(value) |
a Function evaluated whenever a MIDI noteOff message is received. It is passed the following arguments:
|
(value) |
a Function evaluated whenever a MIDI polytouch message is received. It is passed the following arguments:
|
(value) |
a Function evaluated whenever a MIDI control change message (CC) is received. It is passed the following arguments:
|
(value) |
a Function evaluated whenever a MIDI program change message is received. It is passed the following arguments:
|
(value) |
a Function evaluated whenever a MIDI after-touch message is received. It is passed the following arguments:
|
(value) |
a Function evaluated whenever a MIDI pitch wheel change message is received. It is passed the following arguments:
|
(value) |
a Function evaluated whenever a MIDI System Exclusive message is received. It is passed the following arguments:
|
index | data | message |
2 | 14bits | song pointer |
3 | 7bits | song select |
8 | midiclock | |
10 | start | |
11 | continue | |
12 | stop |
(value) |
a Function evaluated whenever a MIDI System Real-Time message is received. It is passed the following arguments:
|
index | data |
0 | frames low nibble |
1 | frames hi nibble |
2 | seconds low nibble |
3 | seconds hi nibble |
4 | minutes low nibble |
5 | minutes hi nibble |
6 | hours low nibble |
7 | hours hi bit OR'ed with frameRate
|
Nibbles are sent in ascending order.
(value) |
a Function evaluated whenever a MIDI smpte message is received. It is passed the following arguments:
|