The MIDI Standard 1
Overview ● What is MIDI? Brief history of MIDI ● ● How does MIDI work? ● Short Example ● MIDI Files and Connections Timing Issues ● ● Advantages and Disadvantages 2
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 3 https://store.djtechtools.com/products/midi-fighter-64
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 4
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 them ● 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. 5
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 ● 6 From 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 device) 7 http://properlydone.org/MidiTheory/midi/midi_messages.htm
Some Important MIDI messages ● NoteOn - 0x9M 0xNN 0xNN Plays a note with specific pitch and attack (volume) ○ M - channel select bits N - depends on input ● 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) 8
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 9 http://global.oup.com/us/companion.websites/fdscontent/uscompanion/us/static/companion.websites/9780199922963/Chapter7.html
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. 10
Example MIDI Sequence Status Data1 - Pitch Data2 - Attack 11 Example from http://www.music-software-development.com/midi-tutorial.html
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 12
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 MIDI ○ controller Thru: output signal that provides ○ copy of the MIDI in (daisy chaining) Out: provides output to another ○ MIDI device, perhaps a synthesizer Image sources: https://www.amazon.com/Monoprice-108532-Cable-Plugs-2-Pack/dp/B009G UP5SW, MIDI 1.0 Specification 13
14 MIDI 1.0 Specification
15 https://whitefiles.org/b1_s/1_free_guides/fg1mt/pgs/h15g.htm
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 ○ http://expressiveness.org/2012/12/04/midi-jitter 16
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) 17
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 ● https://blog.etcconnect.com/2017/03/midi-show-control-midi-note/ 18
Advantages/Disadvantages 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 section Disadvantages: ● 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 ○ ● Can’t store vocals - still an audio file 19
Conclusion ● 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 20
Further reading ● The MIDI 1.0 Specification: https://www.midi.org/specifications-old/category/midi-1-0-detailed-specification s ○ Requires a free account to download Summary of MIDI Messages: ● https://www.midi.org/specifications-old/item/table-1-summary-of-midi-message 21
Questions? 22
Recommend
More recommend