MIDI Specification

This the complete MIDI 1.0 specification.
It is reproduced here in its entirety.

INTRODUCTION

MIDI is the acronym for Musical Instrument Digital Interface.

MIDI enables synthesizers, sequencers, home computers, rhythm machines, etc. to be interconnected through a standard interface.

Each MIDI-equipped instrument usually contains a receiver and a transmitter. Some instruments may contain only a receiver or transmitter. The receiver receives messages in MIDI format and executes MIDI commands. It consists of an opto-isolator, Universal Asynchronous Receiver-Transmitter (UART), and other hardware needed to perform the intended functions. The transmitter originates messages in MIDI format, and transmits them by way of a UART and line driver.

The MIDI standard hardware and data format are defined in this specification.

CONVENTIONS

Status and Data bytes given in tables 1, 2, 3, 4, 5 or 6 are given in binary. Numbers followed by an "H" are in hexadecimal. All other numbers are in decimal.

HARDWARE

The interface operates at 31.25 (+/- 1 %) Kbaud, asynchronous, with a start bit, 8 data bits (D0 to D7), and a stop bit. This makes a total of 10 bits for a period of 320 microseconds per serial byte.

Circuit:
5 mA current loop type. Logical 0 is current ON. One output shall drive one and only one input. The receiver shall he opto-isolated and require less than 5 mA to turn on, Sharp PC-900 and HP 6N138 opto-isolators have been found acceptable.
Other high-speed opto-isolators may be satisfactory. Rise and fall times should be less than 2 microseconds.

Connectors: DIN 5-pin (180 degree) female panel-mount receptacle. An example is the SWITCHCRAFT 57GB5F. The connectors shall be labeled "MIDI IN" and "MIDI OUT". Note that pins 1 and 3 are not used, and should be left unconnected in the receiver and transmitter.

Cables shall have a maximum length of fifty feet (15 meters), and shall be terminated on each end by a corresponding 5-pin DIN male plug, such as the SWITCHCRAFT 05GM5M. The cable shall be shielded twisted pair, with the shield connected to pin 2 at both ends.

A "MIDI THRU" output may be provided if needed, which provides a direct copy of data coming in MIDI IN. For very long chain lengths (more than three instruments), higher-speed opto-isolators must be used to avoid additive rise/fall time errors, which affect pulse width duty cycle.

DATA FORMAT

All MIDI communication is achieved through multi-byte "messages" consisting of one Status byte followed by one or two Data bytes, except Real-Time and Exclusive messages (see below).

MESSAGE TYPES

Messages are divided into two main categories:
Channel and System.

Channel

Each channel message contains a 4-bit number in the Status byte, which addresses the message specifically to one of 16 channels. These messages are thereby intended for any units in a system whose channel numbers match the channel number encoded into the Status byte.

There are two types of Channel messages:
Voice and Mode.

Voice

To control the instrument's voices, Voice messages are sent over the Voice Channels.

Mode

To define the instrument's response to Voice messages, Mode messages are sent over the instrument's Basic Channel.

System

System messages are not encoded with channel numbers.

There are three types of System messages:
Common, Real-Time, and Exclusive.

Common

Common messages are intended for all units in a system.

Real-Time

Real-Time messages are intended for all units in a system. They contain Status bytes only-no Data bytes. Real-Time messages may be sent at any time, even between bytes of a message that has a different status. In such cases the Real-Time message is either ignored or acted upon, after which the receiving process resumes under the previous status.

Exclusive

Exclusive messages can contain any number of Data bytes, and are terminated by an End of Exclusive (EOX) or any other Status byte. These messages include a Manufacturer's Identification (ID) code. If the receiver does not recognize the ID code, it should ignore the ensuing data.

DATA TYPES

Status Bytes

Status Bytes are 8-bit binary numbers in which the Most Significant Bit (MSB) is set (binary 1). Status bytes serve to identify the message type, that is, the purpose of the Data bytes that follow the Status byte.

Except for Real-Time messages, new Status bytes will always command the receiver to adopt their status, even if the new Status is received before the last message was completed.

Running Status

For Voice and Mode messages only , when a Status byte is received and processed, the receiver will remain in that status until a different Status byte is received. Therefore, if the same Status byte would be repeated, it may (optionally) be omitted so that only the correct number of Data bytes need be sent. Under Running Status, then a complete message need only consist of specified Data bytes sent in the specified order.

