The MIDI Protocol - Musical Instrument Digital Interface

BhaumikBhatt4 13,185 views 34 slides Feb 21, 2014
Slide 1
Slide 1 of 34
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34

About This Presentation

This presentation walks you through the basics of the MIDI protocol. An abbreviation for Musical Instrument Digital Interface, MIDI is an industry standard communications protocol used for electronic musical instruments and other stage, sound, control equipment, to talk to each other.


Slide Content

Audio Engineering

MIDI MIDI  ( Musical Instrument Digital Interface ); is an industry-standard protocol that enables electronic musical instruments and other equipment to communicate, control and synchronize with each other and to exchange system data Devices such as computers, synthesizers, keyboard controllers, sound cards, samplers and drum machines MIDI does not transmit an audio signal or media! The sounds are generated by the synthesizer , which receives the MIDI data

History By the end of the 1970s, devices from different manufacturers were generally incompatible with each other. At the control level, they had their own specific laws for defining voltage to pitch conversions Dave Smith proposed a digital standard for musical instruments at the Audio Engineering Society show in New York The MIDI Specification 1.0 was established in August 1983 The MIDI specification has been re‐released many times since, listing new features In 1990, the International MIDI Association changed its name to the MIDI Manufacturers Association, MMA

Interfacing

MIDI Ports MIDI-In Port allows data to be received by a MIDI-compliant device MIDI-Out Port is used for transmitting data MIDI-Thru Port  is used for linking a no. of MIDI devices with a single transmitter

MIDI Thru

New Interfacing methods

Networks A MIDI network is a combination of hardware and software that provides interconnectivity between a group of MIDI devices, such as synthesizers, controllers, and sequencers

Protocol MIDI is a serial stream of data Runs at 31250 bits per second baud rate Describes event information Asynchronous transmission A 'standard' MIDI word consists of three bytes: The first is a Status byte, the second and third are Data bytes All status bytes have their MSB set to 1 , whereas all data bytes have it set to

Messages MIDI messages commonly have at least one COMMAND\STATUS byte and may have zero or more DATA bytes Types of Messages: Channel Messages System Exclusive Messages System Common Messages System Real-Time Messages

Channel Messages Message Name Byte 1 Byte 2 Byte 3 Example Note Off 1000 cccc The MIDI key specifies the number of the key or note to release. The velocity specifies how quickly the note-release is affected. 83 3D 79 turns note 3D (decimal 61) on channel 3 off with a velocity of 79 (decimal 121). Note On 1001 cccc The MIDI key specifies the number of the key or note to turn on. The velocity specifies how quickly or forcefully the note is struck. 94 3D 79 turns note 3D (decimal 61) on channel 4 on with a velocity of 79 (decimal 121). Polyphonic Aftertouch 1010 cccc The MIDI key number. The key pressure value. A0 3D 5A changes the pressure for note 3D (decimal 61) on channel 0 to a value of 5A (decimal 90). Control Change 1011 cccc The controller number [0 - 119] The controller value [0 - 127] B3 10 7F sets the value of controller number 10 (decimal 16) to 7F (decimal 127). Program Change 1100cccc The new program (patch) number. -- n/a -- C3 44 changes the program number for MIDI channel 3 to 44 (decimal 68). Channel Pressure (Aftertouch) 1101 cccc The single greatest pressure value of all depressed keys. -- n/a -- D3 44 changes the channel-pressure for MIDI channel 3 to 44 (decimal 68). Pitch Wheel Change (Pitch Bend) 1110 cccc Least significant 7-bits of pitch-bend value. Most significant 7-bits of pitch-bend value. E1 70 37 sets the pitch-bend for channel 1 to a value of 03F8 (decimal 1016).

System Exclusive Messages System Exclusive 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 Each SysEx message begins with two data bytes F0 (1111 0000) and 0iiiiiii, where iiiiiii is a manufacturer's code and equipment only responds to messages with the correct manufacturer's code The SysEx message is terminated when the byte value F7 (1111 0111) is encountered

System Common Messages Message Name Byte 1 Byte 2 Byte 3 System Exclusive F0 (1111 0000) The manufacture's unique identifier. -- n/a -- Reserved F1 (1111 0001) -- n/a -- -- n/a -- Song Position Pointer F2 (1111 0010) Least significant 7-bits. Most significant 7-bits. Song Select F3 (1111 0011) The song or sequence to be played. -- n/a -- Reserved F4 (1111 0100) -- n/a -- -- n/a -- Reserved F5 (1111 0101) -- n/a -- -- n/a -- Tune Request F6 (1111 0110) -- n/a -- -- n/a -- System Exclusive END F7 (1111 0111) -- n/a -- -- n/a --

