Every event type has a unique ID number and a name associated with it. For example, a tempo event has an ID number of 81 and a name of Tempo. A MIDI Note On event has an ID number of 144 and a name of On Note. A Pitch Wheel event has an ID number of 224 and a name of Pitch Wheel.
When MIDIGetEvent() finds a matching event, it sets the variable named MIDIEvent.!Type to the event's ID number, for example 144 for a MIDI Note On event. You can use MIDIEventProp() to convert an ID number to an event name, for example to convert 144 to "On Note". (MIDISetEvent() also uses these event ID numbers/names, in conjunction with the variable MIDIEvent.!Type, when inserting a new event in a track).
The following charts list each event ID number, followed by its name, and then the REXX data variables that are set by MIDIGetEvent() when such an event is matched.
The following events are MIDI events that can be sent to, or received at, a MIDI IN or OUT jack.
Voice Category -- MIDIEvent.!Channel is set to the MIDI channel for the event.
Number Name Variables 144 'On Note' or '(Off) Note' MIDIEvent.!Data1 is the note number. MIDIEvent.!Data2 is the velocity, which is always 0 for "(Off) Note", and always non-zero for "On Note". 128 'Off Note' MIDIEvent.!Data1 is the note number. MIDIEvent.!Data2 is the velocity. 208 'Poly Press' MIDIEvent.!Data1 is pressure. MIDIEvent.!Data2 is an empty string. 160 'Aftertouch' MIDIEvent.!Data1 is the note number. MIDIEvent.!Data2 is the pressure. 192 'Program' MIDIEvent.!Data1 is the program number. MIDIEvent.!Data2 is an empty string. 176 'Controller' MIDIEvent.!Data1 is the controller number. MIDIEvent.!Data2 is the value. 224 'Pitch Wheel' MIDIEvent.!Data1 is the MSB pitch value. MIDIEvent.!Data2 is the LSB pitch value. MIDIEvent.!Data3 is a combined signed value from -8192 to 8191 where 0 is centered wheel.
System Exclusive -- large data exchange. Use MIDISysex() to retrieve the actual data.
Number Name Variables 240 'Sysex' MIDIEvent.!Data1 is the number of data bytes in the event. 255 'First Packet' or 'Packet' MIDIEvent.!Data1 is the number of data bytes in the event. A First Packet event's first byte is always F0 hex, whereas it is not for a Packet. 247 'Last Packet' MIDIEvent.!Data1 is the number of data bytes in the event.
MIDI Sync/Timing
Number Name Variables 241 'MTC' MIDIEvent.!Data1 is the frame value. MIDIEvent.!Data2 is an empty string. 248 'Clock' MIDIEvent.!Data1 and MIDIEvent.!Data2 are empty strings. 242 'Sng Position' MIDIEvent.!Data1 is the MSB song position. MIDIEvent.!Data2 is the LSB song position. MIDIEvent.!Data3 is a combined position from 0 to 16383. 243 'Select Sng' MIDIEvent.!Data1 is the song number. MIDIEvent.!Data2 is an empty string. 250 'Start' MIDIEvent.!Data1 and MIDIEvent.!Data2 are empty strings. 251 'Resume' MIDIEvent.!Data1 and MIDIEvent.!Data2 are empty strings. 252 'Stop' MIDIEvent.!Data1 and MIDIEvent.!Data2 are empty strings.
Miscellaneous
Number Name Variables 246 'Tune' MIDIEvent.!Data1 and MIDIEvent.!Data2 are empty strings. 254 'Sense' MIDIEvent.!Data1 and MIDIEvent.!Data2 are empty strings.
Undefined
Number Name Variables 244 'F4' MIDIEvent.!Data1 and MIDIEvent.!Data2 are empty strings if no data, or may contain data. 245 'F5' MIDIEvent.!Data1 and MIDIEvent.!Data2 are empty strings if no data, or may contain data. 253 'FD' MIDIEvent.!Data1 and MIDIEvent.!Data2 are empty strings.
The following event ID numbers/names are used to embed information in a MIDI file, but are not transmitted/received over MIDI.
Text type of events
Number Name Variables 1 'Text' MIDIEvent.!Data1 is the text. MIDIEvent.!Data2 is an empty string. 2 'Copyright' MIDIEvent.!Data1 is the copyright message. MIDIEvent.!Data2 is an empty string. 3 'Track name' MIDIEvent.!Data1 is the track name. MIDIEvent.!Data2 is an empty string. 4 'Instrument' MIDIEvent.!Data1 is the instrument name. MIDIEvent.!Data2 is an empty string. 5 'Lyric' MIDIEvent.!Data1 is the syllable. MIDIEvent.!Data2 is an empty string. 6 'Marker' MIDIEvent.!Data1 is the marker text. MIDIEvent.!Data2 is an empty string. 7 'Cue Point' MIDIEvent.!Data1 is the cue's label. MIDIEvent.!Data2 is an empty string. 8 'Device Name' MIDIEvent.!Data1 is the MIDI port's name. MIDIEvent.!Data2 is an empty string. 9 'Pgm Name' MIDIEvent.!Data1 is the name of the program/patch. MIDIEvent.!Data2 is an empty string.
Other events
Number Name Variables 0 'Seq #' MIDIEvent.!Data1 is the sequence number. MIDIEvent.!Data2 is an empty string. 81 'Tempo' MIDIEvent.!Data1 is the tempo expressed in microseconds per quarter note. MIDIEvent.!Data2 is the tempo expressed in beats per minute (BPM). 84 'SMPTE' MIDIEvent.!Data1 is the hour. MIDIEvent.!Data2 is the minute. MIDIEvent.!Data3 is the second. MIDIEvent.!Data4 is the frame. MIDIEvent.!Data5 is the subframe. 32 'Chan #' MIDIEvent.!Data1 is the channel number. MIDIEvent.!Data2 is an empty string. 33 'Port #' MIDIEvent.!Data1 is the port number. MIDIEvent.!Data2 is an empty string. 88 'Time Sig' MIDIEvent.!Data1 is the numerator. MIDIEvent.!Data2 is the denominator. MIDIEvent.!Data3 is the metronome clocks. 89 'Key Sig' MIDIEvent.!Data1 is the sharps/flats. MIDIEvent.!Data2 is 0 for major or 1 for minor. MIDIEvent.!Data3 is the key name (ie, 'C# Major'). 127 'Specific' MIDIEvent.!Data1 is the data. MIDIEvent.!Data2 is an empty string. 47 'End of Track' MIDIEvent.!Data1 and MIDIEvent.!Data2 are empty strings.
All other ID numbers below 128 have a name of Unknown Meta.