There are two sides to MIDI 1.0: the hardware transport specification describing the electrical and mechanical connection, and the message format specification.
The MIDI standard consists of a communications messaging protocol designed for use with musical instruments, as well as a physical interface standard. It consists physically of a one-way (simplex) digital current loop serial communications electrical connection signaling at 31,250 bits per second. 8-N-1 format, i.e. one start bit (must be 0), eight data bits, no parity bit and one stop bit (must be 1), is used.
Only one end of the loop is referenced to ground, with the other end "floating", to prevent ground loops which may otherwise cause interference and hum in analog audio signals. The current loop on the transmitter side drives the LED of an opto-coupler on the receiver side. This means the devices are, in fact, optically isolated. The opto-coupler must be a high-speed type. As most opto-couplers have asymmetrical positive-going and negative-going slew rates, they slightly alter the signal's duty cycle. If several MIDI devices are connected in series by daisy-chaining the MIDI THRU to the next device's MIDI-IN, the signal gets more and more distorted, until receive errors occur due to pulse narrowing.
At the physical layer (MIDI cable), a pair of wires carry the MIDI signal. The voltage difference is normally 0 volts (both at positive potential referenced to ground) in the idle state, which is seen as a '1' at the MIDI receiver due to logic inversion by the opto-coupler. A MIDI message start bit (0) causes a voltage differential on the wire pair (current loop) which is seen at the MIDI receiver as a '0'. The 8 data bits can be either '0' (low) or '1' (high) with the stop bit (1) seen at the MIDI receiver as a '1'. To summarize:
MIDI connectors are standard 5-pin 180° DIN connectors which at one time were a de facto European standard for audio interconnection. Over time the simpler American RCA phono jack has left MIDI as the only place where DIN is commonly encountered in modern equipment. Only two of the five pins (pins 4 and 5) are used for MIDI signal transmission.
Some computers or their sound cards have 15-pin D-subminiature connectors, called game ports, that can be used for MIDI IN/MIDI OUT. The connector supports both MIDI and analog joystick functions. Access to the MIDI signals is provided by a short adapter cable that converts the D-subminiature pinout into DIN connectors. The recommended method of connecting two 5-pin DIN cables to a 15-pin D-subminiature computer port can be found at the MIDI.org web site The MIDI specification very conservatively states that the maximum distance MIDI can be transmitted is 15 meters (50 feet), but it can normally go much further
Most MIDI capable instruments feature a MIDI IN, MIDI OUT, and occasionally a MIDI THRU connection in the form of five-pin DIN connectors. In order to build a two-way physical connection between two devices, a pair of cables must be used. The MIDI THRU jack simply echoes the signal entering the device at MIDI-IN. This makes it possible to control several devices from a single source.
The 1985 Atari ST was the first home computer to sport the original five-pin DIN format, making it a very popular platform for running MIDI sequencer software. Most PC soundcards from the late 1990s had the ability to terminate a MIDI connection, usually through a MIDI IN/MIDI OUT converter on the game port. The game port has been supplanted in the modern PC by USB devices, and so typically a PC owner will need to purchase a MIDI interface that attaches to the USB or FireWire port of their machine to use MIDI.
Every MIDI connection is a one-way connection from the MIDI Out connector of the sending device to the MIDI In connector of the receiving device. Each such connection can carry a stream of MIDI messages, with most messages representing a common musical performance event or gesture such as note-on, note-off, controller value change (including volume, pedal, modulation signals, etc.), pitch bend, program change, aftertouch, channel pressure. All of those messages include channel number. There are 16 possible channels in the protocol. The channels are used to separate "voices" or "instruments", somewhat like tracks in a multi-track mixer.
The ability to multiplex 16 "channels" onto a single wire makes it possible to control several instruments at once using a single MIDI connection. When a MIDI instrument is capable of producing several independent sounds or "voices" simultaneously (a multitimbral instrument), MIDI channels are used to address these sections independently. (This should not be confused with "polyphonic"; the ability to play several notes simultaneously in the same "voice".)
In more detail, MIDI 1.0 defines several basic message types of channel messages:
In addition to the channel-based messages, there are system-related messages not addressed to any particular channel. These include:
MIDI can be used to provide facilities for playing in musical tunings different from the 12 tone per octave, equal-tempered tuning used in most western musical traditions. However, apart from using pitch-bend to control each note, these features have not been implemented by all instrument manufacturers.
MIDI messages are extremely compact, due to the low bandwidth of the connection, and the need for real-time accuracy. Most messages consist of a status byte (channel number in the low 4 bits, and an opcode in the high 4 bits), followed by one or two data bytes. However, the serial nature of MIDI messages means that long strings of MIDI messages take an appreciable time to send, at times even causing audible delays, especially when dealing with dense musical information or when many channels are particularly active.
To further optimize the data stream, "Running status", a convention that allows the status byte to be omitted if it would be the same as that of the previous message, helps to mitigate bandwidth issues somewhat.