The MIDI channel prefix meta message specifies a MIDI channel so that meta messages that follow are specific to a channel.
For example, if the channel prefix message precedes a MIDI Instrument Name meta message, then the instrument name specified by the message applies to the channel defined by the channel prefix message.
The channel prefix message affects meta messages that follow until another channel prefix message or until any non-meta MIDI message.
This message belongs to the category of MIDI meta messages. Since this is a meta message the MIDI event that carries this message may exist in MIDI files, but it is not sent over MIDI ports to a MIDI device.
The channel prefix message consists of four bytes of data. The first byte is the status byte and has a hexadecimal value of 0xFF, which means that this is a meta message. The second byte is the meta message type 0x20 and shows that this is a channel prefix meta message. The third byte is 0x01 and shows that one byte follows. The last byte is the MIDI channel and has values from 0x00 to 0x0F (0 to 15 decimal).
The following is an example of a MIDI channel prefix meta message.
0xFF 0x20 0x01 0x02
The status byte 0xFF shows that this is a meta message. The second byte is the meta type 0x20 and signifies that this is a channel prefix meta message. The third byte is 1, which means that one byte follows. The last byte is 2, which means that this is a channel prefix for channel 2. Thus, meta messages that follow are specific to channel 2.
Musical Instrument Digital Interface (MIDI)