The hardware MIDI 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. The start bit is a logical 0 (current on) and the stop bit is a logical 1 (current off). Bytes are sent LSB first.
Circuit: (see Figure 1). 5 mA current loop type. Logical 0 is current ON. One output shall drive one and only one input. To avoid ground loops, and subsequent data errors, the transmitter circuitry and receiver circuitry are internally separated by an opto-isolator (a light emitting diode and a photo sensor which share a single, sealed package). The receiver must require less than 5 mA to turn on. Rise and fall times should be less than 2 microseconds.
Connectors: DIN 5 pin (180 degree) female panel mount receptacle. The connectors shall be labelled "MIDI IN" and "MIDI OUT". Note that pins 1 and 3 are not used, and should be left unconnected in the receiver and transmitter. Pin 2 of the MIDI In connector should also be left unconnected.
The grounding shield connector on the MIDI jacks should not be connected to any circuit or chassis ground.
When MIDI Thru information is obtained from a MIDI In signal, transmission may occasionally be performed incorrectly due to signal degradation (caused by the response time of the opto-isolator) between the rising and falling edges of the square wave. These timing errors will tend to add up in the "wrong direction" as more devices are chained between MIDI Thru and MIDI In jacks. The result is that, regardless of circuit quality, there is a limit to the number of devices which can be chained (series-connected) in this fashion.
Figure 1 - MIDI Standard Hardware
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. 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 long chain lengths (more than three instruments), higher-speed optoisolators should help to avoid additive rise/fall time errors which affect pulse width duty cycle.
MIDI communication is achieved through multi-byte "messages" consisting of one Status byte followed by one or two Data bytes. Real-Time and Exclusive messages are exception.
A MIDI-equipped instrument typically contains a receiver and a transmitter. Some instruments may contain only a receiver or only a transmitter. A receiver accepts messages in MIDI format and executes MIDI commands. It consists of an optoisolator, Universal Asynchronous Receiver/Transmitter (UART), and any other hardware needed to perform the .intended functions. A transmitter originates messages in MIDI format, and transmits them by way of a UART and line driver.
MIDI makes it possible for a user of MIDI-compatible equipment to expand the number of instruments in a music system and to change system configurations to meet changing requirements.
MIDI messages are sent over any of 16 channels which are used for a variety of performance information. There are five major types of MIDI messages: Channel Voice, Channel Mode, System Common, System Real-Time and System Exclusive.
A MIDI event is transmitted as a "message" and consists of one or more bytes. The structure and classification of MIDI data are as follows:
Messages are divided into two main categories: Channel and System
Channel Messages
A Channel message uses four bits in the Status byte to address the message to one of sixteen MIDI channels and four bits to define the message (see Table II). Channel messages are thereby intended for the receivers in a system whose channel number matches the channel number encoded into the Status byte.
An instrument can receive MIDI messages on more than one channel. The channel in which it receives its main instructions, such as which program number to be on and what mode to be in, is referred to as its "Basic Channel". An instrument may be set up to receive performance data on multiple channels (including the Basic Channel). These are referred to as "Voice Channels". These multiple-channel situations will be discussed in more detail later.
There are two types of Channel messages:
System Messages
System messages are not encoded with channel numbers. There are three types of System messages:
There are two types of bytes sent over MIDI: Status Bytes and Data Bytes.
Synthesizers and other instruments contain sound generation elements called voices. Voice assignment is the algorithmic process of routing Note On/Off data from incoming MIDI messages to the voices so that notes are correctly sounded. When we refer to an "instrument" please note that one physical instrument may act as several virtual instruments (i.e. a synthesizer set to a 'split' mode operates like two individual instruments). Here, "instrument" refers to a virtual instrument and not necessarily one physical instrument.
Four Mode messages are available for defining the relationship between the sixteen MIDI channels and the instrument's voice assignment. The four modes are determined by the properties Omni (On/Off, Poly, and Mono. Poly and Mono are mutually exclusive, i.e., Poly disables Mono, and vice versa. Omni, when on, enables the receiver to receive Voice messages on all voice Channels. When Omni is off, the receiver will accept Voice messages from only 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), a number of voices may be allocated by the Receiver's normal voice assignment (Polyphonic) algorithm.
For a receiver assigned to Basic Channel "N", the four possible modes arising from the two Mode messages are shown in Table I:
Table I
Four modes are applied to transmitters (also assigned to Basic Channel N). Transmitters with no channel selection capability should transmit on Basic Channel 1 (N=0).
Table II
A MIDI receiver or transmitter operates under only one Channel Mode at a time. If a mode is not implemented on the receiver, it should ignore the message (and any subsequent data bytes), or switch to an alternate mode, usually Mode 1 (Omni On/Poly).
Mode messages will be recognized by a receiver only when received in the instrument's Basic Channel-regardless of which mode the receiver is currently assigned to. Voice messages may be received in the Basic Channel and in other Voice Channels, according to the above specifications.
Since a single instrument may function as multiple "virtual" instruments, it can thus have more than one basic channel. Such an instrument behaves as though it is more than one receiver, and each receiver can be set to a different Basic Channel. Each of these receivers may also be set to a different mode, either by front panel controls or by Mode messages received over MIDI on each basic channel. Although not a true MIDI mode, instruments operating in this fashion are described as functioning in "Multi Mode".
An instrument's transmitter and receiver may be set to different modes. For example, an instrument may receive in Mono mode and transmit in Poly mode. It is also possible to transmit and receive on different channels. For example, an instrument may receive on Channel 1 and transmit on Channel 3.
It is recommended that at power-up, the basic channel should be set to 1, and the mode set to Omni On/Poly (Mode 1). This, and any other default conditions for the particular instrument, should be maintained indefinitely (even when powered down) until instrument panel controls are operated or MIDI data is received. However, the decision to implement the above, is left totally up to the designer.
[Index | Main Paragraph | Next Paragraph ]