MIDI meta messages


According to the MIDI protocol certain MIDI events are never sent over MIDI ports, but exist in MIDI files. These events are called meta events and the messages that they carry are called meta messages.

MIDI meta messages are messages that contains information about the MIDI sequence and that are not to be sent over MIDI ports.

Meta messages have the following standard structure.

FieldLengthStarts at byteValue
Status byteOne byte0x000xFF always
Meta typeOne byte0x01Variable, see below
LengthOne byte0x020-255

Status byte – the first byte of the MIDI meta message is the "status byte" as with any other MIDI message. The status byte of a MIDI meta message is always 0xFF.

Meta type – the "meta type" byte defines how the rest of the message should be interpreted (see below for a table of defined meta types).

Length – the "length" contains the length in bytes of the data to follow so that MIDI devices know how much data to expect (not including the status byte, meta type, and the length itself). The length of certain meta messages (see below) is predefined, whereas other meta messages have variable length.

Data – the "data" portion of the message defines, obviously, something that the MIDI device must interpret.

The following is a list of defined meta messages.

Message Meta type Data length Contains Occurs at
Sequence number 0x00 2 bytes The number of a sequence At delta time 0
Text 0x01 variable Some text Anywhere
Copyright notice 0x02 variable A copyright notice At delta time 0 in the first track
Track name 0x03 variable A track name At delta time 0
Instrument name 0x04 variable The name of an instrument in the current track Anywhere
Lyrics 0x05 variable Lyrics, usually a syllable per quarter note Anywhere
Marker 0x06 variable The text of a marker Anywhere
Cue point 0x07 variable The text of a cue, usually to prompt for some action from the user Anywhere
Channel prefix 0x20 1 byte A channel number (following meta events will apply to this channel) Anywhere
End of track 0x2F 0   At the end of each track
Set tempo 0x51 3 The number of microseconds per beat Anywhere, but usually in the first track
SMPTE offset 0x54 5 SMPTE time to denote playback offset from the beginning Anywhere
Time signature 0x58 4 Time signature, metronome clicks, and size of a beat in 32nd notes Anywhere
Key signature 0x59 2 A key signature Anywhere
Sequencer specific 0x7F variable Something specific to the MIDI device manufacturer Anywhere

Note on status byte 0xFF

The reset message (a system realtime message) carries the same status byte as a meta message: 0xFF. By convention, the MIDI reset message is never placed in MIDI files but is only sent over MIDI ports upon a request by the user. Thus, if a MIDI device receives the status byte 0xFF over a MIDI port, the device will interpret it as a "reset" message. If the MIDI device reads the status byte 0xFF from within some MIDI file, the device will interpret the message as a meta message.

Note on meta types

Since all meta message have the same status byte (0xFF), the MIDI meta type ensures that MIDI devices can distinguish between different meta messages. For example, if the meta type in the second byte of a meta message is equal to 0x02 then the message contains a copyright notice (see the table above).

See also:
Musical Instrument Digital Interface (MIDI)

Rate This Page: Poor Great   |  Rate Content |
Average rating:  4.7   
Number of Ratings : 15
Add Comment
This is great information, thank you very much! It was exactly what I need and in all the detail I needed. Great good :)
Posted At 13-01-2012 16:15:38

Copyright 2006 by Kaliopa Publishing, LLC