the midi standard - eecs.umich.edu · what is midi? midi stands for musical instrument digital...

22
The MIDI Standard 1

Upload: lythien

Post on 27-Dec-2018

249 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: The MIDI Standard - eecs.umich.edu · What is MIDI? MIDI stands for Musical Instrument Digital Interface Standard that specifies the hardware interface and the data format of electronic

The MIDI Standard

1

Page 2: The MIDI Standard - eecs.umich.edu · What is MIDI? MIDI stands for Musical Instrument Digital Interface Standard that specifies the hardware interface and the data format of electronic

Overview

● What is MIDI?● Brief history of MIDI● How does MIDI work?● Short Example● MIDI Files and Connections● Timing Issues● Advantages and Disadvantages

2

Page 3: The MIDI Standard - eecs.umich.edu · What is MIDI? MIDI stands for Musical Instrument Digital Interface Standard that specifies the hardware interface and the data format of electronic

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

3https://store.djtechtools.com/products/midi-fighter-64

Page 4: The MIDI Standard - eecs.umich.edu · What is MIDI? MIDI stands for Musical Instrument Digital Interface Standard that specifies the hardware interface and the data format of electronic

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

Page 5: The MIDI Standard - eecs.umich.edu · What is MIDI? MIDI stands for Musical Instrument Digital Interface Standard that specifies the hardware interface and the data format of electronic

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

Page 6: The MIDI Standard - eecs.umich.edu · What is MIDI? MIDI stands for Musical Instrument Digital Interface Standard that specifies the hardware interface and the data format of electronic

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

6From MIDI 1.0 Specification

Page 7: The MIDI Standard - eecs.umich.edu · What is MIDI? MIDI stands for Musical Instrument Digital Interface Standard that specifies the hardware interface and the data format of electronic

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)

7http://properlydone.org/MidiTheory/midi/midi_messages.htm

Page 8: The MIDI Standard - eecs.umich.edu · What is MIDI? MIDI stands for Musical Instrument Digital Interface Standard that specifies the hardware interface and the data format of electronic

Some Important MIDI messages

● NoteOn - 0x9M 0xNN 0xNN○ Plays a note with specific pitch and attack (volume)

● 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

M - channel select bitsN - depends on input

Page 9: The MIDI Standard - eecs.umich.edu · What is MIDI? MIDI stands for Musical Instrument Digital Interface Standard that specifies the hardware interface and the data format of electronic

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

9http://global.oup.com/us/companion.websites/fdscontent/uscompanion/us/static/companion.websites/9780199922963/Chapter7.html

Page 10: The MIDI Standard - eecs.umich.edu · What is MIDI? MIDI stands for Musical Instrument Digital Interface Standard that specifies the hardware interface and the data format of electronic

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

Page 11: The MIDI Standard - eecs.umich.edu · What is MIDI? MIDI stands for Musical Instrument Digital Interface Standard that specifies the hardware interface and the data format of electronic

Example MIDI Sequence

Example from http://www.music-software-development.com/midi-tutorial.html

Status Data1 - Pitch Data2 - Attack

11

Page 12: The MIDI Standard - eecs.umich.edu · What is MIDI? MIDI stands for Musical Instrument Digital Interface Standard that specifies the hardware interface and the data format of electronic

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

Page 13: The MIDI Standard - eecs.umich.edu · What is MIDI? MIDI stands for Musical Instrument Digital Interface Standard that specifies the hardware interface and the data format of electronic

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 MIDIcontroller

○ Thru: output signal that providescopy of the MIDI in (daisy chaining)

○ Out: provides output to anotherMIDI device, perhaps a synthesizer

Image sources: https://www.amazon.com/Monoprice-108532-Cable-Plugs-2-Pack/dp/B009GUP5SW, MIDI 1.0 Specification

13

Page 14: The MIDI Standard - eecs.umich.edu · What is MIDI? MIDI stands for Musical Instrument Digital Interface Standard that specifies the hardware interface and the data format of electronic

14MIDI 1.0 Specification

Page 15: The MIDI Standard - eecs.umich.edu · What is MIDI? MIDI stands for Musical Instrument Digital Interface Standard that specifies the hardware interface and the data format of electronic

15https://whitefiles.org/b1_s/1_free_guides/fg1mt/pgs/h15g.htm

Page 16: The MIDI Standard - eecs.umich.edu · What is MIDI? MIDI stands for Musical Instrument Digital Interface Standard that specifies the hardware interface and the data format of electronic

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

16http://expressiveness.org/2012/12/04/midi-jitter

Page 17: The MIDI Standard - eecs.umich.edu · What is MIDI? MIDI stands for Musical Instrument Digital Interface Standard that specifies the hardware interface and the data format of electronic

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

Page 18: The MIDI Standard - eecs.umich.edu · What is MIDI? MIDI stands for Musical Instrument Digital Interface Standard that specifies the hardware interface and the data format of electronic

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

18https://blog.etcconnect.com/2017/03/midi-show-control-midi-note/

Page 19: The MIDI Standard - eecs.umich.edu · What is MIDI? MIDI stands for Musical Instrument Digital Interface Standard that specifies the hardware interface and the data format of electronic

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 sectionDisadvantages:● 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 file19

Page 20: The MIDI Standard - eecs.umich.edu · What is MIDI? MIDI stands for Musical Instrument Digital Interface Standard that specifies the hardware interface and the data format of electronic

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

Page 21: The MIDI Standard - eecs.umich.edu · What is MIDI? MIDI stands for Musical Instrument Digital Interface Standard that specifies the hardware interface and the data format of electronic

Further reading

● The MIDI 1.0 Specification: https://www.midi.org/specifications-old/category/midi-1-0-detailed-specifications

○ Requires a free account to download

● Summary of MIDI Messages: https://www.midi.org/specifications-old/item/table-1-summary-of-midi-message

21

Page 22: The MIDI Standard - eecs.umich.edu · What is MIDI? MIDI stands for Musical Instrument Digital Interface Standard that specifies the hardware interface and the data format of electronic

Questions?

22