school of informatics cg087 time-based multimedia assets mididr paul vickers1 midi introduction to...

31
MIDI Dr Paul Vickers 1 School of Informatics CG087 Time-based Multimedia Assets MIDI Introduction to the Musical Instrument Digital Interface

Upload: helen-norton

Post on 19-Dec-2015

219 views

Category:

Documents


0 download

TRANSCRIPT

MIDI Dr Paul Vickers 1

School of Informatics

CG087 Time-based Multimedia Assets

MIDI

Introduction to the Musical Instrument Digital Interface

MIDI Dr Paul Vickers 2

CG087 Time-based Multimedia AssetsSchool of Informatics

Happy birthday!

• Well, it’s 20 years old this year• Sigh. And I can remember the feature on Tomorrow’s

World when I first heard about it…

• Vince Clarke (Depeche Mode, Yazoo, Erasure) used to have 8 Casio CZ-101s and 1 BBC Model B Microcomputer connected by UMI-2B MIDIaudio stolen from Mad Jack’s page http://website.lineone.net/~mad.jack/

MIDI Sequence MIDI Sequence

MIDI Dr Paul Vickers 3

CG087 Time-based Multimedia AssetsSchool of Informatics

Myself?

• I had a BBC B and an Acorn Music 500 synth• It had no keyboard and was programmed

using its own programming language Ample

Music on this page stolen from Colin Fraser’s 500 page

http://www.colinfraser.com/m5000/m5000.htm

MIDI Dr Paul Vickers 4

CG087 Time-based Multimedia AssetsSchool of Informatics

Today?

• Roland D-20 (1990) Boss DS-330 (1993)• Oberheim MC-3000 (2000)

MIDI Dr Paul Vickers 5

CG087 Time-based Multimedia AssetsSchool of Informatics

So what is it?

• It’s a communications protocol• A music description language in binary form.• Each word describing an action of musical performance

is assigned a specific binary code.• MIDI was designed for keyboards, so many of the

actions are percussion oriented. • To sound a note in MIDI language you send a "Note On"

message, and then assign that note a "velocity", which determines how loud it plays.

• Other MIDI messages include selecting which instrument to play, mixing and panning sounds, and controlling various aspects of electronic musical instruments.

MIDI Dr Paul Vickers 6

CG087 Time-based Multimedia AssetsSchool of Informatics

History

• Early synths (1970s) were not designed with interconnectivity in mind.

• Connected via two control ports, one for pitch and note on/off events, and the other to provide a timing reference. – The first consisted of two signals: a variable DC

control voltage (CV), proportional to pitch; and a trigger pulse, or gate.

– The second port consisted of a pulse train synchronized with an external clock

MIDI Dr Paul Vickers 7

CG087 Time-based Multimedia AssetsSchool of Informatics

Drawbacks of CV

• Only one note at a time could be controlled– Newer polyphonic instruments suffered

• No agreement over external clock rate– Special conversion boxes were needed to over-

or under-sample the clock– Connecting multiple instruments, especially from

different manufacturers was complex and troublesome

MIDI Dr Paul Vickers 8

CG087 Time-based Multimedia AssetsSchool of Informatics

Advent of MIDI

• In 1983 Sequential Circuits, Roland Corporation, and Oberheim Electronics released MIDI 1.0

• MIDI spec. controlled by– MIDI Manufacturer's Association (MMA)– Japan MIDI Standards Committee

MIDI Dr Paul Vickers 9

CG087 Time-based Multimedia AssetsSchool of Informatics

The specification

• MIDI specifies– Hardware interface– Binary control language– MIDI file format

MIDI Dr Paul Vickers 10

CG087 Time-based Multimedia AssetsSchool of Informatics

MIDI hardware

• Bi-directional serial asynchronous link with data rate of 31,250 bits per second– 320s to transmit 10 bits (MIDI byte is 8 data bits

plus a start bit and a stop bit = 10 bits)– In 1s can transmit >3000 bytes

