Download presentation
Presentation is loading. Please wait.
Published byClare French Modified over 8 years ago
2
MIDI Musical Instrument Digital Interface
3
Musical sound can be generated, unlike other types of sounds. The Musical Instrument Digital Interface standard has been developed – The standard emerged in its final form in August 1982 –A music description language in binary form A given piece of music is represented by a sequence of numbers that specify how the musical instruments are to be played at different time instances. MIDI is not a language, it does directly describe all musical sounds MIDI is a MIDI is a data communications protocol that describes a means for music systems and related equipment to exchange information and control signals What is MIDI? MIDI stands for Musical Instrument Digital Interface MIDI stands for Musical Instrument Digital Interface
4
Midi versus digital audio MIDI files are much more compact than digital audio files. The size of a MIDI file is completely independent of playback quality. In general, MIDI files will be 200 to 1,000 times smaller than CD-quality digital audio files. For example: MIDI 21KB, 2min 36s Digital Audio 612KB, 56s Because MIDI files are small, they don’t take up as much RAM, disk space, and CPU resources. Which one is a live recording and which one is computer generated? Can you tell the difference? One Two
5
Disadvantages of using MIDI files You can’t be certain that playback will be accurate if the MIDI playback device is not identical to the device used for production. Does not produce high-quality vocals Even with the General MIDI standard the sound of a MIDI instruments varies according to the electronics of the playback device and the sound generation method it uses. Also, MIDI cannot easily be used to play back spoken dialog.
6
Because they are small, MIDI files embedded in Web pages. When loaded, MIDI files play more quickly than their digital equivalents. Midi files are editable, thus it can be used in the application where it might be needed to change the length of the file without changing the quality of the audio quality. Digital audio wont work because you don’t have enough RAM, hard disk space, CPU processing power, or bandwidth. don’t need spoken dialog. Where to use Midi
7
Midi Audio: Requirements To make MIDI score, we need: 1. Midi keyboard / Midi keyboard software 2. Sequencer software 3. Sound synthesizer (built-in in to sound card)
8
Midi Keyboard MIDI keyboard is used to simplify the creation of music scores (MIDI information) MIDI information is transmitted in "MIDI messages", which can be thought of as instructions which tell a music synthesizer how to play a piece of music. The synthesizer receiving the MIDI data must generate the actual sounds.
9
Midi Sequencer A MIDI sequencer software lets us to record and edit MIDI data like a word processor Cut and paste Insert / delete
10
Sound synthesizer Generates sound from scratch Generates sound from scratch Method: Method: 1. Wavetable/direct synthesis. store the series of numbers the represent the amplitude values of a waveform, at each sample interval, then recall the stored value to produce sound store the series of numbers the represent the amplitude values of a waveform, at each sample interval, then recall the stored value to produce sound 2. frequency modulation (FM) synthesis Simple waveforms change the frequencies of other simple waveform, produce a new waveform. Simple waveforms change the frequencies of other simple waveform, produce a new waveform. 3. additive synthesis add together a number of harmonics at different frequency add together a number of harmonics at different frequency 4. subtractive synthesis starts with a waveform that is already rich in harmonics, then filter out unwanted harmonics to produce a desired sound starts with a waveform that is already rich in harmonics, then filter out unwanted harmonics to produce a desired sound 5, phase distortion a simple waveform is altered to produce a more complex one a simple waveform is altered to produce a more complex one
11
Midi Audio Facts Since they are small, MIDI files embedded in web pages load and play. Length of a MIDI file can be changed without affecting the pitch of the music or degrading audio quality. Working with MIDI requires knowledge of music theory.
12
MIDI Components
13
MIDI Data Describes –Start/end of a score –Intensity –Instrument –Basis frequency –.... Header Chunk Track Header Track Chunk Track Header Track Chunk Track 1Track 2 Status Byte Data Bytes Status Byte Data Bytes MIDI File Organization Actual Music Data
14
MIDI Data MIDI standard specifies 16 channels –A MIDI device is mapped onto one channel E.g. MIDI Guitar controller, MIDI wind machine, Drum machine. –128 instruments are identified by the MIDI standard Electric grand piano (2) Telephone ring (124) Helicopter (125) Applause (126) Gunshot (127)
15
MIDI Transmission Protocol Each message begin with ONE start bit (logical 0) Each message begin with ONE start bit (logical 0) Then followed by EIGHT message bits Then followed by EIGHT message bits End with ONE stop bit (logical 1) End with ONE stop bit (logical 1) Each 8-bit MIDI message byte, specifies either a status value, or data value Each 8-bit MIDI message byte, specifies either a status value, or data value 10 LST MST
16
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)
17
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 (2 7 )
18
MIDI message types channel voice messages Carries the MUSICAL COMPONENT of a piece Carries the MUSICAL COMPONENT of a piece usually has 2 types: usually has 2 types: i. status byte: i. status byte: the first 4 most significant bits identify the message type, the first 4 most significant bits identify the message type, the 4 least significant bits identify which channel is to be affected the 4 least significant bits identify which channel is to be affected ii. data byte: ii. data byte: the most significant bit is 0, indicating a data byte. the most significant bit is 0, indicating a data byte. The rest are data bits The rest are data bits 0ddddddd mmmmcccc
19
1st byte: Status byte 1st byte: Status byte 1001 means “note on”, 1001 means “note on”, cccc is the binary representation of the message channel cccc is the binary representation of the message channel MIDI message types: Note On Note On To start a note, with particular pitch and velocity, on a particular channel To start a note, with particular pitch and velocity, on a particular channel 1001cccc
20
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
22
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
23
MIDI message types: channel voice messages Note On Note On 2nd byte: Pitch Data byte 2nd byte: Pitch Data byte 0 means “it is a data byte” 0 means “it is a data byte” ddddddd is the binary representation of the pitch. (decimal 0-127). ddddddd is the binary representation of the pitch. (decimal 0-127). A particular MIDI note number does not designate a particular pitch. A particular MIDI note number does not designate a particular pitch. But most commonly, for example, for GM, 60 = Middle C (C4), then 59 = B just below middle C (B3), 62 = D just above middle C (D4). But most commonly, for example, for GM, 60 = Middle C (C4), then 59 = B just below middle C (B3), 62 = D just above middle C (D4). 0ddddddd
25
MIDI message types a. Note On 3rd byte: Velocity Data byte 3rd byte: Velocity Data byte vvvvvvv is the binary representation of velocity (loudness) of the note (decimal 0-127). vvvvvvv is the binary representation of velocity (loudness) of the note (decimal 0-127). The velocity value does not specify a particular loudness. It depends on velocity map of the synthesizer/sampler, but 0 is typically silence and 127 is typically loudest. The velocity value does not specify a particular loudness. It depends on velocity map of the synthesizer/sampler, but 0 is typically silence and 127 is typically loudest. 0vvvvvvv
26
MIDI message types: b. Note Off To end a note, with particular pitch, on a particular channel To end a note, with particular pitch, on a particular channel Its structure is very similar to Note On, except that the 1st byte (status byte) is 1000cccc. Its structure is very similar to Note On, except that the 1st byte (status byte) is 1000cccc. Note off message will stop a presently playing note of the same pitch. Note off message will stop a presently playing note of the same pitch. The velocity data byte of note off, however, does not mean “to end a note with a particular velocity”. The velocity data byte of note off, however, does not mean “to end a note with a particular velocity”. It describes how to release a note instead. It describes how to release a note instead. For example, end velocity = 127, means to release the note immediately. End velocity = 0 means to die away slowly. For example, end velocity = 127, means to release the note immediately. End velocity = 0 means to die away slowly. “End velocity” is not implemented on many synthesizers “End velocity” is not implemented on many synthesizers
27
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)
28
MIDI message types: channel voice messages Program Change Program Change Assign particular patch (instrument) to a channel Assign particular patch (instrument) to a channel Usually, synthesizers have assigned “program numbers” to each patch Usually, synthesizers have assigned “program numbers” to each patch The manufacturer decides how to assign which number to which patch (GM has a table to standardize this) The manufacturer decides how to assign which number to which patch (GM has a table to standardize this) 1st byte: Status byte 1100cccc 1st byte: Status byte 1100cccc 2nd byte: program number data byte 0ddddddd 2nd byte: program number data byte 0ddddddd
29
MIDI message types: c. Program Change Some synthesizer have less than 128 patches Some synthesizer have less than 128 patches They will ignore the program number assigned, which are too large They will ignore the program number assigned, which are too large Some synthesizers have more than 128 possible patches. Some synthesizers have more than 128 possible patches. User can use any of the 128 patches at the same time User can use any of the 128 patches at the same time But not more than that 128 patches at the same time But not more than that 128 patches at the same time They can choose a different setting by selecting a different BANK. They can choose a different setting by selecting a different BANK.
30
MIDI message types Control Change Control Change Assigns some effect to the sound in the channel Assigns some effect to the sound in the channel 1st byte: Status byte 1011cccc 1st byte: Status byte 1011cccc 2nd byte: control change type 0ddddddd 2nd byte: control change type 0ddddddd 3rd/4th byte: control change value 0ddddddd 3rd/4th byte: control change value 0ddddddd We can use a different controller hardware to input control changes We can use a different controller hardware to input control changes for example, modulation wheel, foot pedal for example, modulation wheel, foot pedal
31
MIDI message types: Pitch Bend Pitch Bend 1st byte: Status byte 1110cccc 1st byte: Status byte 1110cccc 2nd byte: pitch bend value 2nd byte: pitch bend value (least significant 7 bits) 0ddddddd 3nd byte: pitch bend value 3nd byte: pitch bend value (most significant 7 bits) 0ddddddd data bytes usually of have14 bits of resolution data bytes usually of have14 bits of resolution describes the pitch bend of a played note describes the pitch bend of a played note e.g. while playing a middle C note e.g. while playing a middle C note a Pitch bend message, of data “-100” will bend the middle C a bit downward, toward B The amount of bending, depends of different synthesizer settings The amount of bending, depends of different synthesizer settings
32
MIDI message types: System messages System messages affect the entire device, regardless of the channel. System messages affect the entire device, regardless of the channel. For system message: For system message: the most significant 4 bits are always 1111, the most significant 4 bits are always 1111, the least significant 4 bits will identify the TYPE of the message. the least significant 4 bits will identify the TYPE of the message. Since system messages affect all channels. Since system messages affect all channels. (No need to use 4 bits to specify which channel is affected.) (No need to use 4 bits to specify which channel is affected.) 1111tttt t = type
33
MIDI message types: System messages 1. real-time system messages co-ordinate and synchronize the timing of clock-based MIDI devices co-ordinate and synchronize the timing of clock-based MIDI devices Usually sent at regular intervals, to ensure that every device in a MIDI system marches to the same beat Usually sent at regular intervals, to ensure that every device in a MIDI system marches to the same beat
34
MIDI message types: System messages 1. real-time system messages a. Timing Clock 1st byte: Status byte 11111000 1st byte: Status byte 11111000 sent at regular intervals (e.g. 24 per quarter note for tpq( Threshold Planning Quality )=24) sent at regular intervals (e.g. 24 per quarter note for tpq( Threshold Planning Quality )=24) sent by master clock, to the other slave devices sent by master clock, to the other slave devices provides timing reference for the slave devices provides timing reference for the slave devices
35
MIDI message types: System messages 1. real-time system messages b. Start 1st byte: Status byte 11111010 1st byte: Status byte 11111010 Direct slave devices to start playback from time 0 Direct slave devices to start playback from time 0 c. Stop 1st byte: Status byte 11111100 1st byte: Status byte 11111100 direct slave devices to stop playback direct slave devices to stop playback song position value doesn’t change song position value doesn’t change can restore the playback at the place where it stops with the “continue message” d. Continue 1st byte: Status byte 11111011 1st byte: Status byte 11111011 direct slave devices to start playback from the present “song position value” direct slave devices to start playback from the present “song position value”
36
MIDI message types: System messages 1. real-time system messages e. System Reset 1st byte: Status byte 11111111 1st byte: Status byte 11111111 devices will return the control value to default setting. devices will return the control value to default setting. e.g. reset MIDI mode / program number assigned to patch e.g. reset MIDI mode / program number assigned to patch
39
Audio File Formats MIDI *.MID, *.KAR, *.MIDI, *.SMF AUDIO DIGITAL WINDOWS *.WAV MACINTOSH *.AIFF UNIX *.AU REALAUDIO *.RA MPEG3 *.MP3
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.