Midi files Here we look at another way of dealing with sound on a computer the use of Midi files. The the Midi file differs from the “wav” file, because.

Slides:



Advertisements
Similar presentations
MUSC1010 – WEEK 4 MIDI. MIDI (Musical Instrument Digital Interface) MIDI is associated with cheap and nasty sounds due to the fact that most computer.
Advertisements

Tamara Berg Advanced Multimedia
Sound can make multimedia presentations dynamic and interesting.
4.1Different Audio Attributes 4.2Common Audio File Formats 4.3Balancing between File Size and Audio Quality 4.4Making Audio Elements Fit Our Needs.
Musical Instrument Digital Interface. MIDI Basics First introduced in 1983.
Int 2 Multimedia Revision. Digitised Sound Analogue sound recorded from person, or real instruments.
Chapter 1 Music Notation.
I Power Higher Computing Multimedia technology Audio.
SWE 423: Multimedia Systems Chapter 3: Audio Technology (2)
MIDI. Musical Instrument Digital Interface Specification for physically connecting different devices, and for communicating between them. Designed for.
EE2F2: Music Technology - Revision Two exam questions Music Recording Technology Mixing & multi-track recording Effects MIDI & Sequencers Virtual Studio.
Copyright © 2011 by Denny Lin1 Simple Synthesizer Part 4 Based on Floss Manuals (Pure Data) “Building a Simple Synthesizer” By Derek Holzer Slides by Denny.
1 Digital Audio Storage Formats. 2 Formats  There are many different formats for storing and communicating digital audio:  CD audio  Wav  Aiff  Au.
Musical Instrument Digital Interface. MIDI Musical Instrument Digital Interface Enables electronic musical instruments, such as keyboard controllers,
Music Technology & Associated Devices B.Sc. (Hons) Multimedia ComputingMedia Technologies.
Sound: Audio & Music B.Sc. (Hons) Multimedia ComputingMedia Technologies.
Spring 2002EECS150 - Lec13-proj Page 1 EECS150 - Digital Design Lecture 13 - Final Project Description March 7, 2002 John Wawrzynek.
Guitar Effects Processor Critical Design Review October, 07, 2003 Groups Members: Adam Bernstein Hosam Ghaith Jasenko Alagic Matthew Iyer Yousef Alyousef.
BY CHRIS ANDERSON Creating a MIDI Generator Program.
UFCEXR-20-1Multimedia Sound Production Basic Components for Sound Production.
ISE 582 Making Music (with MIDI) November 6, 2003 Arpi Mardirossian.
Music Processing Roger B. Dannenberg. Overview  Music Representation  MIDI and Synthesizers  Synthesis Techniques  Music Understanding.
EE2F2 - Music Technology 5. MIDI. A Musical Interface Early synthesisers were often modular designs Sounds were built up by patching together several.
UFCEXR-20-1Multimedia Sound Production An Introduction to Using Logic Studio.
Core 3: Communication Systems. Encoding and decoding analog and digital signals…  Encoding involves converting data from its original form into another.
Chapter 14 Recording and Editing Sound. Getting Started FAQs: − How does audio capability enhance my PC? − How does your PC record, store, and play digital.
Digital Audio Multimedia Systems (Module 1 Lesson 1)
V-Cert Music Technology
MIDI One choice for adding sounds to multimedia applications is the use of digital audio soundfiles This can become very memory intensive, however, for.
M I D I Musical Instrument Digital Interface The MIDI protocol — a “language” that lets synthesizers, computers and other devices talk to each other.
Welcome to The Music Jungle By Dean Smith And Cathy Ritter.
MIDI. A protocol that enables computers, synthesizers, keyboards, and other musical devices to communicate with each other. Instead of storing actual.
MIDI and YOU Orchestra in a Box. What is MIDI?  Musical Instrument Digital Interface  MIDI is a protocol - a standard by which two electronic instruments.
Use Cope-events which are like ( ) where element 1. is ontime in 1000s of second 2. is midi note (60 = middle C) 3. is duration in 1000s of.
TA212 The Technology of Music Steve Wells. Tutorial 4 TMA04 –cutoff date January 22nd Block 4 Part 1 –starts February 15th TA212 The Technology of Music.
Audio. Why Audio Essential tool for – Interface – Narrative – Setting & Mood.
Creating Soundtracks and more with GarageBand. Timeline Track HeaderTrack Mixer Transport Controls Instrument Fx & Loop Browser Time display/tuner Master.
AS LEVEL ICT2 Processing Different Types of Information.
AUDIO MEDIA 1 Created } “Borrowed” } Microphone MIDI keyboard CD’s & flash drives Internet Audio Sources 2.
Signal Digitization Analog vs Digital Signals An Analog Signal A Digital Signal What type of signal do we encounter in nature?
midi light show.
Creating Web Documents alt attribute Good and bad uses of ‘multimedia’ Sound files Homework: Discuss with me AND post announcement of Project II. Forms.
Multimedia Technology and Applications Chapter 2. Digital Audio
Chapter 15 Recording and Editing Sound. 2Practical PC 5 th Edition Chapter 15 Getting Started In this Chapter, you will learn: − How sound capability.
CMSCDHN1114/CMSCD1011 Introduction to Computer Audio
Sound element Week - 11.
Digital Audio IV MIDI Overview. Sending MIDI Information I. Serial Transmission A. Single cable to move data B. Slower than parallel, but is less expensive.
Audio / Sound INTRODUCTION TO MULTIMEDIA SYSTEMS Lect. No 3: AUDIO TECHNOLOGY.
MIDI Musical Instrument Digital Interface. MIDI A data communications protocol that describes a means for music systems and related equipment to exchange.
Virtual Instruments and Sequencing. Proses Pembuatan Lagu/Musik TrackingMixingMastering.
James Hornsby Connor Bradshaw 1168 Unit 1. Unit Unit  I will use Garageband because it has simple user interface, it is easy to use.
Theme: Multimedia Sound ProductionUFCFY Multimedia Sound Production.
Music Eleanor Selfridge-Field Automatic transcription of composition 18 th 18 th century: England, 1747 (Grove 1) 19 th century Horizontal.
From “Music” to MIDI Music 253/CS 275A Stanford University.
Processing Data. Representing Numbers  Recap on Binary Numbers  Binary digit (1 or 0) – known as a ‘bit’, short for BInary digiT – bits generally grouped.
Project Presentation Eoin Culhane Multi Channel Music Recognition for an Electric Guitar.
Multi Channel Music Recognition for an Electric Guitar.
Final Year Project Eoin Culhane. MIDI Guitar Guitar with 6 outputs 1 output for each string Each individual string output will be converted to MIDI.
MIDI. MIDI, which means: Musical Instrument Digital Interface, is a digital communications protocol. In August of 1983, music manufacturers agreed on.
Sequencing Systems & Techniques MIDI Setup. Learning Outcomes Define 2 or more examples of MIDI CC data and explain their purpose. Setup a computer and.
27656 (v1) Demonstrate and apply introductory knowledge of music technology equipment and techniques MUSIC Level 1Credits 4.
Music and Audio Computing I A Prof. Marcelo M. Wanderley Week 8.
MIDI Musical Instrument Digital Interface Musical sound can be generated, unlike other types of sounds. The Musical Instrument Digital Interface standard.
Understanding Midi Audio Processing Describe the Midi Audio Processing.
MIDI Musical Instrument Digital Interface A digital communication protocol allowing devices to send and/or respond to instructions.
Chapter 15 Recording and Editing Sound
Kai Hsu Kevin Nichols Peter Liang
Creating Simple Music By Keith Lynn
"Digital Media Primer" Yue-Ling Wong, Copyright (c)2013 by Pearson Education, Inc. All rights reserved.
The MIDI Standard A.
Presentation transcript:

Midi files Here we look at another way of dealing with sound on a computer the use of Midi files. The the Midi file differs from the “wav” file, because it does not usually contain any information about the sounds which are played, except for their name and possible allocation.

Midi files Usually the sound card in a computer contains a sound synthesiser. This can be played by an external keyboard or a Midi file. Before we look at how a Midi file is made up, let’s look at how Midi is used to connect and play musical instruments.

Midi Musical Instrument Digital Interface Originally devised to allow musical instruments to talk to each other. Predominately keyboard, but also wind, guitar, drums. Operates in real time along a serial interface similar to RS232.

Typical Midi setup (from Cakewalk Sonar 1 manual)

Midi Although the Midi standard allows transfer of audio sample data, Midi usually relies on the receiving instrument having some inbuilt sound generation ability. To play a tune in real time, Midi sends “note on” and “note off” code followed by the note number.

Channels A single Midi connection allows the a note to be played on one (or more) of sixteen different channels. The channel information is sent with the “note on” and the “note off” information.

Velocity Earlier I said that “note on” and “note off” messages are sent. This is a simplification. There is a data parameter called velocity which determines how “much” a note is on. In other words now loud it is. –Note on 9 –Note off 8 n is channel number kk is the key number vv is the velocity or value

Example Midi note sequences 90 3C 7F Key on (9) channel 1 (n=0) middle C (kk=3C) and full volume (vv = 7F (127)) 80 3C 7F Key off (8) channel 1 (n=0) middle C (kk=3C) and full volume (vv = 7F (127)) 90 3C 00 Key on (9) channel 1 (n=0) middle C (kk=3C) and zero volume (vv = 00) is same as note off.

