MIDI

Also known as: Musical Instrument Digital Interface

On this page 7

MIDI, short for Musical Instrument Digital Interface, is a communication protocol that transmits musical performance instructions rather than sound: which note was played, how hard, for how long and how controls were moved. In digital audio work it connects keyboards, drum pads, synthesizers, sequencers and the digital audio workstation, so that one device can play, record or control another without passing a single audio sample.

The original specification appeared in 1983 and remains in use with remarkably few changes, which makes MIDI one of the most durable standards in audio technology. Its central idea is the separation of performance from sound: a MIDI recording is a list of events that any compatible instrument can render, edit or re-voice later.

How MIDI messages describe a performance

A MIDI stream is a sequence of short event messages, each made of a status byte that names the message type and channel, followed by one or two data bytes with 7-bit values from 0 to 127. When a key goes down, a keyboard sends a Note On message with the note number and velocity; when the key is released, it sends Note Off. The receiving instrument decides what sound those events produce.

The classic protocol carries 16 channels on one connection, so a single cable can address sixteen different instruments or sound parts independently. Note number 60 is conventionally middle C, and the full range of 128 notes covers more than ten octaves, far beyond a piano keyboard.

The most common message types are summarized below with their value ranges and typical role in a production.

MessageData valuesTypical use
Note On / Note OffNote 0-127, velocity 0-127Start and stop notes
Control Change (CC)Controller 0-127, value 0-127Modulation, volume, sustain pedal
Program ChangeProgram 0-127Select a preset or patch
Pitch Bend14-bit, 0-16383, center 8192Smooth pitch glides
Channel PressurePressure 0-127Aftertouch for the whole channel
Polyphonic Key PressureNote and pressure 0-127Aftertouch per key
Core MIDI 1.0 channel messages

Beyond channel messages, System Exclusive (SysEx) messages carry manufacturer-specific data such as full patch dumps, and system real-time messages such as MIDI Clock, Start and Stop keep sequencers and drum machines in tempo. MIDI Clock runs at 24 pulses per quarter note, so its timing follows the tempo of the master device.

Transports, timing and the MIDI 2.0 extension

The original hardware link is a 5-pin DIN cable running a current-loop serial connection at 31,250 bits per second, with opto-isolated inputs that prevent ground loops between instruments. At that rate a three-byte Note On takes just under one millisecond to transmit, so a dense chord sent over one cable is spread out slightly in time.

Most current setups use USB MIDI, which is far faster and allows many virtual ports, or software connections inside a computer between a sequencer and virtual instruments. Network and wireless transports also exist, with Bluetooth LE MIDI being convenient but adding variable latency.

The following comparison shows how the common transports differ in practice.

TransportTypical latencyStrengthsLimitations
5-pin DINAbout 1 ms per messageRobust, isolated, no computer needed16 channels per cable, slow for dense data
USB MIDILow, driver dependentFast, multiple ports, bus poweredShort cable length, host required
Network MIDILow on a wired LANLong distances, many devicesNetwork setup and jitter on busy links
Bluetooth LE MIDISeveral to tens of ms, variableCable free, mobile devicesJitter, unsuitable for tight timing
TRS MIDI (3.5 mm)Same as 5-pin DINSaves space on compact devicesTwo wiring conventions in circulation
Common MIDI transports compared

MIDI 2.0, adopted in 2020, keeps backward compatibility through a negotiation process called MIDI Capability Inquiry and introduces the Universal MIDI Packet format. It raises velocity to 16-bit resolution, controllers and pitch bend to 32-bit resolution, and adds per-note controllers and property exchange, so devices can describe their own parameters. Adoption is gradual, and MIDI 1.0 remains the common denominator across hardware and software.

MIDI compared with recorded audio

MIDI and audio describe music at different levels. Audio is a sampled waveform defined by sample rate and bit depth, as in PCM recordings, while MIDI is a symbolic score of events. This difference decides what can be changed after recording and what cannot.

PropertyMIDI dataRecorded audio
ContentNote and control eventsSampled sound pressure
File sizeKilobytes for a full songMegabytes per minute
EditingChange notes, timing and sound freelyLimited to cutting and processing
Sound depends onThe receiving instrumentThe original source and recording
Tempo changeLossless, events simply moveRequires time stretching
Captures nuance ofGestures and controller movesAcoustics, timbre and room
MIDI data versus recorded audio

A consequence often misunderstood by newcomers is that a MIDI file has no sound of its own. The same Standard MIDI File played through two different synthesizers will sound different, because each instrument interprets the events with its own voices. General MIDI reduces this problem by defining a standard map of 128 program sounds and a fixed drum note layout, so that a file at least selects a piano when a piano is intended.

Using MIDI in a production workflow

In a modern workflow MIDI is the control layer of the studio. A performer plays a controller keyboard, the digital audio workstation records MIDI events onto a track, and a software synthesizer or VST plugin renders them to audio in real time. Because the performance stays editable, the producer can quantize timing, correct wrong notes and swap sounds long after the session.

Typical decisions in a MIDI setup are summarized in the following table.

SituationRecommended choiceReason
Playing virtual instruments liveUSB controller and low audio bufferKeeps total latency playable
Syncing hardware sequencersOne MIDI Clock masterPrevents competing tempo sources
Expressive performanceMap velocity curve and mod wheelMatches the instrument to the player
Exchanging songs between programsStandard MIDI File type 1Keeps tracks separate
Mixing automation from hardwareControl Change to DAW parametersTactile control of faders and knobs
Practical MIDI setup choices

Latency matters in a different way than with audio. MIDI itself adds little delay over USB, but the audio buffer of the virtual instrument adds most of the perceived lag. Buffer sizes of 64 to 256 samples at 48 kHz usually keep the response playable, and an ASIO or similar low-latency driver helps on Windows systems.

Limitations and common mistakes

The 7-bit resolution of MIDI 1.0 is its best-known weakness. A filter cutoff swept with 128 steps can produce audible zipper noise, which is why some controllers pair two CC numbers into a 14-bit value and why many synthesizers smooth incoming values internally.

  • Stuck notes occur when a Note Off message is lost, for example after a cable is unplugged; an All Notes Off message or a panic button clears them.
  • MIDI loops arise when a device echoes its input back to the sender, causing doubled notes or runaway feedback; disable local echo or MIDI Thru where it is not needed.
  • Channel mismatches are the most common cause of silence: the controller sends on one channel while the instrument listens on another.
  • Running too many devices on one DIN chain adds delay and timing smear; a MIDI interface with several outputs avoids it.
  • Velocity 0 Note On is a valid way to end a note, and some poorly written software misreads it.

Put simply

MIDI works like sheet music for machines. It does not contain any sound. Instead, it tells an instrument which key was pressed, how hard and when it was let go.

Because only the instructions are stored, you can change everything later: fix a wrong note, slow the song down or turn a piano part into strings. The instrument that receives MIDI decides how it sounds, just as two pianists reading the same score produce different performances.

In practice

A film composer sketches a cue at a home studio with an 88-key controller connected by USB. Each pass is recorded as MIDI on separate tracks for strings, brass and percussion, all played by sampled orchestral libraries inside the workstation, with the audio buffer set to 128 samples at 48 kHz for a responsive feel.

When the director asks for the scene to be two seconds longer and the tempo slightly slower, the composer changes the tempo map and nudges a few phrases. No re-recording is needed, because the notes simply move. Mod wheel data written as CC1 shapes the string swells, and a velocity correction evens out a rushed horn line. Only at the end are the parts rendered to audio stems for the mixing engineer, while the MIDI session stays available for further revisions.