the midi standard - · what is midi? midi stands for musical instrument digital...

Click here to load reader

Post on 27-Dec-2018




3 download

Embed Size (px)


The MIDI Standard



What is MIDI? Brief history of MIDI How does MIDI work? Short Example MIDI Files and Connections Timing Issues Advantages and Disadvantages


What is MIDI?

MIDI stands for Musical Instrument Digital Interface

Standard that specifies the hardware interface and the data format of electronic instruments and audio systems

Intended to connect to musical instruments, computers, and related audio devices

Small file size, large range of instruments, and easy to modify

MIDI is like sheet music, and sound cards are the instrument and musician


Why does MIDI exist?

Before MIDI (early 1980s) there was no standard for communication between electronic musical instruments

different manufacturers means different standards possibly trying to link analog and digital devices to each other limiting musicians ability to perform with many different machines

Roland, a Japanese musical instrument company, proposed making a standard Wanted it to be simple and small The music community, specifically Roland, Oberheim Electronics, Sequential

Circuits, Yamaha, Korg and Kawai, then created MIDI


Basic Vocabulary

Channel: synonymous to slave select Each MIDI device usually has several channels Think of a channel as an individual capable of playing many instruments and switching between


Program/Patch: the instrument that the channel will be imitating (e.g. electric guitar, drum, bass, etc)

MIDI Instrument: MIDI defines this as any MIDI device Include sequencer, synthesizer, drum machine, etc.


MIDI Communication Protocol

MIDI messages are sent over asynchronous serial at 31250 baud Start bit, 8 data bits, stop bit

10 bits over a period of 320 mircoseconds per serial byte

The messages are broken up into Status bytes and 0 - 2 Data bytes Status byte is sent first, followed by each data byte

6From MIDI 1.0 Specification

MIDI Communication Protocol

Upper 4 bits of the Status describe the command (MSB is always 1) Lower 4 bits are the channel number The structure of the data bytes is dependent on the command Instructions can be sent in real-time or stored in a MIDI file (depending on



Some Important MIDI messages

NoteOn - 0x9M 0xNN 0xNN Plays a note with specific pitch and attack (volume)

NoteOff - 0x8M 0xNN 0xNN Turns off a note on a channel

ControlChange - 0xCM 0xNN Knob, switch, pedal, etc. Generated when state of a controller changes

ProgramChange - 0xBM 0xNN Used to switch program on a specified channel

System Exclusive Messages Unique to specific MIDI devices (determined by the manufacturer)


M - channel select bitsN - depends on input

MIDI Note Range

Zero-indexed from C-1 (note 0) to G9 (note 127)

This goes beyond the range of an 88-key piano

C-1 is approximately 8 Hz -- below the human hearing range

G9 is approximately 12.5 KHz -- within the typical human hearing range


How does a MIDI synthesizer work?

When a key is pressed, a NoteOn message is generated based on the key That message is sent over serial to a microcontroller The microcontroller reads the message and play audio from a stored bank of

samples When the key is released, a NoteOff message is sent in the same way Pedals, pitch wheels, knobs, and other devices can be used to send

ControlChange messages that can modify the sound, select what instrument is being played, etc.


Example MIDI Sequence

Example from

Status Data1 - Pitch Data2 - Attack


Standard MIDI File (SMF)

Standardized file formats to save sequences that can then be played back on other MIDI devices

Header contains information about the file arrangement track count, tempo, and format

Type 0, 1 and 2 files Type 0: single track of entire performance Type 1: multitrack to be played back simultaneously Type 2 (rare): multiple arrangements, each arrangement in own track to be played sequentially

Popular way to distribute music in Europe and Japan in the 1990s


MIDI Connections

180 five-pin DIN connector Typically only 3 pins used

USB connectors also now common MIDI in, thru and out

In: provides input from MIDIcontroller

Thru: output signal that providescopy of the MIDI in (daisy chaining)

Out: provides output to anotherMIDI device, perhaps a synthesizer

Image sources:, MIDI 1.0 Specification


14MIDI 1.0 Specification


Timing Issues

3 Bytes of data takes around 1ms to send Sending the same info to all 16 channel can be a delay of 16ms Only one note can start or stop per MIDI instruction What if you want more than one to start or stop simultaneously?

Some MIDI devices use timestamps to specify in advance when notes should stop or start. Using timers and interrupts, these instructions can be executed with significantly less delay!

Length of cords can cause delay MIDI specifies maximum of 50 ft


How has it changed over the years?

General MIDI (1991) Further specifications for MIDI-compatible instruments Must support 16 simultaneous channels Must support multiple simultaneous notes on each channel Defines the instrument mapped to each of the 128 possible patch numbers Also General MIDI Level 2 added a couple features

Manufacturers have created their own specific supersets of MIDI Most just add support for their own patches Roland GS (1991) Yamaha XG (1994)


MIDI Applications

Primary application is based on audio and audio equipment Digital synthesizers and sequencers Digital Audio Workstations Effects units

Lighting systems Video game music Early computer audio



Advantages: File sizes are much smaller than audio files

Only contain instructions on how to play audio Multiple devices can be linked together MIDI sequences can be edited in ways that audio files cannot, such as changing

pitch of a sectionDisadvantages: MIDI specification only describes how MIDI devices communicate

Not what they do: slightly different sounds, different capabilities across devices Quality of sound is limited by playback device

Most MIDI instruments have a different sound from their real instrument counterpart Cant store vocals - still an audio file



MIDI is an excellent tool for communicating with or between musical instruments

It has a large set of instructions that give plenty of versatility The communication protocol it uses is very simple MIDI is very widely-adopted On the other hand, vendor-specific supersets of MIDI can get confusing fast Sound quality cannot match actual recordings or real instruments


Further reading

The MIDI 1.0 Specification:

Requires a free account to download

Summary of MIDI Messages: