Midi objects each encapsulate a single message. This may be a "standard" three byte message, such as a note-on, program change or continuous controller; or could be a hexadecimal string containing System Exclusive data.
Like the FlowStone MIDI primitives, 'standard' three byte messages are split into four values, so that the data type and channel can be manipulated independently.
The four data values are as follows...
status The type of message to send. This consists of only the upper four bits (first hex character) of the initial MIDI data byte. This sets the kind of message to send, and is equivalent to the status byte of a message sent on MIDI channel 1 (index zero in the raw byte format). The valid values are as follows...
128 -> Note Off
144 -> Note On
160 -> Polphonic Aftertouch
176 -> Continuous Controller
192 -> Program Change
208 -> Channel Aftertouch
224 -> Pitch Bend
240 -> System message
channel The channel on which the message should be sent. Note that this is indexed as 1 though to 16, not 0-15 as it would be in a raw MIDI status byte.
data1 First byte of the specific data for this message. What this represents will depend on the status value. Value is always from 0 to 255.
For note-on, note-off, poly aftertouch -> the note number
For continuous controller -> the controller ID
For program change -> the program ID
For channel aftertouch -> aftertouch amount
For Pitch Bend -> Coarse pitch bend amount (63 = no shift)
data2 Second byte of the specific data for this message. What this represents will depend on the status value. Value is always from 0 to 255.
For note-on, note-off -> Velocity
For poly aftertouch -> Aftertouch amount
For continuous controller -> the controller value
For program change -> not used
For channel aftertouch -> not used
For Pitch Bend -> Fine pitch bend amount