System Real-Time Messages Message Name Byte 1 Byte 2 Byte 3 Timing Clock F8 (1111 1000) -- n/a -- -- n/a -- Reserved F9 (1111 1001) -- n/a -- -- n/a -- Start FA (1111 1010) -- n/a -- -- n/a -- Continue FB (1111 1011) -- n/a -- -- n/a -- Stop FC (1111 1100) -- n/a -- -- n/a -- Reserved FD (1111 1101) -- n/a -- -- n/a -- Active Sensing FE (1111 1110) -- n/a -- -- n/a -- Reset FF (1111 1111) -- n/a -- -- n/a --

MIDI Controllers

Example 1. Note-On   message: 0x90 , 0x3C, 0x7F 2. Aftertouch message(s): 0xD3, 0x46 3. Note-Off message: 0x80, 0x3C, 0x46

Composition & File formats MIDI composition and arrangement typically takes place using either MIDI sequencing/editing software on computers or using specialized hardware music workstations MIDI data files are much smaller than recorded audio waveforms The SMF specification was developed and is being maintained by, the MIDI Manufacturers Association (MMA) Karaoke files display lyrics synchronized with the music in "follow-the-bouncing-ball" fashion, turning any PC into a karaoke machine

S ynthesizer A  synthesizer is an electronic musical instrument that uses one or more sound generators to create waveforms which are then processed and combined in order to generate musical sounds MIDI synthesizers produce musical tones and percussion based on the input of MIDI software messages

Sequencer A  music sequencer  is an application or a device designed to record and play back musical notation A MIDI sequencer is the electronic version of the musician in the MIDI world A MIDI sequencer: records MIDI software message sequences replays MIDI software sequences with the appropriate timing provides some sort of editing capabilities The terms " Music Sequencer " and " Digital Audio Workstation " are often used interchangeably

Sampler A  sampler  is an electronic musical instrument which plays back recordings (or “samples ") that are loaded or recorded onto it to perform or compose music

Software s amplers

MIDI Standards Patch Family Name Patch Family Name 1 - 8 Piano 65 - 72 Reed 9 - 16 Chromatic Percussion 73 - 80 Pipe 17 - 24 Organ 81 - 88 Synth Lead 25 - 32 Guitar 89- 96 Synth Pad 33 - 40 Bass 97 - 104 Synth Effects 41 - 48 Strings 105 - 112 Ethnic 49- 56 Ensemble 113 - 120 Percussive 57 - 64 Brass 121 - 128 Sound Effects

Musical Applications You can use a MIDI instrument with which you’re comfortable to play the sounds belonging to any other MIDI device. Create rich musical textures by layering sounds from multiple MIDI devices, or assign different sounds to play in different pitch ranges. When you play a MIDI instrument, it produces data that can be captured by a MIDI “sequencer.” Sequencers aren’t just MIDI recorders, they let you fix mistakes, change the pitches of your notes, fix their timing, the way they play, the sounds they use, and more.

ATMega128 μ C SW2 UART1 SW3 SW1 TX R X SW4 LED1 LED8 LED2 LED3 LED4 LED6 LED5 LED7 LCD PC

Sends 0x90, 0x24, 0x7F to PC SW2 ^ B UART1 SW3 SW1 TX R X SW4 LED1 LED8 LED2 LED3 LED4 LED6 LED5 LED7 LCD PC

Sends 0x91, 0x26, 0x7F to PC SW2 ^ BS UART1 SW3 SW1 TX R X SW4 LED1 LED8 LED2 LED3 LED4 LED6 LED5 LED7 LCD PC

Sends 0x92, 0x31, 0x7F to PC SW2 ^ BSC UART1 SW3 SW1 TX R X SW4 LED1 LED8 LED2 LED3 LED4 LED6 LED5 LED7 LCD PC

Sends 0x93, 0x2E, 0x7F to PC SW2 ^ BSCH UART1 SW3 SW1 TX R X SW4 LED1 LED8 LED2 LED3 LED4 LED6 LED5 LED7 LCD PC

Non-musical Applications Show control Machine control Theatre lighting Console automation Special effects Sound design Recording system synchronization Audio processor control Computer animation Computer networking Video Jockeys

We have come a long way...

References Webistes : Wikipedia ( http://en.wikipedia.org/ ) How stuff works ( http://www.howstuffworks.com/ ) MIDI Manufacturers Association ( http://www.midi.org/ ) MIDI Reference from IO.com( http://www.io.com/ ) Tonalsoft ( http:// www.tonalsoft.com/ ) Books and eBooks: eBook – MIDI and the AVR – AVRFreaks.com ( http://www.avrfreaks.com/ ) Audio Engineering: Know It All - Douglas Self Audio Electronics, Second edition - John Linsley Hood

Thank You Bhaumik Bhatt