Running status Do not need to keep sending status byte (9n) if it has not changed. So we could send –90 3C 7F 3C 00 –This would turn on middle C with full volume and then later turn it on with zero volume (that is, turn it off).

Patch changes Midi allows us to tell the sound device to change sounds The code to do this takes the form: –C n is the channel number. pp is the number of the new program (sound).

Controller Midi allows for other controls apart from the keyboard Pitch bend, modulation wheel. Controller codes take the form : –B n is channel number cc is controller number. v v is value.

Other Midi messages System exclusive. Setup dumps and requests. Sample dump and requests.

General Midi An agreement that certain instruments will appear on certain patch numbers. Arranged into families containing 8 instruments each (handy for hex codes). For example: –Acoustic piano Program 1 (pp=00) –Guitar Program 25 (pp=18 16 ) –Slap bass Program 37 (pp=24 16 )

Midi files When read by a suitable device the Midi file can play tunes on Midi equipped musical instruments through a Midi connection. On personal computers a Midi file may be used to play the internal sound synthesiser on the sound card without a physical Midi connection.

Midi files-How? Since the Midi file is intended to play Midi equipped instruments, it contains all the control codes mentioned above. That is “note on/off”, controller, patch change information etc.. However, the file’s organisation takes a prescribed form.

Midi files It works with chunks as the “wav” format did. Two types: –Header chunk “MThd” –Track chunk “MTrk” There is only one header chunk per file, but may be many track chunks.

Chunks All chunks have the following format: TypeLengthData 4 bytes Ascii 4 bytes“Length” bytes

Header chunks The file starts with a header chuck which contains the following: TypeLengthData MThd 6formattracksdivision “format” may be 0, 1, or 2. “tracks” is the total number of tracks to follow. “division” is timing information = pulses per quarter note.

Formats Format 0 –Has only one track Format 1 –May contain more than one track. The tracks play simultaneously. Format 2 –Can contain many tracks which can play independently. We will consider Format 1 mainly.

Format 1 track 1 Track 1 of a Format 1 midi file is also called “tempo map” Most important data in the “tempo map” are the meta events: Time Signature, and Set Tempo. Meta-events: Sequence/Track Name, Sequence Number, Marker, and SMTPE Offset should also be included.

Timing Time signature. Beats in a bar “set tempo” Sets how long in microseconds a crotchet is. “division” information (in header chunk). Number of pulses or “ticks” per quarter note (crotchet). The music timing is therefore dependant on both “division” and “set tempo”.

Time signature Time signature. FF nn dd cc bb nn/2^dd cc MIDI Clocks per metronome tick bb Number of 1/32 notes per 24 MIDI clocks (8 is standard)

a“Set tempo” Set Tempo FF tt tt tt In this case C0 16 = microseconds = 0.6 seconds per crotchet. Or 100 crotchets per minute.

Track chunks Start with the chunk type in Ascii “MTrk” TypeLengthData MTrk lengthdelta_timeevent delta_timeevent … Data consists of ( delta_time, event) pairs. length is the number of bytes in the data.

Track chunks delta_time is the time from the last event to this event measured in “ticks”. Variable length quantities –Way to avoid allocating too much space for variables. –A delta time could be 120 or –So it may take 1 byte or 4 bytes. –But we do not want to confuse it with other codes. –7 bits of a byte are used for data, but the MSB determines where the start of a variable length quantity is. It is set to the value one for the preceding bytes and is set to zero for the last byte.

Events Channel events, – the (notes on and off) and controller changes. Meta events –Information about the file like text, tempo, copyright, time signature. System exclusive events (sysex) –Information specific to manufactures machines. –Not considered here.

Some channel events Channel events, – the (notes on and off) and controller changes. Meta events –Information about the file like text, tempo, copyright, time signature. System exclusive events (sysex) –Information specific to manufactures machines. –Not considered here.

Some meta Events FF 01 –Text Event FF 03 –Sequence/Track Name FF 04 –Instrument Name FF 2F 00 –End of Track FF tt tt tt –Set Tempo FF nn dd cc bb –Time Signature

Exercises Determine: –The time signature of demo.mid. –The tempo of demo.mid Change the piano in Midi file demo to a guitar. Double the tempo by: –Altering the “division” value –Altering the “set tempo” value. Restore the tempo by altering the division value, but adjusting the “set tempo” value to compensate. Equally space the bass notes in time.

Useful links ansper/midi_introduction/cont ents.htmlhttp://crystal.apana.org.au/gh ansper/midi_introduction/cont ents.html

Matlab syntax for exercises. fid= fopen(‘ /demo.mid’) Look=hexdump(fid) –This closes file. fid= fopen(‘ /demo.mid’) A=fread(fid) A16=int16(A) A16( )=newvalue fidw=fopen(‘ /demomod.mi d’, ‘wb’) fwrite(fidw, A16) fclose(fidw)