The following table summarizes the byte codes of the MIDI events. Short events are the ones with data stored in the Data member of the BRELS_MIDI_EVENT structure. Long events are the ones with data stored in variable size array with address stored in the lpData of the structure.
Event | Byte | Type | Description |
Sequence number | 0x00 | Long | 2 bytes informing the sequence number |
Text | 0x01 | Long | General-purpose text |
Copyright | 0x02 | Long | Copyright information |
Track name | 0x03 | Long | Text corresponding to the name of a track |
Instrument name | 0x04 | Long | Name of the instrument |
Lyrics | 0x05 | Long | Lyrics text. Generally, each event corresponds to syllable of the song. Use a slash (either "\" or "/") to cause a line break. |
Marker | 0x06 | Long | Marker text for something internal to the sequence (for example, "piano plays") |
Cue point | 0x07 | Long | Hint text for something external to the sequence (for example, "curtains open") |
Channel prefix | 0x20 | Long | 1 byte to associate events to a channel |
End of track | 0x2F | Long | Marks the end of track. Contains no data |
Tempo change | 0x51 | Long | 3-byte value indicating the duration of a beat in microseconds |
SMPTE offset | 0x54 | Long | Offset in SMPTE format of the start of an assynchronous track (not supported in the API) |
Time signature | 0x58 | Long | Time signature of the sequence |
Key signature | 0x59 | Long | Key signature of the sequence |
Sequencer specific data | 0x7F | Long | Sequencer specific data |
Note off | 0x8n | Short | Turns the sound of a note off in channel n. The first byte of data is the note and the second byte of data is the velocity. Both range from 0 to 127. |
Note on | 0x9n | Short | Turns the sound of a note on in channel n. The first byte of data is the note and the second byte of data is the velocity. Both range from 0 to 127. |
Key aftertouch | 0xAn | Short | Sets the pressure of a note in channel n. The first byte of data is the note and the second byte of data is the pressure. Both range from 0 to 127. |
Controller change | 0xBn | Short | Sets the value of a controller in channel n. The first byte of data is the controller number and the second byte of data is the controller value. Both range from 0 to 127. |
Program change | 0xCn | Short | Sets the instrument for channel n. The byte of data is the program number and ranges from 0 to 127. |
Channel pressure | 0xDn | Short | Sets the note pressure for channel n. The byte of data is the pressure value and ranges from 0 to 127. |
Pitch change | 0xEn | Short | Sets the relative pitch for channel n. The pitch is stored this way: 0xxxxxxx 0yyyyyyy, where the value is yyyyyyyxxxxxxx. It ranges from 0x0000 to 0x3FFF. Zero corresponds to -1.0 tone, 0x2000 means normal pitch and 0x3FFF means +1.0 tone. |
System exclusive data | 0xF0 | Long | Specific to MIDI hardware devices. You should strip it from MIDI files |
MTC Quarter Frame | 0xF1 | Short | Specific to MIDI hardware devices. You should strip it from MIDI files |
Song position pointer | 0xF2 | Short | Specific to MIDI hardware devices. You should strip it from MIDI files |
Song select | 0xF3 | Short | Specific to MIDI hardware devices. You should strip it from MIDI files |
Tune request | 0xF6 | Short | Specific to MIDI hardware devices. You should strip it from MIDI files |
MIDI Clock | 0xF8 | Short | Specific to MIDI hardware devices. You should strip it from MIDI files |
MIDI Start | 0xFA | Short | Specific to MIDI hardware devices. You should strip it from MIDI files |
MIDI Continue | 0xFB | Short | Specific to MIDI hardware devices. You should strip it from MIDI files |
MIDI Stop | 0xFC | Short | Specific to MIDI hardware devices. You should strip it from MIDI files |
Active Sense | 0xFE | Short | Specific to MIDI hardware devices. You should strip it from MIDI files |
You can find a list of controllers and instruments in this website: The void. The sample application midi decoder can help you to understand this list better.
Released in November 19th, 2003
Updated in April 29th, 2004
Property of Breno de Lima Sarmento
Home page: http://www27.brinkster.com/brels
E-mail: [email protected]
ICQ: 78977999 ()