Musical Instrument Digital Interface (MIDI)
Jeffrey Hass, Center for Electronic and Computer Music, Indiana University
If you entered through this page, click here to visit the rest of our site, which contains more documents on MIDI,audio and computer music.
Click here to return to the main index if you are already in the CECM Frame Set.
Overview
Summary of the MIDI Hardware Specification
MIDI Data Format
Channel Messages
System Messages
MIDI Controllers
MIDI Sequencers
Interactive Performance via MIDI
References
Overview
The development of the MIDI system has been a major catalyst in the recent unprecedented explosion of music technology. MIDI has put powerful computer instrument networks and software in the hands of less technically versed musicians and amateurs and has provided new and time-saving tools for computer musicians. The system first appeared in 1982 following an agreement among manufacturers and developers of electronic musical instruments to include a common set of hardware connectors and digital codes in their instrument design. The original goal was to interface instruments of different manufacture to control common functions, such as note events, timing events, pitch bends, pedal information, etc. Though several classes of codes have been added to the MIDI 1.0 Specification (International MIDI Association, 1989) and MIDI applications have grown far beyond the original intent, the basic protocol has remained unchanged. MIDI is a system very much like a player piano roll in that it is used to specify the actions of a synthesizer or other electronic devices, while the tone or effect is generated by the instrument itself.
Summary of the MIDI Hardware Specification
The MIDI specification begins with a set of common hardware requirements. Each MIDI-capable instrument is equipped with a transmitter and receiver, though certain peripheral devices, such as signal processors, may have only a receiver or a transmitter. The interface operates at a 31.25 Kbaud asynchronous (serial) transmission rate. Each byte consists of a start bit, eight data bits, and a stop bit, for a total duration of 320 microseconds per byte. While this was adequate for the applications originally envisioned, it has proven to be one of the major stumbling blocks for generating more complex data streams in time-dependent situations. Though several manufacturers originally included alternative parallel interfaces on their instruments for linking their own peripheral devices, the overwhelming success of MIDI has seen the abandonment of almost all other interconnecting formats.
MIDI cables connect instruments by means of MIDI IN, MIDI OUT, and MIDI THRU jacks. The MIDI THRU jack provides a direct copy of data coming into the MIDI IN jack, providing the ability to "daisy chain" several instruments and devices together. Any action on an instrument that corresponds to a particular MIDI code (such as a key depressed, or a program button changed) will normally transmit that action's code to the MIDI OUT, but not to the MIDI THRU.
The major potential of MIDI is realized when a network of instruments and other musical devices are connected to a computer by means of a MIDI interface. The primary function of the interface is to match clock speeds between the specified rate from MIDI devices and the computer. An interface's connections may be as simple as one MIDI IN and one MIDI OUT jack with information distributed by means of the daisy chain mentioned above. A simple MIDI network is shown below.
In recent years, interfaces have become more elaborate and now providing more MIDI INs and OUTs for more complex and flexible networks, merging facilities to handle several input devices simultaneously, coded routing of data to specified cables, and generation and/or conversion of timing synchronization codes for use with video and multitrack audio equipment. Some interfaces are also capable of selective filtering and/or remapping of MIDI data.
Return to Index
MIDI Data Format
The majority of MIDI communication consists of multi-byte packets beginning with a "status byte" followed by one or two "data bytes". Messages fall into the following five formats:
Almost all MIDI devices are equipped to receive MIDI messages on one or more of 16 selectable MIDI channel numbers. A device will respond to messages sent on the channel it is tuned to and ignore all other channel messages, analogous to a television set receiving only the station it is tuned to. The exception to this is OMNI mode. An instrument set to receive in OMNI mode will accept and respond to all channel messages, regardless of the channel number.
The most common MIDI message is the Channel Voice Message (click here for a table of Channel Voice Messages) which conveys information about whether to turn a note on or off, how much key pressure to exert (called aftertouch), etc.
A sample message for turning on a note (middle C) on MIDI channel #5 very loudly (with a velocity or force of 127, the maximum) is shown below in binary.
status byte data byte data byte
10010100 00111100 01111111
The first four bits of the status byte (1001) tell MIDI that the following message is a note-on command, while the last four bits tell MIDI what MIDI channel the message is for (0000=MIDI channel #1, 1111=MIDI channel #16). The first data byte tells MIDI what note to play (60='middle C), while the second data byte tells MIDI how loud to play the note, in this case the maximum velocity of 127 is sent. The note will sound until a message to turn off the same note number is received.
Simultaneous events in MIDI must be sent as a string of serial commands. A 3-note chord, for example, will be transmitted as three separate note #-velocity pairs. Because of the 31 Kbaud transmission speed, this is normally perceived as a simultaneity. However, as polyphonic instruments (those capable of playing more than one note simultaneously) have increased their number of voices and more MIDI set-ups have networks of ever-increasing numbers of instruments and tone modules, the speed of both the interface's processor and sheer volume of serial data make large simultaneous events susceptible to glitches, undesired arpeggiations, and data errors.
Many instruments transmit and respond to key velocity, the speed at which a key is depressed. Most simply allow dynamic range to be controlled, while others have the capability to alter timbre or spatial location through velocity. Recent instruments often have the capacity to crossfade or switch between two different sounds, based on the intensity (speed) of a keystroke.
Return to Index
System Messages
System Message codes are addressed to all instruments and devices regardless of their channel assignments. System Common messages primarily deal with instruments that contain their own sequencers (more on sequencing below), and allows external control of a sequence starting point. By far the most innovative applications of MIDI have been in the realm of System Exclusive (SysEx) codes.
SysEx codes allow storage of large amounts of patch data, the standard recallable unit by which synthesizers store their sounds. SysEx codes have enabled a class software called editor/librarians to extend the storage, cataloging, and real-time patch editing feature of synthesizers, by incorporating the resources of the microcomputer. In many cases SysEx software has added extremely useful graphic representations of patch parameters not available from the limited LCD's on most instruments. It has also allowed the computer to generate its own patchs, randomly or algorithmically.
MIDI Time Code (MTC) is a further example of SysEx implementation . The MTC protocol attempts to bridge the gap between MIDI Clock timing, which uses the relative time measurement of note value and tempo, and SMPTE, which uses absolute values of hour::minute::second::frame. MTC enables a sequencer, dealing in relative musical values, to synchronize with videotape or multi-track audio tape with recorded SMPTE information. A relatively large part of film post-production is now done utilizing some type of timecode synchronization. For example, a sound editor, with sequencing software that is locked to the video via MIDI Time Code, may stop a video clip at frame 00::10::22::10 where a gun muzzle flashes and enter a MIDI Note On command to play a gunshot sample on that specific frame.
Return to Index
MIDI Controllers
Because MIDI instruments were made available in both keyboard and rack-mount module versions, most studios and individuals opted for one keyboard synthesizer controlling an array of tone modules. Many synthesizer keyboards are limited to 61 notes and lack a piano-like feel. To improve upon this, 88-key wooden weighted keyboard controllers, generating MIDI codes but no sound themselves, were introduced as input devices. A prototype keyboard was introduced by Robert Moog, creator of the many generations of Moog synthesizers, which increases the performer's ability to shape notes by sliding fingers forward or backwards and side-to-side on each key, in addition to expressive use of key pressure and velocity. The assignment of controller and/or SysEx codes to these axes is controlled by a programmable PC interface to the keyboard.
Alternative controllers to the MIDI keyboard have developed over the last several years. Gary Nelson, both an electronic composer and tubist developed a controller with a tuba mouthpiece and brass fingerings. Both Yamaha Corporation and Casio have marketed wind controllers with saxophone and/or clarinet fingerings. In both of these instruments, wind pressure generates a Note On command and continues to control the amplitude by converting the pressure into controller information. These controllers require an intervening microprocessor to convert the various fingering combinations into note numbers. MIDI guitars, violins, and drums have become commonplace in the world of commercial music. There is, in fact, a MIDI body controller, a series of programmable pads sewn into a leather jumpsuit which the performer plays on, which has done away with the need for an instrument at all.
The desire to track acoustic instruments or the human voice has led to the development of pitch-to-MIDI converters, such as the IVL Pitchrider . Either a contact mike or standard "air" mike is connected to the converter, which then outputs MIDI note numbers and other programmed parameters, such as volume and pitch bend. Certain problem are inherent in such devices. For example, the converter will often fail to track the fundamental pitch of instruments or voices with strong or complex overtones. In addition, they often have difficulty tracking rapid note patterns. However, despite their current limitations, these converters have opened up a new area of interactive performance between instrumentalist and computer in conjunction with some of the software mentioned below.
Return to Index
MIDI Sequencers
The most common type of software used to link MIDI instruments and microcomputers is a vast array of sequencing programs. The term sequencer was carried over from voltage-controlled analog synthesizers, in which sequencing modules could be set to step through 8 or 16 stages of voltage-controlled notes. The limited number of sequenced notes was increased when small microprocessors, capable of recording and playing back several hundred notes, were added to digitally-controlled analog synthesizers. Current sequencing software allows recording and playback of notes, patch changes, controller information, and even SysEx codes to the limits of the program's memory allocation, usually hundreds of thousand of events.
Sequencers normally organize their information along the lines of multitrack audio recorders. Information is recorded and edited on individual tracks which are assignable to one or more MIDI channels. Previously recorded tracks can be played back while new ones are recorded. Current software accommodates up to 200 tracks of information. Rhythm is usually organized along traditional musical divisions. Note events are assigned measures, beats, and beat subdivisions (down to resolutions of 480 per beat). Unlike audio tape, sequenced performances can be recorded at a slow tempo and sped up for playback with no change in pitch. As mentioned above (see section 3.2.2), the inaccuracies of real-time performance can be quantized to the nearest selected note values. Notes can be entered in a precise rhythmic fashion by step-recording them -- that is, selecting a rhythmic value, usually from a computer keyboard, then playing the pitch or chord on a MIDI keyboard and proceeding to the next note. While this facility has led to a plethora of unimaginative, "switched-on Bach"-style musical transcriptions, the computational facilities that usually accompany step-recording features can be of great service to serious composers in need of complex rhythmic precision.
Sequencer tracks can be edited in a wide variety of manners. For example, one may select a recorded area and transpose it, shorten its rhythmic durations, and have a smooth increment of velocity for a crescendo. Since MIDI's numerical structure makes rapid musical operations quite simple, many compositional techniques, such as inversion, retrograde, rhythmic diminution or augmentation, are often included as editing features. Tracks or portions of tracks also may be looped to create continuous ostinato patterns.
Recently, the capability to edit metronomic tempi has been added to many sequencers. Composers can now specify smooth accelerandos or ritards from one measure to another. Sequencing software often provides composers with both musical time (measure, beat, and subdivision) and real time (minutes, seconds, hundredths of seconds) by computing all the metronomic changes in a particular sequence. The computational capability of the sequencer enables film composers, who previously used cues sheets and stop watches, to request the rate of acceleration from measure x to arrive at measure y by a particular SMPTE frame number.
Mark of the Unicorn's Performer sequencing software for the Macintosh
Interactive Performance via MIDI
One of the most innovative applications of MIDI to a real-time performance situation is MAX, a graphic programming environment developed at IRCAM, a center for electronic music research in Paris, by Miller Puckette. MAX, named after Max Mathews, an innovator in computer music research, was originally developed for a Macintosh, but was ported to the IRCAM NeXT-based workstation, and recently re-released commercially for the Macintosh. MAX is a collection of graphic objects, written in C, that a composer can connect or "patch" together onscreen.
MAX patches usually take real-time MIDI input, process the information according to the composer's specifications and output what could be a very sophisticated set of responses to MIDI instruments. MAX objects simplify the programming tasks of parsing MIDI data and timing events or performing musical and temporal calculations. The user can, if he chooses, also program objects to be added to an already extensive library. Many interesting pieces, such as Bestor's Soliloquies (1991) for oboe and Macintosh, involve the instrumentalist playing through a pitch-tracking device interfaced to a MAX patch. The patch tests for certain pitches, phrases, density of note-events, or even dynamic ranges which then trigger a variety of MIDI events on a bank of synthesizers and/or effects devices. A more recent work by Bestor, Cycles (1992), is a sculpture, sound, and lighting installation in which MAX interactively controls both sound and lighting. One of the most recent developments is the extension of MAX from simply a MIDI, or control, processor, to an acoustic processor as well, by the addition of DSP (digital signal processing) objects (Puckette, 1991).
Other interactive software applications, such as Intelligent Music's M , allow the performer to program certain boundaries or parameters of response by the computer. MIDI input then triggers an algorithmic set of MIDI-out responses. For example, from the input of a short group of notes, M might repeat the phrase several times with reordered notes, transpositions, rhythms, or dynamic levels. It was envisioned that performers would develop a knowledge of the program's tendencies and a sense of control in shaping the interactions during performance.
MIDI has been the most readily available source of output for algorithmic composers, such as Gary Nelson. One of Nelson's aims is to tailor extensive computer algorithms to make many of the compositional decisions in real time that he himself would intuitively make and output them to MIDI devices in a performance situation. In compositions such as Fractal Mountains (1989), he improvises with a MIDI wind controller over an algorithmically generated background. In each performance, the computer may made an entirely different set of controlled compositional decisions.
As early as 1970, Mathews and Moore implemented a microcomputer-based GROOVE system to control real-time performance on analog synthesizers (Lincoln, 1972). The computer would record a series of analog voltages from a small keyboard, joystick, and various knobs. The performance playback, through 14 D/A converters, could be altered by editing the disk file. With the advent of MIDI and digital instrument technology, Mathews developed a software/ hardware system that combines the resources of a sequencer and MIDI controller to form the Mathews Radio Baton, also called the Radio Drum. In Mathew's system a score file of MIDI note data can be read and output by his Conductor program, while expressive musical parameters such as tempo, dynamics, timbre, or any of the MIDI controller values can be controlled in real time by the Radio Drum. The controller consists of a flat surface with a complex array of receiving antennae and small radio transmitters placed in the head of drumsticks. By analyzing the signal strengths, the position of each stick in relation to the drum can be determined in three axes. One axis is usually used to "beat" the tempo of playback, while the other five variables can be assigned to key velocity, timbre control, or any other MIDI value in the Conductor program, giving the "conductor" a wide range of expression during performance. Several composers, such as Boulanger, have composed works that involve more than one performer/conductor, each controlling a different bank of instruments.
Return to Index
References and Bibliography
International MIDI Association (1989). "MIDI 1.0 Detailed Specification, Document Version 4.1." IMA, Los Angeles.
Lincoln, H. B. (1972). Uses of the Computer in Music Composition and Research. In "Advances in Computers 12 " (M. Rubinoff, ed.), pp. 73-114. Academic Press, New York.
Puckette, M. (1991a). Combining Event and Signal Processing in the MAX Graphical Programming Environment. Computer Music Journal 15 (3), 68-77.
This document prepared by Prof. Jeffrey Hass, Indiana University School of Music, Center for Electronic and Computer Music, Updated 9/2/98..
Email any comments, suggestions, requests for new documents, or corrections to cecm@indiana.edu
We are sorry we cannot answer question about your specific equipment.