• Requires a 5-pin 180 DIN connector– Pins 1 & 3 not used– Pins 4 & 5 carry 5mA current loop– +5v = binary 0, 0v = binary 1

• Ports have opto-isolation to prevent interference

MIDI Dr Paul Vickers 11

CG087 Time-based Multimedia AssetsSchool of Informatics

Electrical specification

• Data converted byUART(universal asynchronous

receiver transmitter)• UART and

microprocessorcommunicatevia interrupts andbuffers

MIDI Dr Paul Vickers 12

CG087 Time-based Multimedia AssetsSchool of Informatics

Port requirements

• A MIDI device must have– MIDI-IN and MIDI-OUT – Optionally MIDI-THRU

• Thru port transmits a copy of data received on the IN port

MIDI Dr Paul Vickers 13

CG087 Time-based Multimedia AssetsSchool of Informatics

Connections 1 - synth to computer

From http://www.midipage.nl/uk_midi_aansl_1.html

MIDI Dr Paul Vickers 14

CG087 Time-based Multimedia AssetsSchool of Informatics

Connections 2 - more complex

• Daisy chain links shouldn’t exceed 3 devices due to transmission delays

MIDI Dr Paul Vickers 15

CG087 Time-based Multimedia AssetsSchool of Informatics

Connections 3 – star network

MIDI Dr Paul Vickers 16

CG087 Time-based Multimedia AssetsSchool of Informatics

MIDI bytes

• Two types of information– Status – Data

• Status messages generally indicate actions (e.g. pressing a key on the synth)

• Data bytes supply the information for the status byte (e.g. velocity of key press)

MIDI Dr Paul Vickers 17

CG087 Time-based Multimedia AssetsSchool of Informatics

MIDI message

• A MIDI message has one status byte followed by 0..n data bytes

• Status and data bytes are differentiated by bit 7

• Thus MIDI values go from 0..127 (27)

1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 Status

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

0 0/1 0/1 0/1 0/1 0/1 0/1 0/1 Data

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

MIDI Dr Paul Vickers 18

CG087 Time-based Multimedia AssetsSchool of Informatics

Channels

• If > 1 device connected, which one should respond to the messages?

• Messages are assigned to channels (16)• Devices set to respond to particular

channels• Every message (except system messages)

have a channel number which is stored in bits 0..3 of the status byte

Status Message type Channel (11)

1 x x x 1 0 1 1

Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0

MIDI Dr Paul Vickers 19

CG087 Time-based Multimedia AssetsSchool of Informatics

7 status messages

• 000 – Note off• 001 – Note on• 010 – Polyphonic key pressure• 011 – Control change• 100 – Program change• 101 – Channel pressure (aftertouch)• 110 – Pitch bend• Note on for channel 3 = 1 001 0010

MIDI Dr Paul Vickers 20

CG087 Time-based Multimedia AssetsSchool of Informatics

Example message

• Note on uses 3 bytes– Status byte– Data byte for note number– Data byte for velocity

• So, middle C (midi note no. 60) at medium volume (velocity 64) on channel 3 would be:– 10010011 (note on, channel 3)– 00111100 (data byte, value 60)– 01000000 (data byte, value 64)

MIDI Dr Paul Vickers 21

CG087 Time-based Multimedia AssetsSchool of Informatics

Other messages

• Other messages allow you– to select another timbre on the synthesiser

(program change)– Add pitch bend– Add sustain– Change volume– Etc.

MIDI Dr Paul Vickers 22

CG087 Time-based Multimedia AssetsSchool of Informatics

Not a sound format

• As it’s only a control language, it’s not a sound format

• MIDI merely allows devices to speak the same language

• A MIDI file is a sequence of note-on note-off messages to instruct a tone generator to play music

• The sound quality is totally depended on the quality of the synthesiser playing the file

MIDI Dr Paul Vickers 23

CG087 Time-based Multimedia AssetsSchool of Informatics

MIDI files

• Standard MIDI files (SMF) is a specification for storing MIDI data

• 3 types: 0, 1, and 2 which just differ in the way the data are stored