The Running Status feature is especially useful for communicating long strings of Note On/Off messages, where "Note On with Velocity Off" is used for Note Off. (A separate Note Off Status byte is also available.)

Running Status will be stopped when any other Status byte intervenes, except that Real-Time messages will only interrupt the Running Status temporarily.

Unimplemented Status

Any Status bytes received for functions that the receiver has not implemented should be ignored, and subsequent data bytes ignored.

Undefined Status

Undefined Status bytes must not be used. Care should be taken to prevent illegal messages from being sent during power-up or power-down. If undefined Status bytes are received, they should be ignored, as should subsequent Data bytes.

Data Bytes

Following the Status byte, there are (except for Real-Time messages) one or two Data bytes, which carry the content of the message. Data bytes are 8-bit binary numbers in which the MSB is reset (binary 0). The number and range of Data bytes that must follow each Status byte are specified in the tables that follow. Inside the receiver, action on the message should wait until all Data bytes required under the current status are received. Receivers should ignore Data bytes that have not been properly preceded by a valid Status byte (with the exception of "Running Status," above).

CHANNEL MODES

Synthesizers contain sound generation elements called voices. Voice assignment is the algorithmic process of routing Note On/Off data from the keyboard to the voices so that the musical notes are correctly played with accurate timing.

When MIDI is implemented, the relationship between the 16 available MIDI channels and the synthesizer's voice assignment must be defined. Several Mode messages are available for this purpose (see Table 111). They are Omni (On/Off), Poly, and Mono. Poly and Mono are mutually exclusive, i.e., Poly Select disables Mono, and vice versa. Omni, when on, enables the receiver to receive Voice messages in all Voice Channels without discrimination. When Omni is off, the receiver will accept Voice messages from only the selected Voice Channel(s).

Mono, when on, restricts the assignment of Voices to just one voice per Voice Channel (Monophonic). When Mono is off (=Poly On), any number of voices may be allocated by the Receiver's normal voice assignment algorithm (Polyphonic). For a receiver assigned to Basic Channel "N", the four possible modes arising from the two Mode messages are:

Mode
Omni
1
On
Poly
Voice messages are received 
from all Voice Channels, and 
assigned to voices 
polyphonically.
2
On
Mono
Voice messages are received 
from all Voice Channels, and 
control only one voice, 
monophonically.
3
Off
Poly
Voice messages are received 
in Voice Channel N only, and 
areassigned to voices 
polyphonically.
4
Off
Mono
Voice messages are received 
in Voice Channels N through 
N+M-l, and assigned 
monophonically to voices 
1 through M, respectively. 
The number of voices M is 
specified by the third byte 
of the Mono Mode Message. 

Four modes are applied to transmitters (also assigned to Basic Channel N). Transmitters with no channel selection capability will normally transmit on Basic Channel 1 (N=O).

Mode
Omni
1
On
Poly
All voice messages are 
transmitted in Channel N.
2
On
Mono
Voice messages for one voice 
are sent in Channel N.
3
Off
Poly
Voice messages for all voices 
are sent in Channel N.
4
Off
Mono
Voice messages for voices 
1 through M are transmitted 
in Voice Channels N through 
N+M-1, respectively. 
(Single voice per channel.)

A MIDI receiver or transmitter can operate under one and only one mode at a time. Usually the receiver and transmitter will be in the same mode. If a mode cannot be honored by the receiver, it may ignore the message (and any subsequent data bytes), or it may switch to an alternate mode (usually Mode 1, Omni On/Poly).

Mode messages will be recognized by a receiver only when sent in the Basic Channel to which the receiver has been assigned, regardless of the current mode. Voice messages may be received in the Basic Channel and in other channels (which are all called Voice Channels) that are related specifically to the Basic Channel by the rules above, depending on which mode has been selected.

A MIDI receiver may be assigned to one or more Basic Channels by default or by user control. For example, an eight-voice synthesizer might be assigned to Basic Channel 1 on power-up. The user could then switch the instrument to be configured as two four-voice synthesizers, each assigned to its own Basic Channel. Separate Mode messages would then be sent to each four-voice synthesizer, just as if they were physically separate instruments-

POWER-UP DEFAULT CONDITIONS

On power-up all instruments should default to Mode #1. Except for Note On/Off Status, all Voice messages should be disabled. Spurious or undefined transmissions must be suppressed.

Valid HTML 4.01 Transitional