Appendix 3: Summary and Description of MIDI

A3.1 INTRODUCTION TO MIDI

MIDI stands for Musical Instrument Digital Interface. It is a specification of a communications scheme for digital music devices and represents a formal set of hardware and software rules for sending and receiving musical-event data between computers and synthesizers. MIDI is currently the de facto standard for the interconnection of musical devices. Musical data such as notes or other performance parameters such as pitch-bending are typically input by the musician using a keyboard synthesizer equipped with a MIDI hardware interface. This MIDI hardware encodes the key depressions and transmits them serially over the MIDI port. The output of this port may be connected to the input of another MIDI port that is either attached to a computer or another synthesizer.

A3.2 MIDI NETWORK ARCHITECTURE

The basic idea behind MIDI is a two-layer network consisting of a physical interconnection scheme and a code to communicate information across the channel.

A3.2.1 The Physical Interconnection

The physical layer of MIDI is a simple point-to-point opto-isolated 5 mA current loop using a 5-pin DIN connector in which three of the pins are used. The cable is made of a shielded twisted pair with the shield being grounded at the source end only. Each twisted pair implements a one-direction transmission line. Hence two cables are needed to implement a two-way communication path between MIDI stations. An instrument implementing the interface must have MIDI input and output jacks, to be labelled MIDI IN and MIDI OUT. A MIDI THRU jack may also be provided, which simply provides a buffered electrical copy of the input signal. Information is transmitted across as asynchronous serial data at a baud rate of 31250 baud with 1 start bit, 8 data bits and 1 stop bit.

Some interconnection schemes for the interconnection of musical instruments:

Unidirectional
master talks to slave
Bidirectional
two masters drive each other as slaves
Ring
an extension of bidirectional connection to three or more devices
Daisy Chain
one master drives several slaves using MIDI THRU
Star
one master has several unidirectional or bidirectional links.

Note that a single MIDI cable is a unidirectional single-talker / single-listener network. Using a MIDI THRU connection allows it to become a multilistener network.

A3.2.2 The Code Specification

The code specification consists of three elements: modes, channels, and commands.

There are three modes and sixteen channels, which provide for multisynthesizer control within a single MIDI network. The modes establish the relationship between the channels and voice assignment methods within a synthesizer. MIDI commands with a field for channel number are called channel commands. The MIDI mode configures synthesizers to receive or ignore channel commands depending on the channel number. The three modes are

Omni
causes a MIDI unit to accept commands on all channels
Poly
causes a synthesizer to assign voices polyphonically, i.e. sequential MIDI commands to turn notes on will generate a chord.
Mono
configures the synthesizer to respond to only one voice per channel. However, the synthesizer may receive on more than one channel, so sequential note on commands on different channels may still generate a chord in the synthesizer.

The modes may be grouped into four states:

  1. Omni On and Poly allows all commands regardless of channel to be recognized by the receiver and voices are assigned polyphonically.
  2. Omni On and Mono allows all commands regardless of channel to be recognized by the receiver and assigned to just one voice. Only one voice may sound.
  3. Omni Off and Poly allows only channel commands matching the receiver channel number to be recognized and voices are assigned polyphonically.
  4. Omni Off and Mono allows only channel commands matching a range of receiver channel numbers (possibly one) to be recognized and voices are assigned one per channel recognized.

A3.2.3 MIDI Command Types

There are five categories of MIDI commands:

Channel
communicates event data such as note on and note off and status of device controllers such as pitch-bend and breath controllers as well as continuous modulation controls.
System common
deals with sequence selection and positioning within a sequence. These commands are useful for instruments recording MIDI data (i.e. a MIDI data recorder).
System realtime
synchronizes a network of MIDI devices to a common clock.
Reset
terminates activity in progress and reinitializes devices to power on condition.
System exclusive
is manufacturer dependent commands for sending device-specific information such as voice parameters.

System realtime commands have the highest priority (can interrupt multibyte commands) followed by System exclusive. All other commands have equal priority.

A3.2.4 Format of MIDI commands

A typical MIDI command byte is as follows:

        Status byte
        10010010
        1XXXYYYY
        1        Leading Sentinel bit
        XXX        Command ID
        YYYY        Channel ID
Figure 17: MIDI Status Byte Format

The sentinel signals the start of a new command (status byte). Data bytes must have this bit reset. The Command ID identifies the MIDI command. If the command ID identifies the command to be a channel command then the Channel field contains the channel number of the command, otherwise the channel field is used as an extension of the command field.

Each command type contains a specified number of trailing data bytes. The only exception is System exclusive, which may contain an unspecified number of trailing data bytes (with sentinel bit reset) terminated by an EOX (End of Exclusive) command. Some commands have no trailing data bytes at all.

If a subsequent command have a status byte identical to the command prior to it, then the status byte need not be sent and will be assumed by the receiver. This feature is called MIDI running status and reduces the amount of information that has to be passed through the MIDI interface.


Status Arg 1 Arg 2 Mnemonic

8Y Key Velocity Key off
9Y Key Velocity Key on
AY Key Pressure Polyphonic Key Pressure
BY Index Value Control Change
CY Index ­ Program Change
DY Pressure ­ Pressure (combined)
EY LSB MSB Pitch Wheel change
Table 1: CHANNEL COMMANDS

Status Arg 1 Arg 2 Mnemonic

F0 Mfg. ID ... System Exclusive Command
Table 2: SYSTEM EXCLUSIVE COMMAND

Status Arg 1 Arg 2 Mnemonic

F2 LSB MSB Program Position Select
F3 Index ­ Program Select
F6 ­ ­ Tune request
F7 ­ ­ End of System Exclusive (EOX)
Table 3: SYSTEM COMMON COMMANDS

Status Arg 1 Arg 2 Mnemonic

F8 ­ ­ Timing Clock
F9 ­ ­ Undefined
FA ­ ­ Start
FB ­ ­ Continue
FC ­ ­ Stop
FD ­ ­ Undefined
FE ­ ­ Active sensing
FF ­ ­ System reset
Table 4: REAL TIME COMMANDS

Next: Appendix 4: SAMPLE PROGRAMS
Previous: Appendix 3: Summary and Description of MIDI
Back to: Table of Contents


Created on Sat Feb 21 20:21:24 1998 using a perl script called m2h from original troff mm document.
Click here to download a copy of m2h.

Author: Chris Tham
Email: Chris_Tham@hp.com