• MIDI files can be played by Windows Media Player (and others) and can be loaded and edited by MIDI sequencing software (word processors for MIDI!), e.g. Digital Orchestrator Pro

• MIDI files don’t contain sound

MIDI Dr Paul Vickers 24

CG087 Time-based Multimedia AssetsSchool of Informatics

Input & control

• MIDI input normally comes from a MIDI-equipped instrument– Synthesiser/digital piano, etc.– Guitar with MIDI converter– Wind instrument converters (yes)– CV-MIDI boxes for old synths– Even voice-MIDI converters

• Or from MIDI files• Or you create MIDI data using special

sequencer programs

MIDI Dr Paul Vickers 25

CG087 Time-based Multimedia AssetsSchool of Informatics

MIDI sequencing

• Sequencers originally were hardware devices that allowed you to store sequences of control voltages to control CV synthesisers

• Sequences were normally notes, but could be filter settings, gate controls, etc

• Then MIDI hardware sequencers were developed

• At the same time, people wrote software sequencers for Atari ST, Sinclair Spectrum, BBC Micro, Commodore Amiga

MIDI Dr Paul Vickers 26

CG087 Time-based Multimedia AssetsSchool of Informatics

MIDI sequencers

• Cubase and Cakewalk are the two most well-known and long serving programs

• Professional studios now use– ProTools (www.digidesign.com)– Cubase (www.steinberg.net)– Logic (www.emagic.de)– Reason (www.propellerhead.se)

MIDI Dr Paul Vickers 27

CG087 Time-based Multimedia AssetsSchool of Informatics

Sequencers

• A sequencer– Allows you to compose and store sequences of

MIDI data to create songs– Organises the data in tracks (like on a multi-track

tape recorder)– Has rich editing facilities (like a word processor)– Often prints music scores too

• Current sequencers now let you mix audio with the MIDI data (see next week)

MIDI Dr Paul Vickers 28

CG087 Time-based Multimedia AssetsSchool of Informatics

Limitations of MIDI

• Not sufficient for music scoring• Assumes a 12-tone chromatic framework

– What about just intonation?– Micro tuning?– Enharmonic distinctions (e.g. F sharp vs. G flat)

• No way to represent performance dynamics– E.g. crescendo, diminuendo, etc.

• Slow serial ports• 16 channel limit

MIDI Dr Paul Vickers 29

CG087 Time-based Multimedia AssetsSchool of Informatics

Things to do with MIDI

• Control one synth from another• Write and store music (sequencing)• Write your own MIDI programs• Sonify your own web pages (really!)

– See www.beatnik.com

• Combine MIDI with audio• Control effects boxes and light shows

– Yes, you can do this. My reverb unit accepts MIDI controls so my synth can turn on the unit’s echo

MIDI Dr Paul Vickers 30

CG087 Time-based Multimedia AssetsSchool of Informatics

Web sites

• www.midi.org (MIDI manufacturers’ association)

• www.midi.com • www.beatnik.com • Do some programming in CSound

– Boulanger, R., Ed. (2000). The CSound Book: Perspectives in Software Synthesis, Sound Design, Signal Processing, and Programming. London: The MIT Press

• http://www.csounds.com/

• http://music.dartmouth.edu/~dupras/wCsound/csoundpage.html

MIDI Dr Paul Vickers 31

CG087 Time-based Multimedia AssetsSchool of Informatics

More reading

• Braut, C. (1994). The Musician's Guide to MIDI Sybex. ISBN 0-7821-1285-4.

• Roads, C., Ed. (1998). The Computer Music Tutorial. Cambridge, Massachusetts: MIT Press. ISBN 0-262-68082-3.

• Kientzle, T. (1997). A Programmer's Guide to Sound. Reading, Massachusetts: Addison-Wesley. ISBN 0-201-41972-6.

• Selfridge-Field, E., Ed. (1997). Beyond MIDI: The Handbook of Musical Codes. Cambridge, Massachusetts: MIT Press. ISBN 0-262-19394-9.