Musical Instrument Digital Interface
MIDI Basics First introduced in 1983
MIDI Basics First introduced in 1983 MIDI isn’t hardware or software
MIDI Basics First introduced in 1983 MIDI isn’t hardware or software It’s a universal “digital language” and means of communication for music technology
MIDI Basics MIDI consists of performance information—like print music
MIDI Basics MIDI is completely independent of the audio circuitry—it’s not sound. L R AUDIO IN OUT THRU MIDI Note On; Note Number; Velocity; Note Off
MIDI Basics: A Musical Interface Early synthesisers were often modular designs Sounds were built up by patching together several separate processing blocks To get a really big sound, you could patch together more than one synthesiser To do this, the signals generated by the keyboard must control more than one instrument In digital synthesizers, it is done using the Musical Instrument Digital Interface (MIDI)
MIDI MIDI doesn’t transmit digital audio. What it does transmit is the basic information supplied by the performer: What keys are pressed/released, and when What pedals are pressed etc.
MIDI devices communicate using messages… Note on Note off Program change Pitch bend Controller change Pressure (polyphonic) Pressure (monophonic)
MIDI Specification – The Techie Bit Physically MIDI is: A simplex asynchronous serial interface Simplex – data only flows in one direction, from transmitter to receiver Serial – bits of data are transmitted one at a time in series (rather than all at once in parallel) Asynchronous – the duration of each bit is fixed (32 µs for MIDI). Both the transmitter and receiver need a separate accurate clock to measure this duration. No clock signal is transmitted so only a single pair of wires is needed. Baud rate = bits/second Data is transmitted in 8-bit packets with one start bit, one stop bit and no parity.
Digital Serial Communications time LSBMSB Start bit (always 0) Stop bit (always 1) Data bits 320 s 1010 Eg. To transmit (105) 10 = ( ) 2 Start bit Stop bit Start bit detected 48 µs µs
MIDI Connections Most MIDI devices have three sockets: MIDI In: Receives MIDI information MIDI Out: Transmits MIDI information MIDI Thru: Repeats exactly the ‘MIDI In’ signal Using the ‘Thru’ socket, more than one instrument can be controlled by a single MIDI output: INOUTTHRUINOUTTHRUINOUTTHRU ABC
MIDI Connections MIDI Ports IN OUT THRU IN IN – Receives MIDI information OUT OUT – Transmits MIDI information THRU THRU – Passes along MIDI information To next MIDI IN
MIDI Connections MIDI Cable A cable with a 5-pin DIN connector on each end.
MIDI Connections MIDI “Master” instrument The instrument that sends information Master IN OUT THRU Slave IN OUT THRU MIDI “Slave” instrument The instrument that receives information
Computers & MIDI Connecting a MIDI Interface IN OUT
Computers & MIDI MIDI Interface A device that is used to connect a computer to a MIDI system Provides the MIDI IN and OUT ports for connection to a MIDI device Translates MIDI data into a computer’s own machine language
Multi-port MIDI Interface (2 in/out pairs) IN A B OUT A B USB port Thru switch – connects In to Out, for use without a computer Leave in ‘out’ position! Lights!
Multi-port MIDI Interface (8 in/out pairs) Front Back MIDI OutputsMIDI Inputs USB port Each MIDI cable can carry 16 channels.
Computers & MIDI MIDI Devices with USB Ports Allows MIDI keyboards and sound modules to be directly connected to a computer Eliminates need for a MIDI interface
How it Works
MIDI Messages All that the physical MIDI interface does is allow the transmission and reception of 8-bit numbers To play music, a language or protocol is needed to make sense of the numbers MIDI uses messages consisting of one or more bytes Most messages use 2 or 3 bytes in this format: Status ByteData Byte 1Data Byte Message Type Channel No.Data 1 (0-127)Data 2 (0-127)
Status Bytes and MIDI Channels All MIDI messages begin with a status byte The most significant bit of a status byte is always ‘1’, for any other byte, it is ‘0’ Bits 4,5 and 6 of the status byte indicate the message type (giving eight possible messages) The lowest 4 bits hold the channel number MIDI devices can be set to only respond to a particular channel number, allowing up to 16 instruments to be independently controlled from a single MIDI output Status ByteData Byte 1Data Byte Message Type Channel No.Data 1 (0-127)Data 2 (0-127)
Message Types Data System Message 111 MSByteLSByte Pitch Bend 110 (not used)Pressure Channel Aftertouch 101 (not used) Program Number Program Change 100 Value Controller Number Control Change 011 PressureNote Number Polyphonic Aftertouch 010 VelocityNote Number Note On 001 VelocityNote Number Note Off 000 Data Byte 2Data Byte 1Message TypeMessage bits
Note On/Off When a key is pressed, a note-on message is transmitted When a key is released, a note-off message is transmitted C3 60 D3 62 E3 64 F3 65 G3 67 A4 69 B4 71 A#4 70 G#3 68 F#3 66 D#3 63 C#3 61 C2 48 D2 50 E2 52 F2 53 G2 55 A3 57 B3 59 A#3 58 G#2 56 F#2 54 D#2 51 C#2 49 Status ByteData Byte 1Data Byte Off/On Channel No.Note Number (0-127)Velocity (0-127) 000/1
Example No key pressed ActionMIDI messageMIDI Output NothingIdle F3 releasedNote Off, F3, Velocity= , , (128, 65, 55) F3 pressedNote On, F3, Velocity= , , (144, 65, 100) F3 HeldNothingIdle
Control Change Other than the keyboard, several other controls affect the sound e.g. the volume knob, sustain pedal, modulation wheel etc. When any of these controls are adjusted, the new value is transmitted using a control change message. Controller number identifies the control to be altered (e.g. 1 = modulation, 7 = volume) The value can be either: A number between 0 and 127 for continuous controllers Either 0 or 127 indicating ‘off’ and ‘on’ for switches Status ByteData Byte 1Data Byte Channel No.Controller Number (0-127)Value (0-127) 011
Program Change Most electronic instruments are capable of producing a variety of sounds Different sounds are stored in memory and are known as programs (or patches, voices etc.) To select a different sound, a program change message is transmitted Note, this is only a two-byte message Status ByteData Byte 1 1 0Channel No.Program Number (0-127) 100
Other Messages Aftertouch Polyphonic Aftertouch When a key is held down, pressure sensors can detect how hard it is pressed – this is known as aftertouch Channel Aftertouch Polyphonic aftertouch keyboards measure the pressure for every key. Cheaper keyboards measure the average pressure for the whole keyboard – channel aftertouch. Pitch Bend A special controller that subtly changes the pitch of all notes played on a channel System Messages Various system specific message relating to timing and used for reprogramming synthesisers
Early Applications In the early days of MIDI, most instruments had limited polyphony and could only play one voice (patch/program) at a time Using more than one instrument and MIDI connections, performers could: Build up more complex sounds by mixing multiple voices Create keyboard splits and cross-fades Control synthesisers with different devices (e.g. MIDI pedals, guitars, clarinets, violins etc.)
Multi-Timbral Instruments INOUTTHRUINOUTTHRUINOUTTHRU MasterChannel 1Channel 2 INOUTTHRU Channel 3 Etc. (i) (ii) INOUTTHRU Master Synthesiser Channel 1 Synthesiser Channel 2 Synthesiser Channel 3 Etc. Single Multi- timbral synthesiser
General MIDI In the original MIDI specification, no assumptions were made about the instruments being used in terms of: Program number allocations Controllers Polyphony (how many notes can be played at once) A General MIDI synthesiser (e.g. all sound cards) meets the specification: Fixed program names and controllers 16-channel multi-timbrality 64-note polyphony Channel 10 reserved for drums
General Midi PC# Family 1-8 Piano Reed 9-16 Chromatic Percussion Pipe Organ Synth Lead Guitar Synth Pad Bass Synth Effects Strings Ethnic Ensemble Percussive Brass Sound Effects
MIDI, Digital Audio & Computers MIDI transmits performance information between instruments. It does not transmit digital audio Consequently, the bandwidth required is much smaller E.g. AES/EBU 44.1 kHz) – kbit/s MIDI – kbits/s General MIDI is an extension to the MIDI language, standardising various aspects MIDI is also an ideal way to interface computers with musical instruments…
Computers & MIDI MIDI Management Software (Mac OS X)
MIDI Management Software (XP)
Computers & MIDI Turning Local Control Off Disconnects an electronic keyboard from its internal sound generator This is necessary when using a software or dedicated sequencer
MIDI Basics MIDI Channels
MIDI Basics MIDI Channels There are 16 MIDI channels
MIDI Basics Multitimbral MIDI Instruments Instruments that can receive and play back MIDI information on more than one channel at a time
MIDI Basics Multitimbral MIDI Instruments Instruments that can receive and play back MIDI information on more than one channel at a time Typically 16 parts with each part assigned to a different MIDI channel
MIDI Basics Multitimbral MIDI Instruments Drums Ch. 10 Bass Ch. 1 Piano Ch. 2 Guitar Ch. 3 Sax Ch. 4
Benefits of Using MIDI
Small File Size
Benefits of Using MIDI Small File Size Tempo and pitch are completely independent of each other
Benefits of Using MIDI Small File Size Tempo and pitch are completely independent of each other Locate and cue sections or specific points using measures and beats
Benefits of Using MIDI Small File Size Tempo and pitch are completely independent of each other Locate and cue sections or specific points using measures and beats Performance and notation of a song
MIDI Applications Sequencing Records and plays back MIDI data
MIDI Applications Sequencing Records and plays back MIDI data A digital “player piano”
MIDI Applications Sequencing Records and plays back MIDI data A digital “player piano” Works similar to a multitrack recorder
MIDI Applications Sequencing Records and plays back MIDI data A digital “player piano” Works similar to a multitrack recorder May also include digital audio recording
MIDI Applications Notation Software Finale Sibelius
MIDI Applications Notation Software Finale Sibelius Accompaniment Software Band-in-a-Box
MIDI Applications Notation Software Finale (Finale NotePad – free download) Sibelius Accompaniment Software Band-in-a-Box Music Education Software Practica Musica Music Ace (MIDI & audio)
Audio & MIDI Compare and contrast Working together
Audio & MIDI MIDI Sequencing with Digital Audio Recording capabilities L R AUDIO IN OUT THRU MIDI Digital audio output Synth audio output Audio in Mixer
Audio MIDI USB A B IN OUT IN
Audio & MIDI USB Audio/MIDI Interfaces
Audio & MIDI MIDI Sequencing & Digital Audio Recording Audio in Virtual synth audio Digital audio output USB Cable for MIDI
Audio & MIDI Sampling/MIDI Keyboard Workstations Roland Fantom Series Multitimbral synthesizer Built-in MIDI sequencer Digital sampling with audio time-stretching
MIDI FILES Songtitle.mid Midi files come in several formats SMF 0: In MIDI format 0, all the separate tracks of the arrangement are mixed into a single track (mixdown). If the song is then loaded to a sequencer or notation program, it is impossible to tell which track is assigned to which instrument. SMF 1: Unlike in format 0, all the instrument tracks are shown separately, enabling editing and assignment of the corresponding voice/melody in the notation program. SMF 2: Midi format 2 is a somewhat rarer member of the SMF (Standard Midi File) family and is basically an enhancement of format 1. It distributes the various patterns to separate tracks.
MIDI Sites! You can download MIDI files and use them for a variety of applications: Listening pleasure! Create and arrangement for your ensemble Get printed music versions of songs you like Manipulate the MIDI file to make great sounding mixes. You can download your favorite Britney Spears Song!
MIDI Files The problem with MIDI is that the files often sound a bit too lame! However New Technology has begun to address this problem
Smart Music and MIDI Smart Music Software has upgraded the use of the general MIDI file sound and has begun to integrate the use of audio samples for patches. Humanistic elements of performance have also been added: fluctuations in time, inflection, dynamics, etc.
MIDI Done