You are on page 1of 30

MIDI

Musical Instrument Digital Interface


The MIDI protocol a language that
lets synthesizers, computers and other
devices talk to each other.

The MIDI
Language

Messages use MIDI cables.


Audio uses audio cables.

MIDI Messages
Note on
Note off
Program change (patch change)
Pitch bend
Controller change
Polyphonic pressure (aftertouch)
Monophonic pressure (aftertouch)

MIDI Channels

Ch 1: piano

Ch 2: guitar

Ch 3: bass

Ch 4: tuba

MIDI cable carries 16 channels

MIDI devices communicate using


messages

Note on
Note off
Program change
Pitch bend
Controller change
Pressure (polyphonic)
Pressure (monophonic)

IN

OUT

AB

IN

Audio
MIDI
USB

Multi-port MIDI Interface (2 in/out pairs)


OUT
A B

Lights!
Thru switch connects In to Out,
for use without a computer
Leave in out position!

IN

USB port

Multi-port MIDI Interface (8 in/out pairs)

Front
MIDI Outputs

MIDI Inputs

Back
Each MIDI cable can
carry 16 channels.

USB port

Two Kinds of MIDI Network


Purpose: provide pathways for MIDI messages
MIDI Daisy-chain Network
Devices connected in series:
interface

MIDI Star Network


Devices connected in parallel:

interface

MIDI Daisy-chain Network


IN

OUT
THRU

IN

IN

THRU

THRU port: transmits copy of messages from IN port


The 3 devices must share 16 channels.

MIDI Star Network

port 7
port 5
port 4

Each device has 16 channels all to itself.


Any device can act as a controller.

port 1

Pros and Cons

MIDI Daisy-chain Network


does not require multi-port MIDI interface

MIDI Star Network


more accurate timing
more channels
more than one device can act as controller

Local Control
Synthesizer

Computer

sound generator
echo and
re-channelize

local
connection

keyboard

MIDI messages transmitted:


Internally
Over MIDI cables

MIDI Patch-thru and Re-channelizing


Sequencer: echo and re-channelize

Triton Le

Local control turned off.


Synth transmits on channel 1.
Sequencer echoes note back to
synth on channel 2.
Synth plays Detox Lead.

MIDI
USB

MIDI Data Transmission


What goes through the MIDI cable?

Voltage

Timed pulses of electricity 31250 per second

Time
voltage: lo

hi lo hi

lo

hi lo hi lo hi

lo

hi

lo

bits: 1 1 0 1 0 0 0 1 1 0 1 0 1 0 0 0 1 1 0 0 1

MIDI Data Encoding


The bits encode numbers, in groups of 8 bits.
bits: 1 1 0 1 0 0 0 1 1 0 1 0 1 0 0 0 1 1 0 0 1

stop bit

byte

10100011

start bit

163 decimal

Byte: an 8-bit binary number

MIDI Message Bytes


Stream of bytes parsed into MIDI messages.
Each message contains one or more bytes
byte 1: Status Byte
what type of message [e.g., note-on]
what channel (for some message types)
bytes 1-?: Data Bytes
meaning depends on type of message
each byte has a range from 0 to 127
[128 values]

MIDI Data Rate


31250 bits / second = 3125 10-bit bytes / second
Typical messages have 2 to 3 bytes.
So MIDI can handle between 1000 and 1500
messages per second.
Sounds like a lot, but its easy to clog the stream
with controller and pitch bend messages

Types of MIDI Message


MIDI Message

Channel
Voice

Mode

System
Real-time

Common

SysEx

Channel Voice Messages


Type

Data 1

Data 2

Note on

Note num

Velocity

Note off

Note num

Velocity

Program change

Program num

Pitch bend

Bend amount

Control change

Controller num

Mono pressure

Value

Poly pressure

Note num

Value
Value

All values 0 to 127, except Pitch bend: -8192 to 8191

Channel Voice Oddities


Program change can select only 128 programs.
Bank Select (a type of Control change message)
lets you select 128 programs within each bank.
Pitch bend has much wider range (16384 values).
Why? Our ears more sensitive to pitch changes.
Note off rarely used.
Instead, note on with velocity = 0

Channel Voice Messages


Type

Data 1

Data 2

Note on

Note num

Velocity

Note off

Note num

Velocity

Program change

Program num

Pitch bend

Bend amount

Control change

Controller num

Mono pressure

Value

Poly pressure

Note num

Value
Value

All values 0 to 127, except Pitch bend: -8192 to 8191

Control Change Message


One of the 7 Channel Voice messages
Data byte 1: controller number
Data byte 2: value [0-127]
Lots of controller numbers in common use
Effect on sound dependent on synthesizer patch

Common Control Change Messages


Controller Name

Controller Number

Modulation wheel (JS+Y)

Breath controller (JS-Y)

Foot controller

Data entry

Volume

Pan

10

Sustain (damper) pedal

64

JS = Joy Stick; JS+Y = move joystick up along Y axis.


Sustain pedal is a switch controller its either on or off.

Timing in a MIDI Sequencer


Measure | Beat | Tick
Example:

2 | 3 | 120
2nd measure
3rd beat
120th tick

Tick: tiny, tempo-dependent unit of time


480 ticks per quarter note
(by default in Digital Performer)

Ticks and Note Values


quarter =

480 ticks

8th =

ticks

16th =

ticks

32nd =

ticks

triplet 8th =

ticks

Quantization
Snap notes to a rhythmic grid
Notes (piano-roll)

Show 8th-note grid

Quantize to 8ths

Different meanings for control, controller


1.An instrument that controls others

[guitar controller, wind controller, keyboard controller, etc.]

2.Physical controls on an instrument

[mod. wheel, data slider, foot pedal, breath controller, etc.]

3.MIDI control change messages

[volume controller, pan controller, controller #6, etc.]

Synthesizer Polyphony
Polyphony means many voices.
A synthesizer needs at least one voice
to play one note.
Korg Triton Le has 62 voices
When you run out of voices, some notes
will be cut short.
Some sounds need more than one voice
per note.

Synthesizer Polyphony
Lets say a synth has 8-note polyphony.
Play aplay
Now
chord
a new
withnote
8 notes...
while holding the others

One of the first notes stops sounding, even


though youre still playing it.

You might also like