Musical Instrument Digital Interface (MIDI)
Musical Instrument Digital Interface (MIDI)
(MIDI)
1
Overview
What is MIDI?
MIDI benefits
MIDI configuration
MIDI ports
MIDI interface
Limitations of MIDI
MIDI message types
MIDI H/S
MIDI application
2
What is MIDI?
Some Clarification:
MIDI doesn’t directly describe musical sound
MIDI is not a language
It is a data communications protocol
The MIDI protocol — lets synthesizers, computers and other
devices talk to each other.
MIDI is a technical standard that describes a communications
protocol, digital interface, and electrical connectors and allows a wide
variety of electronic musical instruments, computers and other related music
and audio devices to connect and communicate with one another. A single
MIDI link can carry up to sixteen channels of information, each of which can
be routed to a separate device.
3
MIDI Channels
5
What is MIDI?
MIDI carries event messages that specify pitch,
notation and velocity (loudness or softness), control signals
for parameters such as volume, vibrato, audio panning from left to
right, cues in theatre, and clock signals that set and
synchronize tempo between multiple devices. These messages are sent
via a MIDI cable to other devices where they control sound generation
and other features. A simple example of a MIDI setup is the use of a
MIDI controller such as an electronic musical keyboard to trigger sounds
created by a sound module, which is in turn plugged into a keyboard
amplifier. This MIDI data can also be recorded into a hardware or
software device called a sequencer, which can be used to edit the data
and to play it back at a later time.
Advantages of MIDI include small file size, ease of modification and
manipulation and a wide choice of electronic instruments
and synthesizer or digitally-sampled sounds.
6
What is MIDI?
IN
OUT
IN
OUT
Audio
MIDI
USB
7
MIDI Benefits
9
MIDI Ports
Serial transfer, data are sent bit by bit
Hence:
- transmission rate is slow at only 31,250 bits/sec.
- Too slow to transmit samples in real-time
- have to do off-line sample dump
10
MIDI Interface
MIDI cables connect instruments by means of MIDI IN, MIDI OUT, and
MIDI THRU jacks.
MIDI In
The MIDI IN port receives incoming MIDI messages.
MIDI Out
MIDI OUT port transmits actions of the keyboard to other keyboards or a
computer.
A common error for MIDI setup is: inverted connection of MIDI IN/OUT
MIDI Thru
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.
11
Connecting Devices Using MIDI Thru
IN
OUT
IN
IN THRU
THRU
13
Limitations of MIDI
phone
14
Limitations of MIDI
Solution:
users have to judge by ear, to see which sound is
good
Standardized with General MIDI (GM)
(discussed later)
15
Limitations of MIDI
size of 40MB
size of 40kb
16
MIDI Transmission Protocol
MST
1 0 LST
17
Structure of MIDI messages
MIDI message includes a status byte and up to
two data bytes.
Status byte
The most significant bit of status byte is set
to 1.
The 4 low-order bits identify which channel it
18
MIDI message types
MIDI Messages
Channel
Mode
Voice
System
Real Time
Common
System Exclusive
19
MIDI Messages
Channel messages are those that are transmitted on
individual channels rather that globally to all devices in the
MIDI network.
System messages are not Channel specific, and no
Channel number is indicated in their status bytes.
Channel Messages may be further classified as being either
Channel Voice Messages, or Mode Messages.
Channel Voice Messages carry musical performance data,
and these messages comprise most of the traffic in a typical
MIDI data stream.
Channel Mode messages affect the way a receiving
instrument will respond to the Channel Voice messages.
20
MIDI message types:
Channel voice messages
• Note on
• Note off
• Program change (patch change)
• Pitch bend
• Controller change
• Polyphonic pressure (aftertouch)
• Monophonic pressure (aftertouch)
21
MIDI message types:
Channel voice messages
a. Note On
A note-on message is created when pressing a key (or
pad). To start a note, with particular pitch and
velocity, on a particular channel.
1 0 0 1 c c c c
1001 means “note on”.
cccc is the binary representation of the
message channel
22
MIDI message types:
Channel voice messages
a. Note On
2nd byte: Pitch Data byte
0 d d d d d d d
0 means “it is a data byte”
ddddddd is the binary representation of the pitch.
(decimal 0-127).
A particular MIDI note number does not designate
a particular pitch.
But most commonly, for example, for GM, 60 =
Middle C (C4), then 59 = B just below middle C
(B3), 62 = D just above middle C (D4).
23
MIDI message types:
Channel voice messages
a. Note On
3rd byte: Velocity Data byte
0 v v v v v v v
vvvvvvv is the binary representation of velocity
(loudness) of the note (decimal 0-127).
The velocity value does not specify a particular
loudness. It depends on velocity map of the
synthesizer/sampler, but 0 is typically silence and 127
is typically loudest.
24
MIDI message types:
Channel voice messages
b. Note Off
a note-off message is created upon release.
To end a note, with particular pitch, on a particular channel
Its structure is very similar to Note On, except that the 1st
byte (status byte) is 1000cccc.
2nd and 3rd byte remain as it is in Note On.
Note off message will stop a presently playing note of the
same pitch.
The velocity data byte of note off, however, does not mean
“to end a note with a particular velocity”.
It describes how to release a note instead.
For example, end velocity = 127, means to release the note
immediately. End velocity = 0 means to die away slowly.
“End velocity” is not implemented on many synthesizers
25
MIDI message types:
Channel voice messages
Aftertouch: Some MIDI keyboard instruments have the ability to
sense the amount of pressure which is being applied to the keys
while they are depressed. This pressure information, commonly
called "aftertouch", may be used to control some aspects of the
sound produced by the synthesizer (vibrato, for example). If the
keyboard has a pressure sensor for each key, then the resulting
"polyphonic aftertouch" information would be sent in the form of
Polyphonic Key Pressure messages. These messages include separate
data bytes for key number and pressure amount. It is currently more
common for keyboard instruments to sense only a single pressure level
for the entire keyboard. This "Channel aftertouch" information is sent
using the Channel Pressure message, which needs only one data byte
to specify the pressure value.
26
MIDI message types:
Channel voice messages
Pitch Bend: The Pitch Bend Change message is designed to produce a
change in pitch in response to the movement of a pitch bend wheel or
lever. The pitch bend information is used to modify the pitch of
sounds being played on a given Channel. The Pitch Bend
message includes two data bytes to specify the pitch bend
value. Two bytes are required to allow fine enough resolution to make
pitch changes resulting from movement of the pitch bend wheel seem to
occur in a continuous manner rather than in steps.
Program Change: The Program Change message is used to specify the
type of instrument which should be used to play sounds on a given
Channel. This message needs only one data byte which specifies
the new program number.
27
MIDI message types:
Channel voice messages
Control Change: MIDI Control Change messages are used to
control a wide variety of functions in a synthesizer. Control
Change messages, like other MIDI Channel messages, should only affect
the Channel number indicated in the status byte. The Control Change
status byte is followed by one data byte indicating the "controller
number", and a second byte which specifies the "control value". The
controller number identifies which function of the synthesizer is to be
controlled by the message. A complete list of assigned controllers is
found in the MIDI 1.0 Detailed Specification.
28
Channel voice messages
29
MIDI message types:
System messages
System Common Messages provide some standardized features that
are used for controlling the playback of songs in MIDI format and some
other miscellaneous features.
System-common messages are a hodge-podge of messages that are used
for purposes other than controlling MIDI voices and channels. All System-
common messages have the first nibble of the first byte equal to F (i.e.,
1111).
30
MIDI message types:
System messages
System Real Time Messages provide some MIDI features for
synchronizing the internal timing clocks of connected MIDI devices and
for controlling the playback of sequences/songs in MIDI format.
The System Real Time messages are the Timing Clock, Start, Continue,
Stop, Active Sensing, and the System Reset message. The Timing Clock
message is the master clock which sets the tempo for playback of a
sequence. The Start, Continue, and Stop messages are used to control
playback of the sequence.
System Exclusive (SysEx) Messages are generally longer MIDI
messages that are used for a variety of purposes. One of the primary
purposes of the SysEx message is to send manufacturer-specific data to
a MIDI synthesizer. Manufacturer-specific data can be used for
describing configuration data, sounds samples or timbre, or could
provide other specialized command-extensions to a MIDI device.
31
System messages
32
System messages
33
Applications of MIDI
1. Studio Production
recording, playback, cut-and-splice editing
2. Making score
with score editing software, MIDI is excellent in
making score
some MIDI software provide function of auto
4. Commercial products
mobile phone ring tones, music box music…..
5. Musical Analysis
MIDI has detailed parameters for every input
note
It is useful for doing research
35