Upload
dinhthuan
View
217
Download
0
Embed Size (px)
Citation preview
äl
MIDI
Musical Instrument Digital Interface
030-MIDI: 1HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
What’s MIDI
u A hardware and software specification
u Allows musical instruments and devices to exchange
information: musical notes, program changes, expression
controls
u Examples of MIDI-supporting devices: synthesizers,
samplers, keyboard controllers, lighting controllers,
sequencers,. . .
u “Supporting the Arts through Technology”
030-MIDI: 2HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
MIDI: the origin
u First idea: 1982–1983
u The Complete MIDI 1.0 Detailed Specification is jointly
prepared by the MIDI Manufacturers Association (MMA)
and the Japan MIDI Standards Committee (JMSC)
u Now JMSC becomes Association of Musical Electronics
Industry (AMEI)
030-MIDI: 3HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
MIDI: the specification
u The specification, last revised 1996, has seven sections
• MIDI and Music Synthesis Tutorial
• MIDI 1.0 Detailed Specification
• MIDI Time Code (MTC)
• Standard MIDI Files (SMF)
• General MIDI (GM)
• MIDI Show Control (MSC)
• MIDI Machine Control (MMC)
030-MIDI: 4HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
MIDI: recent developmentsu 1998: DLS: Downloadable Sounds Level 1 specification
u 1999-01: DLS Level 1.1 specification
u 1999-11: GM2: General MIDI Level 2 specification
u 2000-02: DLS: Downloadable Sounds Level 2.1 amendment text
u 2000-02: RMID (SMF w/DLS) specification
u 2000-10: MIDI Over IEEE-1394 specification
u 2001-08: Amendment 1 to DLS-2.0 specification
u 2001-11: GM-Lite: GM Lite Specification and Guidelines for Mobile
Applications
u 2001-11: eXtensible Music Format (XMF) specification
030-MIDI: 5HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
MIDI: more recent developmentsu 2002-02, 2002-05: SP-MIDI: Scalable Polyphony MIDI specification
u 2003-07: ZLIB Audio Compression Unpacker ID for XMF
u 2003-07: XMF: eXtensible Music File (XMF) Specification v.1.01
u 2003-09: GM-2: General MIDI 2 Specification v 1.1 (updated)
u 2004-09: DLS Level 1.1b
u 2004-09: DLS Level 2.1 amended
u 2004-11: DLS Level 2.1 corrected
u 2004-11: SP-MIDI amended
030-MIDI: 6HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Event-based vs. sample based
u MIDI data focus on events rather than samples
u Musical events, rather than the sound waveform itself,
are exchanged between MIDI devices using MIDI
messages
u Examples:Pressing a piano key Note OnReleasing a piano key Note OffChanging instrument sound Program ChangeChanging volume Volume controllerCrescendo and diminuendo Expression controller
030-MIDI: 7HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Events, events
u Only a few bytes are needed to represent an event
u Storage-friendly, network-friendly
u Easy to edit, e.g., can change the speed or pitch of
notes easily
u Hardware or software needed to generate sound
u Not easy to specify sound parameters precisely
030-MIDI: 8HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
MIDI: the physical specification
u Transmission parameters: asynchronous serial, 31.25k
baud ±1%; one start bit, 8 data bits, one stop bit
u Circuit: Point-to-point opto-isolated 5mA current loop,
current on = logic 0, fan out = 1, rise/fall time < 2µs
u Connector: DIN 5 pin (180◦) female panel mount
receptacle, labeled “MIDI IN” and “MIDI OUT”. “MIDI
THRU”, which copies MIDI IN data, is optional
u Cable: shielded twisted pair (STP), cannot be longer
than 50 feet (15 m)
030-MIDI: 9HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Words to knowChannel mode message Channel pressure Channel voice messageControl change Controller Data bytesDigital piano Electronic organ Electronic pianoGeneral MIDI Keyboard controller Local controlMIDI keyboard MIDI mode MonophonicMultitimbral Note number Note offNote on Octave number Omni modePatch Patch map Pitch bendingPitch wheel Poly mode PolyphonicPolyphonic key pressure Program Program changeRunning status Sampler SequencerSound generator Sound module Sound setSoundbank Status byte SynthesizerSysex System common message System exclusive messageSystem real time message Velocity Voice
030-MIDI: 11HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Some jargons
u Both controllers and sequencers generate MIDI data
u A controller is a device played as an instrument and
translates the performance into a MIDI data stream in
real time. e.g., musical instrument keyboard (keyboard
controller or simply “MIDI keyboard”)
u A sequencer is a device which allows MIDI data
sequences to be captured, stored, edited, combined, and
replayed
030-MIDI: 12HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Some more jargons
u A sound module, or sound generator, respond to MIDI
messages received at its MIDI IN port by playing sounds
u Many keyboard instruments, often called digital pianos,
include both a keyboard controller and a MIDI sound
module within the same unit
u The local control function of such instruments enables
or disables the internal link between the keyboard
controller and the sound module
030-MIDI: 13HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Connecting MIDI instruments:an example
Keyboard controller
MIDI OUT
MIDI IN
Sound module
030-MIDI: 14HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Digital Pianosand local control
Soundmodule
Keyboardcontroller
MIDI OUT
MIDI IN
Local control
Digital piano
030-MIDI: 15HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Connecting MIDI instruments
u MIDI data-producing devices (e.g., controllers and
sequencers) are connected to MIDI data-receiving
devices (e.g., sound modules — what besides that?)
u Computers can make use of MIDI interfaces to connect
to MIDI instruments
u Devices can be daisy-chained together using the MIDI
THRU port
u Daisy-chaining using MIDI THRU may introduce delay
030-MIDI: 16HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Connecting MIDI instruments:another example
Soundmodule 3
Soundmodule 2
Soundmodule 1
MIDI THRU
MIDI THRU
MIDI THRU
Drum machine
MIDI IN
MIDI OUT MIDI IN
MIDI IN
MIDI IN
Keyboard controller
030-MIDI: 17HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Use of MIDI interfaces
Sound module 1
Sound module 2
Digital piano
Drum machine
MIDI IN
MIDI IN
MIDI IN
MIDI OUT
MIDI IN
INOUT
INOUT
INOUT
INOUT
1
2
3
4
MIDI interfaceComputer
030-MIDI: 18HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Mixing audio outputs
INOUT
INOUT
INOUT
INOUT
1
2
3
4
Digital pianoMIDI interface
Sound module 1
MIDI IN
Drum machine
MIDI IN
MIDI IN
MIDI OUT
MIDI IN
Sound module 2
Computer
Loudspeakers
Mixer
Audio Out
Audio Out
Audio Out
Audio Out
Audio Out
Audio Inputs
030-MIDI: 19HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Confusion of terminologies
u The use of the words “synthesizer”, “sampler”, “digital
piano”, “MIDI keyboard”, “electonic organ”, “electronic
piano”, and “MIDI controller” are often used
interchangably, especially as marketing terms
u Always check the functionalities of a MIDI device before
purchasing it
030-MIDI: 20HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Confusion: an example
u Samplers are essentially digital recorders with some
control functions such as playing back samples at a
different pitch
u Synthesizers generate sound by computing its waveform
in real time, using, for example, Frequency Modulation
(FM) synthesis algorithms
030-MIDI: 21HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Confusion: an example continued
u The majority of today’s “synthesizers” are actually
sample playback devices. Waveform data are often
stored in disk or ROM
u Does a sound card with wavetables function as a
synthesizer or sampler?
030-MIDI: 22HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
More jargons: polyphony
u A sound module is said to be polyphonic if it can play
more than one note at a time
u Otherwise, it’s monophonic
u Modern sound modules often support 32-note or
64-note polyphony
u What if five keys are pressed at the same time on a
digital piano with 4-note polyphony?
030-MIDI: 23HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
MIDI channels
u There are 16 logical MIDI channels
u Channels are identified by a 4 bit number in some
messages (Channel messages)
u A device can be set to receive commands from, or send
commands to, a specific set of channels only
u How a device respond to channel commands depends on
the MIDI mode it is in
030-MIDI: 24HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Sound set
12345678910111213141516
Program numberPatch number /
Acoustic Grand Piano1
Gunshot128
Bright Acoustic Piano2Electric Grand Piano3
::
:
::
:
::
:
::
:
43 Cello42 Viola41 Violin
44 Contrbass
Applause127
Channel Voice / Timbre
Patch
Sound set / Patch map(Percussion)
030-MIDI: 25HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Voices and patches
u Voices are sounds of instruments (e.g., acoustic grand
piano, violin)
u Patches are assignment of voices. There are 128
patches in MIDI
u Example: in a particular sound module, patch 1 can be
assigned to the voice of marimba, patch 2 violin, etc.
u The association of all patch numbers to sounds is called
the patch map (example later)
030-MIDI: 26HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Patches and programs
u The word “patch” originates from the use of real
“patch cables” in some sound systems to select voices
u Patches are called programs in some contexts
u MIDI Program Change message instruct devices to
change the patch of a certain channel
u Yet, having only 128 programs may not be enough for
sound systems
030-MIDI: 27HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Banks (no money, though)
u A bank or soundbank is an extension of a patch. There
are 16384 possible banks
u MIDI Bank Select message instruct devices to change
its bank, a Program Change message must follow it
u A Bank Select message can be seen as an instruction for
a device to change its internal patch map
u Confusion, again: “soundbank” is often used to describe
a sound set
030-MIDI: 28HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Multitimbral instruments
u A sound module is said to be multitimbral if it is
capable of producing two or more different instrument
sounds at the same time
u Example: a synthesizer that can produce a piano sound
and a marimba sound at the same time is multitimbral
u What’s the difference between a polyphonic sound
module and a multitimbral one?
u Can a sound module be both polyphonic and
multitimbral?
030-MIDI: 29HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
MIDI modes
u MIDI modes establish the relationship between channels
and voice-assignment methods within a synthesizer
u The modes are Omni On/Off and Mono/Poly
u Each device has a basic channel for sending or receiving
MIDI messages
u The number of voices for devices supporting mono
mode is also used in one of the MIDI modes
030-MIDI: 30HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
MIDI modes: Omni on/off ä Omni onOmni off
× Mono
Poly
Omni off : Channel commands are recognized only if it
matches the receiving channel or channel range
Omni on : All commands are recognized, regardless of
their channel numbers
030-MIDI: 31HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
MIDI modes: Mono, Poly Omni onOmni off
× Mono
Poly
Poly : Voices are assigned polyphonically. Simultaneous
sounding of different notes possible
Mono : Often assigned one voice per channel. Note On
commands on a channel causes all other sounding notes
in that channel to be turned off
030-MIDI: 32HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
MIDI messages
u MIDI messages consists of a status byte (0x80–0xFF) and
zero or more data bytes (0x00–0x7F)
u A single message can occupy one, two or three bytes
including the status
u System exclusive messages (described later) occupy a
varying number of bytes
030-MIDI: 33HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
MIDI message types
u Channel messages
• Channel voice messages
• Channel mode messages
u System messages
• System common messages
• System real time messages
• System exclusive messages
030-MIDI: 34HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Channel messages: a summary
StatusMessage (hex) Data1 Data2Note Off 8n NoteNo VelocityNote On 9n NoteNo VelocityPolyphonic Key Pressure An NoteNo PressureControl Change Bn Controller ValueProgram Change Cn PgmNoChannel Pressure Dn PressurePitch Bend En LSB MSB
n: zero-based channel number
030-MIDI: 35HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Channel voice messages ä
u Note Off (0x8n), Note On (0x9n): a note is turned on or
off. Followed by a note number and a velocity
u The nibble n corresponds to the channel number
u n=0 ⇒ channel 1, n=1 ⇒ channel 2, and so on
u A Note On message with velocity 0 is equivalent to a
Note Off message with velocity 0x40 (Why do we need
that? Explained later)
030-MIDI: 36HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
More channel voice message
u Polyphonic Key Pressure (0xAn): change of key pressure
after it has been turned on
u Followed by note number and a pressure value
u Also called Polyphonic Aftertouch
u Useful for controllers for string instruments, e.g., violin
030-MIDI: 37HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Note numbers and octave number
u Each note is assigned a numeric value, which is
transmitted with any Note On/Off message
u Middle C has a reference value of 60 (0x3C)
u To distinguish notes from different octaves, an octave
number is appended to the note name
u Middle C is C4 (some systems use C3, C5 or even C6)
u Octave numbers change at the B–C boundary, so B3
and C4 is one semitone apart, so is C4 and C]4
030-MIDI: 38HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
The piano keyboard
C3 D3 E3 F3 G3 A3 B3 C4 D4 E4 F4 G4 A4 B4
C]3 D]3 F]3 G]3 A]3 C]4 D]4 F]4 G]4 A]4D[3 E[3 G[3 A[3 B[3 D[4 E[4 G[4 A[4 B[4
030-MIDI: 39HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Velocity
u Interpretation of the Velocity byte is left to the receiving
instrument
u Usually indicates how hard or fast a key has been
pressed or released
u The larger the value, the stronger the
velocity-controlled effect
u Devices without velocity sensitivity should use a velocity
of 0x40
030-MIDI: 40HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
More channel voice messages
u Control Change (0xBn): change controller values.
Followed by controller number, ranging from 0 to 119,
then controller value
u Note that “controller” here is different from the
“controller” in “keyboard controller”
u Program Change (0xCn): change internal patch map,
followed by program (patch) number
030-MIDI: 41HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Even more channel voice messages
u Channel Pressure (0xDn): change of key pressure for all
keys of the channel. Followed by the pressure amount
u Channel Pressure is also called Channel Aftertouch
u Pitch Bend (or pitch wheel) (0xEn): modify the pitch of
sounding notes. Followed first by least significant seven
bits, then the most significant seven bits of pitch bend
value. 0x2000 means centered pitch wheel
030-MIDI: 42HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Controllers0 Bank select 70 Sound controller 1 (default: Sound variation)1 Modulation wheel or lever 71 Sound controller 2 (default: Timbre/harmonic intensity)2 Breath controller 72 Sound controller 3 (default: Release time)3 (undefined) 73 Sound controller 4 (default: Attack time)4 Foot controller 74 Sound controller 5 (default: Brightness)5 Portamento time 75–79 Sound controller 6–10 (no defaults)6 Data entry MSB 80–83 General purpose controllers 5–87 Channel volume (formerly Main volume) 84 Portamento control8 Balance 85–90 (undefined)9 (undefined) 91 Effects 1 depth (formerly External effects depth)
10 Pan 92 Effects 2 depth (formerly Tremolo depth)11 Expression controller 93 Effects 3 depth (formerly Chorus depth)
12–13 Effect control 1,2 94 Effects 4 depth (formerly Celeste (detune) depth)14–15 (undefined) 95 Effects 5 depth (formerly Phaser depth)16–19 General Purpose Controllers 1–4 96 Data increment20–31 (undefined) 97 Data decrement32–63 LSB for values 0–31 98 Non-Registered Parameter Number (NRPN) LSB
64 Damper pedal (sustain) 99 Non-Registered Parameter Number (NRPN) MSB65 Portamento On/Off 100 Registered Parameter Number (RPN) LSB66 Sostenuto 101 Registered Parameter Number (RPN) MSB67 Soft pedal 102–119 (undefined)68 Legato footswitch 120–127 (reserved for channel mode messages)69 Hold 2
030-MIDI: 43HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Channel mode messages ä
u Channel mode messages are Control Change message
with controller number 120–127
Controller Message120 All Sound Off121 Reset All Controllers122 Local Control123 All Notes Off124 Omni Off125 Omni On126 Mono On (Poly off)127 Poly On (Mono off)
030-MIDI: 44HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
System common messages ä
u Mainly deal with sequencer operations
u Also for tuning analog synthesizers
Status (hex) MessageF1 MIDI Time Code Quarter FrameF2 Song Position PointerF3 Song SelectF6 Tune RequestF7 EOX (End Of Exclusive)
030-MIDI: 45HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
System real time messages ä
u Used to synchronize clock-based MIDI equipments
Status (hex) MessageF8 Timing ClockFA StartFB ContinueFC StopFE Active SensingFF System Reset
030-MIDI: 46HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
System exclusive messages ä
u Often called SysEx messages
u For sending byte sequences to a MIDI device
u Followed by a one-byte or three-byte (manufacturer) ID
number, then a Device ID, the data, and an EOX
message
u MIDI Sample Dump Standard (SDS) specifies the use of
SysEx messages to send sampler data dumps between
devices
030-MIDI: 47HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Sending MIDI messages: question
Suppose 22 notes are to start sounding simultaneously.
What’s the time needed to send
all the MIDI Note On messages?
030-MIDI: 48HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Sending MIDI messages: answer
Time needed to transmit one byte = 1/(31.25k
10
)= 320µs
Number of bytes for a Note On message = 3
Time needed to send 22 Note On messages
= 320× 3× 22µs = 21.12ms
u Example MIDI stream: Note On messages on channel 1
for every note from A3 till D4 (piano keyboard here)
90 39 40 90 3A 40 90 3B 40 90 3C 40 90 3D 40 90 3E 40
030-MIDI: 49HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Running status
u The status byte takes time to send
u Simultaneous events of the same type (e.g., Note On)
often have the same status byte
u To save bandwidth, running status is used. The status
byte of channel messages are remembered at the
receiver
u Status bytes need not be sent if a message have the
same status byte as the preceding message
030-MIDI: 50HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Running status: example
u The MIDI data stream shown previously can be
shortened
u Original:
90 39 40 90 3A 40 90 3B 40 90 3C 40 90 3D 40 90 3E 40
u After using running status:
90 39 40 3A 40 3B 40 3C 40 3D 40 3E 40
030-MIDI: 51HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Running status:another example, question
u What’s the MIDI data stream of a chord where C4, E4
and G4 are turned on in succession, with each note
sounding for half a second and turned off when another
note starts sounding? Assume that all notes are turned
on with velocity 96 and turned off with velocity 64
030-MIDI: 52HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Running status:another example, answer
u Answer:
90 3C 60 80 3C 40 90 40 60 80 40 40 90 43 60 80 43 40
u Alternative answer:
90 3C 60 90 3C 00 90 40 60 90 40 00 90 43 60 90 43 00
u After using running status:
90 3C 60 3C 00 40 60 40 00 43 60 43 00
u Now, do you know why Note On with velocity zero is
allowed and is indeed often used?
030-MIDI: 53HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
MIDI: problems
u MIDI does not specify the patch map for instruments
u Inconsistency may occur between different MIDI
instruments having different patch maps. e.g., Acoustic
Grand Piano may be patch 1 on one system but patch
13 on another
u The same MIDI stream played on different sound
modules may sound differently
u Affects portability of MIDI files
030-MIDI: 54HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
The solution: General MIDI
u General MIDI (GM) System describes the minimum
requirement of sound generators
u Specifies minimum number of voices, sound locations,
drum note mapping, octave registration, pitch bend
range, and controller usage
u Does not specify exact timbre and characteristics of
instruments
u Identified by the GM logo
030-MIDI: 55HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
GM system
u Specifies the followings:
• GM sound generator requirements
• GM sound generator recommended hardware
• GM protocol implementation requirements
030-MIDI: 56HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
GM System Level 1sound generator requirements ä
u Minimum of 24 fully dynamically allocated voices
available simultaneously for both melodic and percussive
sounds, or 16 dynamically allocated voices for melody
and 8 for percussion
u Support all 16 MIDI polyphonic channels
u Each channel can play a different instrument
030-MIDI: 57HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
More on GM System Level 1sound generator requirements ä
u At least 128 presets for instruments (MIDI program
numbers) conforming to the GM sound set
u At least 47 preset percussion sounds conforming to the
GM percussion map
030-MIDI: 58HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
General MIDI sound set groupings
ProgNo Instrument group ProgNo Instrument group1–8 Piano 65–72 Reed9–16 Chromatic percussion 73–80 Pipe17–24 Organ 81–88 Synth Lead25–32 Guitar 89–96 Synth Pad33–40 Bass 97–104 Synth Effects41–48 Strings 105–112 Ethnic29–56 Ensemble 113–120 Percussive57–64 Brass 121–128 Sound Effects
u Both GM sound set groupings and the GM sound set
apply to all channels except channel 10
030-MIDI: 59HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
General MIDI sound setProg Instrument Prog Instrument Prog Instrument Prog Instrument
1 Acoustic Grand Piano 33 Acoustic Bass 65 Soprano Sax 97 FX 1 (rain)2 Bright Acoustic Piano 34 Electric Bass (finger) 66 Alto Sax 98 FX 2 (soundtrack)3 Electric Grand Piano 35 Electric Bass (pick) 67 Tenor Sax 99 FX 3 (crystal)4 Honky-tonk Piano 36 Fretless Bass 68 Baritone Sax 100 FX 4 (atmosphere)5 Rhodes Piano 37 Slap Bass 1 69 Oboe 101 FX 5 (brightness)6 Chorused Piano 38 Slap Bass 2 70 English Horn 102 FX 6 (goblins)7 Harpsichord 39 Synth Bass 1 71 Bassoon 103 FX 7 (echoes)8 Clavi 40 Synth Bass 2 72 Clarinet 104 FX 8 (sci-fi)9 Celesta 41 Violin 73 Piccolo 105 Sitar
10 Glockenspiel 42 Viola 74 Flute 106 Banjo11 Music Box 43 Cello 75 Recorder 107 Shamisen12 Vibraphone 44 Contrabass 76 Pan Flute 108 Koto13 Marimba 45 Tremolo Strings 77 Blown Bottle 109 Kalimba14 Xylophone 46 Pizzicato Strings 78 Shakuhachi 110 Bag pipe15 Tubular Bells 47 Orchestral Harp 79 Whistle 111 Fiddle16 Dulcimer 48 Timpani 80 Ocarina 112 Shanai17 Drawbar Organ 49 String Ensemble 1 81 Lead 1 (square) 113 Tinkle Bell18 Percussive Organ 50 String Ensemble 2 82 Lead 2 (sawtooth) 114 Agogo19 Rock Organ 51 SynthStrings 1 83 Lead 3 (calliope) 115 Steel Drums20 Church Organ 52 SynthStrings 2 84 Lead 4 (chiff) 116 Woodblock21 Reed Organ 53 Choir Aahs 85 Lead 5 (charang) 117 Taiko Drum22 Accordion 54 Voice Oohs 86 Lead 6 (voice) 118 Melodic Tom23 Harmonica 55 Synth Voice 87 Lead 7 (fifths) 119 Synth Drum24 Tango Accordion 56 Orchestra Hit 88 Lead 8 (bass + lead) 120 Reverse Cymbal25 Acoustic Guitar (nylon) 57 Trumpet 89 Pad 1 (new age) 121 Guitar Fret Noise26 Acoustic Guitar (steel) 58 Trombone 90 Pad 2 (warm) 122 Breath Noise27 Electric Guitar (jazz) 59 Tuba 91 Pad 3 (polysynth) 123 Seashore28 Electric Guitar (clean) 60 Muted Trumpet 92 Pad 4 (choir) 124 Bird Tweet29 Electric Guitar (muted) 61 French Horn 93 Pad 5 (bowed) 125 Telephone Ring30 Overdriven Guitar 62 Brass Section 94 Pad 6 (metallic) 126 Helicopter31 Distortion Guitar 63 Synth Brass 1 95 Pad 7 (halo) 127 Applause32 Guitar Harmonics 64 Synth Brass 2 96 Pad 8 (sweep) 128 Gunshot
030-MIDI: 60HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
General MIDI percussion mapMIDI
Drum soundMIDI
Drum soundMIDI
Drum soundKey Key Key35 Acoustic Bass Drum 51 Ride Cymbal 1 67 High Agogo36 Bass Drum 1 52 Chinese Cymbal 68 Low Agogo37 Side Stick 53 Ride Bell 69 Cabasa38 Acoustic Snare 54 Tambourine 70 Maracas39 Hand Clap 55 Splash Cymbal 71 Short Whistle40 Electric Snare 56 Cowbell 72 Long Whistle41 Low Floor Tom 57 Crash Cymbal 2 73 Short Guiro42 Closed Hi Hat 58 Vibraslap 75 Claves43 High Floor Tom 59 Ride Cymbal 2 76 Hi Wood Block44 Pedal Hi-Hat 60 Hi Bongo 77 Low Wood Block45 Low Tom 61 Low Bongo 78 Mute Cuica46 Open Hi-Hat 62 Mute Hi Conga 79 Open Cuica47 Low-Mid Tom 63 Open Hi Conga 80 Mute Triangle48 Hi Mid Tom 64 Low Conga 81 Open Triangle49 Crash Cymbal 1 65 High Timbale50 High Tom 66 Low Timbale
030-MIDI: 61HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
General MIDI Level 2
u Published in 1999-11-15, extends GM Level 1
u Support up to 2 simultaneous percussion kits
u New control change messages (Decay time, Vibrato
rate, Vibrato depth, Vibrato delay)
u Defines universal SysEx messages, mainly for tuning,
reverb and chorus settings
u Recommends response behavior of some messages
u Logo:
030-MIDI: 62HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
SMF: Standard MIDI Files
u Specifies how the MIDI data stream is stored with
timing information, the .MID stuff
u Need to encode timing information
u A chunk-based file format
u Support tracks
u Support meta-events
030-MIDI: 63HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
SMF timing
u MIDI “ticks” is the finest unit of timing
u Header chunk specifies of number of ticks per quarter
note or ticks per SMPTE frame
u The Set Tempo meta-event specifies the number of
microseconds per MIDI quarter note
u The Time Signature meta-event specifies number of
MIDI clocks in a metronome click
u A system common message also deal with MIDI Time
Code time
030-MIDI: 64HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
SMF formats
Format 0 — most interchangable format
u one header, one track
Format 1 — vertically one dimensional form
u one header, one or more tracks
u a collection of simultaneous tracks
Format 2 — horizontally one dimensional form
u one header, one or more tracks
u one independent pattern in each track
030-MIDI: 65HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
SMF meta-events
Format (hex) DescriptionFF 00 02 ssss Sequence numberFF 01 len text Text eventFF 02 len text Copyright noticeFF 03 len text Sequence/Track nameFF 04 len text Instrument nameFF 05 len text LyricFF 06 len text MarkerFF 07 len text Cue pointFF 20 01 cc MIDI channel prefixFF 2F 00 End of track (mandatory meta-event)FF 51 03 tttttt Set tempo, µs per quarter noteFF 54 05 hr mn se fr ff SMPTE OffsetFF 58 04 nn dd cc bb Time signature nn/2dd
cc MIDI clock per metronome clickbb notated 32nd note as 24 MIDI clock
FF 58 02 sf mi Key signature, sf sharps (negative=flats)mi = 〈0,1〉 ⇒ 〈major, minor〉
FF 7F len data Sequencer-specific meta-event
030-MIDI: 66HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Other parts ofthe MIDI specification
MIDI Time Code (MTC) — for synchronization and
control of MIDI devices
MIDI Show Control (MSC) — allow MIDI systems to
communication with and to control dedicated intelligent
control equipment in theatrical, live performance,
multimedia, audio-visual and similar environments
030-MIDI: 67HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Other parts ofthe MIDI specification
MIDI Machine Control (MMC) — allow MIDI systems
to communication with and to control some of the more
traditional audio recording and production systems
MIDI Media Adaptation Layer for IEEE-1394 — (Oct
2000) describes how MIDI data is transmitted over
IEEE-1394 (Firewire)
Downloadable Sounds Specification (DLS) — Levels 1,
2, and 2.1, formats for defining musical instruments
using waveform information
030-MIDI: 68HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
MIDI: an evaluation
u Provides a nice framework for musicians to experiment
on musical arrangements and orchestrations
u Favors piano or keyboard type of instruments
u Flexible, because it does not specify how an instrument
should sound
u Too much flexibility, the same sequence can play very
differently under different system configurations
030-MIDI: 69HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
MIDI: an evaluation
u No standard way of access to synthesizer parameters
u Lack of bidirectional communication facilities
u It’s a “standard” anyway (though de facto
/di: ‘fæktou/)
u Any more?
030-MIDI: 70HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
Section referencesu The Complete MIDI 1.0 Detailed Specification
Version 96.1, MIDI Manufacturers Association
u General MIDI Level 2
MIDI Manufacturers Association
u Downloadable Sounds Level 2.1
MIDI Manufacturers Association
MIDI specifications from the source. These are some of the more
readable specifications.
u http://www.midi.org/
The MIDI Manufacturers Association (MMA) website.
030-MIDI: 71HKU ICOM6018 2006–2007
Multimedia ComputingDr. YIP Chi Lap
More references lä
u Beyond MIDI: The Handbook of Musical Codes
edited by Eleanor Selfridge-Field
The MIT Press, ISBN 0-262-19394-9
MIDI, although influential, is not the only way music can be
represented in computers. This book introduces readers a number of
musical codes designed for a number of very different purposes.
u Musicians Make a Standard: The MIDI Phenomenon
Gareth Loy
Computer Music Journal, Vol.9, No.4, Winter 1985.
Quite a nice reference to MIDI that brings you back to the days MIDI
was designed. So, it is outdated. Don’t expect information from the
article to be completely accurate in today’s situations.030-MIDI: 72
HKU ICOM6018 2006–2007Multimedia Computing
Dr. YIP Chi Lap