Introduction to MIDI

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
that's why I can do this short introduction to meaty so professor Wong's idea is was that meaty is a good bridge between analysis and synthesis so let's look more into what MIDI is because it is a tool that is widely used in recording studios in music and music equipment so we should know about it what is media how many of you have heard of MIDI before not so many not so many okay okay so let's see exactly what MIDI is technically is a standard that describes three main components a protocol a digital interface and the connectors so this this is a digital interface that connects MIDI to USB to the PC and these are the cables with the five round five five pins round cables that we use to connect MIDI equipment so what is the purpose of meeting let's see why it was invented so a little bit of history in 1970s when the digital equipment started to appear they wanted digital synthesizers but each manufacturer created its own way of linking the input device which usually was a keyboard to the let's say electronic circuits that produced the sounds okay so they had each each have their own let's say standard so if you wanted to have in a recording studio like three or more synthesizers you could not control all of them you needed four separate keyboards and four separate players for that matter so it wasn't feasible enough you need one more only one keyboard with two hands to be able to control whatever you want so they wanted this kind of standard standardization of communication for that matter in 1983 the full midi 1.0 specification was released do you know what version of MIDI is being used today of MIDI protocol anybody knows not quite it's exactly 1.0 it's one of the oldest protocols that we use in computers because it was greatly designed so that it has support a lot of things were added on top of it but it had support in the first place so we don't need a second version of this so basically MIT is a standardized way of communication between scenes samplers or whatever musical equipment okay now let's see let's see what data flows through this protocol okay if you want to remember only one thing for your lecture and this then go home remember just this meat is not audio there's great confusion going up so media does not carry sound okay no digital sound up any type of type of sound it contains only messages it carries messages what type of messages we call them event messages because their messages produced at certain type of events let's see what kind of events the start of the note so I pressed a key on the keyboard that is an event I release the key that is another event I change knob on the keyboard so that I want to change some parameters remotely to that synthesizer there's another type of event and some special kind of come on don't tell me that you're okay some other controls and configuration messages special specifically designed to configure synthesizer this is less important so if if MIDI is based only some messages in events what is a MIDI file you use MIDI files right and you double clicked on them and you heard some sound but what is a MIDI file it's exactly just that recording the these event messages time stamping them and that is all that a MIDI file is so we can think of a MIDI recording as being an enhanced score because we have the exact dynamics of the music we have the pressure that we press on the keys quantified between 0 and 127 so it's even more exact that a score can tell us because we have only this like you piano pianissimo but this does not tell exact ok the MIDI specifies it in numbers then we have the exact times the timings of the notes when the notes started when the note ended and then we have a lot of other just wait a second because one software is bugging my head here don't laugh I'm still using this yahoo messenger old stuff so other information like the sustain pedal state the ones who play piano knows what a sustain pedal is ok can sustain the notes and so the sustain pedal whenever we change its state on two off that is recorded as well so everything that regards the player okay what he presses and what he does is recorded but not the sound so MIDI file does not contain the music we can think that it contains instructions to play the music we can save that way okay so if if it contains just instructions when we are in Windows and double click on that stuff why do we listen to it why can we hear some sounds well till it to be able to listen to a MIDI file we need a piece of software or hardware that is able to follow these instructions and play that instrument okay whether it's a synthesizer a sampler or a virtual instruments they follow these instructions now let's see what each of them mean well you know a lot of synthesizer is the synthesizer generates the sound for a given pitch using an algorithm so you say play me the e from the second octave at this intensity and then it generates the pitch using an algorithm like additive synthesis or subtractive synthesis whatever they use this is an example of software synthesizer and hardware one now let's see what a sampler is a sampler is a more more evolved type of thing it uses a piece of actually recorded audio that can be even I don't know a bark from a dog and you want it to have it on a scale so you recorded that bark of a dog you know or a piano key and then you apply pitch shift for you to be able to play it all across the keyboard okay and then to simulate let's say the intensity you you you the velocity that you press the key just adjust the volume so that is not quite a realistic realistic sound but it still it's better than trying to synthesize if you record for example piano key it's much better to use a sampler than to try to synthesize the piano key because it doesn't work as as good this is an example of a software sampler and hardware sampler well harder ones are not quite really used now now virtual instruments here lies the secret of MIDI because virtual instruments use actually pre-recorded notes from real instruments so you take a violin player and you say play me all the notes at different intensities you record-low all these okay you splice them up into wav files and then you just trigger with so with a keyboard you say play me the note at that intensity then you go search for the wav file of the actual recording and play that so it sounds very realistic this is an example of a very good drum virtual instrument software one and this is a drum module for electronic drums you connect the electronic drums to this thing and the electronic drums do just that they trigger this sound and all the sound are stored here in a memory okay and you have different type of effects to add or different types of sounds good so we've talked about the fact that media is about messages and to listen to it we need this kind of synthesizer or sampler whatever okay let's see let's look a little bit of what message types are exchanged over MIDI now I warn you you don't need to remember any of this it's just for you to understand how MIDI works you don't need to remember the names please don't write them on a paper because it's really boring I mean this doesn't make any sense so the most important type of message is called channel voice message this is the type of the message that contains all the notes flowing and all the thing that has to do with music playing okay so we will talk about that in detail and then I will just point the other ones out why is it called channel what MIDI supports 16 independent channels so you can send the notes to different channels what is that useful you can control 16 different synthesizers you can send notes to one then you change the channel sent to another one okay so let's see in like a use case for that if we have a keyboard we can output the MIDI data okay so what notes we play we can output that to one channel we can output it to all the channels or better if you have an more expensive keyboard we can split it up for example what we play with the left hand can go on channel 2 what we play with the right hand goes to channel 3 now on channel 2 we'll have a bass synthesizer on channel 3 we'll have pianos siser so we play two instruments at once okay and for the other part sound module now I will use for the rest I will use sound module this is like synthesizer or sampler or virtual instruments or whatever produces sound okay the sound modules can be set to listen to one channel or all the challengeable if we want so it's quite flexible we just need to address the each synthesizer the the correct way the correct channel so let's see what what type of what type of messages we have in this what messages we have in this type when a key is pressed note on event occurs so we need to inform that synthesizer with a couple of things a channel number so that the synthesizer know that it is for him or for anybody else then the note value the note value is represented in a number that the number of the semitone is encoded okay now the middle C on the piano is 60 C sharp is 61 and if you still remember for the last lecture you know the octave has 12 semitones so if we add 60 to 12 we get the next octave of C which is 72 so we encode all these octaves in numbers and then we send the velocity or how hard the key was pressed so encoded between 0 and 127 as well now this is just for the geeky ones want to know exactly the byte order so here we have a constant code which is 4 note on 1 1 0 0 1 then we send the channel number so 4 bits then the note value and the velocity value another type when we release the key a note off event occurs it contains the same thing though the velocity is not quite used in synthesizer you cannot model too much when you lift a key ok you don't have like sounds producing too much but for example for a black bass player when you lift your thumb of the string there is a noise so we can you can use that model but a wide variety does not take it ignores this information so this is this is the same just that the code changes from 1 0 0 0 this just for geeks ok now have you noticed on some keyboards there are these little wheels here that somebody uses when they play a solo okay they're called pitchman wheels and they can be used to go in between the pitches so if you want in between C and C sharp you can go with this wheel so whenever we change the position of that wheel an event occurs the event is called pitch Bend change so we need to know what channel what synthesizer we want that pitch to bend and the new pitch Bend value now this is encoded at 14 bits which gives us a very fine control okay we have like 16,000 possible values so it's very fine fine control now other keyboards have different type of knobs okay like this one that have no labels or anything they could they can be assigned to do something now whenever we change a control a control change event of course so we inform that synthesizer that we changed a control now we need to send of course the channel number to know what synthesizer the control number this is how we deal with the synthesizer so we say I will use con I will send you on control 60 the volume control and now that you set up the synthesizer to listen for the control 60 and it will change the volume when you change the control does that make sense I mean it's simple enough right and of course the new control value now this is not so fine as the pitch band we have only 127 values if you work with some very fine effects that need very fine adjustments it does not work quite well but it still it's a great feature to have so this is kind of important and finally we what we may want sorry we may want to sound too change okay we want to change that we use the same hardware but we want to change its sound so we can send a program change event through some buttons with some numbers that we can select the this is called the patch so we will send the channel number of the synthesizer we want to change the sound and the new patch number patch means like type of sound let's say okay so we are limited to use just 127 127 patches per in fact at 128 if I learn again two number okay so these this were like the most important meeting messages in that type okay now forget about them so hopefully you understood what they're all about do not remember names or anything so let's the other types of message channel mode messages this is used to configure the behavior of the channel it has to do with polyphonic versus monophonic okay this is not really used system common messages now this can be used each manufacturer that implements media can define their own type of messages for some particular configuration that you can use and also special controls like play or stop button if you as a media media recorder and all the synthesizers need to play at the same time that play and stop button are sent through this type of message and also we have system real-time messages if we use multiple recorders we need to synchronize them with a clock that goes through this type of message okay now I told you not to remember this stuff this is a link where you can check if you're like a MIDI kick and you want to find out more you can check this site and you will have a brief description of everything so let's see how we connect things up is it getting too complicated too many message types - ok let's let's forget about the messages and see how we connect these things now most dear most MIDI gear have these three ports but cheaper ones do not have the through one now let's see what each of these are for MIDI out you guessed it all the MIDI data that is produced by that equipment goes on the out port it's like common sense MIDI in that's where the media equipment listens for incoming midi okay and then we have MIDI through which is just a copy of what that equipment receives on MIDI in that is used for you to be able to change multiple synthesizers so you don't need to connect all of these to one keyboard from multiple media out ports you just put one cable from one to another okay this is called daisy chaining again for soldering geeks now yeah we have five pins but it's a digital serial thing so we need only two pins in fact five and four too is the shield of the cable so that does not matter it's a perfectly symmetric is very easy to make this cables good so this is a usage system I hope you like this resolution it's like a prehistoric I didn't have any better so the signal flow is like that the keyboard produces the MIDI events okay I press the e key I press the C key and so on we go from the MIDI out of this keyboard to the median of the adapter of the computer usually it's a USB adapter that's what I'm using here so we have it's a little bit short this little guy right here does all the job of converting these to our MIDI out and meet it in for that adapter and here on this side I have a USB port that I plugged into my computer so then we can get from the MIDI out of the computer in computer we process them we add it okay then we get them out and we plug it in the MIDI import of the first synthesizer that we want to use then we go from the MIDI through to another then we go to the MIDI through to another now we set these two different channels okay and then we can control them we can play the sounds now obviously I didn't show you the audio signal path because it was too cluttered then we go from the audio outputs from all of these to the speakers to listen to the music or to record it back into the computer okay so this is a typical usage scenario but nowadays hardware synthesizers are let's say less used in like cheaper studios they're all virtual so everything now happens inside the computer so we just need the keyboard and the computer and we can compose songs now a couple of things about the transmission protocol this is again very geeky stuff it's a unidirectional lancing a synchronous bit bits trim transmission rate is only 31 kilobits per second can you believe that do you remember dial-up connections I mean this is very slow for these days and the data is transmitted so each bite is preceded by a start bit and an 8-bit and stop bits right now because the the transmission rate is very slow if we have a lot of messages it may choke okay it's called MIDI choking now this happens for example when a lot of control data control data means that the knobs because whenever you turn a knob when you're continuously turning messages are continuously generated so now I have a new position new position in position okay so we have this series of events now if you do that a lot of knobs it will eventually choke so how can we prevent that we want music to keep playing okay when when we turn knob we are not interested in the intermediate parts so we can filter that events out we can we can say that the notes are more have a greater priority than the knobs does that make sense so if we have a lot of messages we will let the notes pass and maybe cancel out some of the control parts so that is a workaround but it's seriously it's a rare thing because I don't think there's a lot of control especially when you use computers and you have like exact steps you know you don't need to continuously turn or something so yeah but this may happen and this is like a limitation so let's see some pros and cons of using MIDI file size or file sizes are smaller right because we have only the instructions to play the music we have only what it needs to be played and no audio data we have no background noise you can record media on the keyboard wherever you want in an airport it doesn't matter where you have no noise you have separated the instrument tracks that's a beautiful thing to have now let's see what are the cons well requires real-time conversion conversion to sound so we need to process this into these instructions okay that may induce latency so if you want me to play in real-time and you don't have a powerful enough computer you will end up listening to your sounds later and that is very frustrating pressing a key now and then curing the the piano key later okay sound quality is inconsistent it depends on the playback devices it depends on what who follows your media instructions now I think I forgot to say that when we got to the synthesizers I asked you how we can listen to MIDI files in Windows well windows provides us with what is called Microsoft GS wavetable synth that is a synthesizer that can do a lot of instruments let's let's listen to I mean you have listen to this but let's say if Pharrell Williams will get happy MIDI file this is all that Microsoft can do ok well in terms of synthesizing so the drums are not realistic the voice or whatever voice modeling is nothing to do but still the size of this file is let's see should be very small 82 kilobytes that's pretty small ok now when when using MIDI to record you need a little bit more knowledge in music theory because you're dealing with notes and the stuff like that so in audio recording you just plug in your instrument hit record just play there and it will be reproduced ok but you need a little bit more knowledge so this this may be considered as a con oh so we're approaching the end let's see what applications are for MIDI have you ever seen this kind of thing it's called a keyboard that it it plays a lot of sounds how can it do that well it's basically it's a submitted system this is the MIDI producing part and this is the synthesizing part that is all that keyboards are really so they use internal use MIDI and they output the data as well through some ports for example this which is 12 years old professor right this is 12 years old and it still has these MIDI output puts so another application is electronic drums have you ever wondered how electronic drums actually function they're just pressure sensor so you beat on them they sense the pressure so how do we get the sound well MIDI mapping it sounds kind of weird and dumb but it's a very clever workaround the bass drum is a C note the snare drum is a D note that that's the mapping so when when this guy here the drum module senses that it received the C note it will play the bass drum now of course we can simulate that with a keyboard we can plug a keyboard there and play drums because we just play on the C C note okay so all of these drums have their own mappings that's how electronic drums work now the important part if we record a performance in MIDI and pay attention because a lot of your music that you're listening to is that is that way recorded because we can easily correct wrong notes we just changed the event or just change the note if you if you play the wrong notes you have you can have a very stupid player you can change the duration of notes if you want if you find some imperfections instead of cutting the audio is way better to cut just the event you will get a more natural sound from the virtual instrument you can correct the timing of the notes if you're not completely on the beat just move notes there and you're already a great player and you can change the tempo of the performance if you're not able to do like fast solos on the keyboard you can record note by note and then put put it up to speed and thus the sound will be natural it's not like the cassette tape thing you know like the pitch shifting type of tempo changing and let's say a consequence of this or mmm better said is like we can do that for for audio that we already recorded it's not really possible now but it's a hot research topic automatic transcription so transforming from audio into MIDI that would be a really useful tool I really hope you guys are interested in that and develop something for me now MIDI is very useful for composers you can use a lot of virtual instruments okay orchestra instruments you don't have to call the guys you don't have to pay them they don't have to agree to be at a certain time at the studios that is way easy and you can listen to the to the end product already and producing music with virtual instruments of course it's cheaper and the sound quality is not that bad now believe me if you listen to like if you watch movies a lot of the soundscapes there are recorded with virtual instruments that those violins and stuff very expensive to hire an orchestra of 40 people and all agreeing on the same time to come to the studio reading your music you know they're very expensive so you pay like two hundred bucks for the best like string string virtual instrument then you program MIDI program this stuff and it plays and it sounds very awesome it sounds like real Orchestra and another important application is that you can directly record a music score well that is pretty simple I mean you just know where the beat is then you put the notes on the score so you convert from MIDI to score it's very easy and very useful and now this is like a I don't know how to define that but I would like to see that you can analyze B we have all these details so the exact pressure we have the exact timing so you can analyze the performance style you know have you ever listened to a song classical piano song that you like listen or shopping or whatever you listen to and some guys plays it some some guy yeah some guy plays it and then another guy plays it and it sounds a little bit different now what what are these what can we how can we quantify this difference it's an interesting research problem so we can analyze the performance much better than from audio because it's very hard to define the exact like pressure and what what the performer does okay now before we know let's let's get now into the questions so that you don't forget anything please ask me whatever you want about MIDI and then I'll try to make a short demo I still have a little bit of time do you have any questions on these topics that we have talked about who understood what MIDI is not too many so I okay can we try that once more I'm not convinced that just two people have understood this so no questions here once twice sold okay so let's see I have a setup here now this keyboard oh yeah I love it I simply love it okay mmm yeah it will be good to do that a couple of seconds please it shouldn't take too long okay please work yeah that's the way whoa bingo so it does not like me okay then I will do this without the keyboard because I think the MIDI driver is what causes these problems please okay so first let me show you how MIDI data looks like I hope I have another enough screen resolution here but it's pretty hard to zoom in zoom in so this is what MIDI data looks like this is the piano from the lowest key to the highest key these are the events the beginning is the note on event the ending is the note off so we clearly see the duration of the notes here are the velocities of the notes that I've recorded okay so let me play just this thing ah how can I do that without having enough screen here this is actually just a drum MIDI so you can see they're played like C note for the bass drum D note for the snare this is the hi-hat F sharp so this is what it sounds like and it sounds like that because I use a software synthesizer it's called contact and it has real waves the wave sounds recorded from the drums okay so we can check here hopefully it won't crash as it does with the keyboard so these are the sounds okay they're actually recorded so it sounds quite as a natural drum bit let's see another thing this is the bass solo the bass okay now let's see the the organ here ah God this is how chords are okay so how did I record this I use the great the grand piano the Yamaha those who have been to the recording studios I plugged in the MIDI I plugged in the MIDI in of the adapter to the media out of the keyboard okay into the PC on the USB hit the record button assign these sounds so that I can listen in real time and recorded these parts first drums then the base and then the organ so this is what I ended up with now it sounds like a relatively cheap band because I'm not a piano player but it still has realistic sounds right it's not as bad as Microsoft wave table synth or whatever so I would like to try this again in another file MIDI let's see test it test two then hopefully one it won't go battle again okay now where's my browser so I will insert I have already the MIDI connection you can see the the green lights there are the velocities that I press the key okay then I add the sound module or the synthesizer and I have here a lot of instruments by the way for for your knowledge so this this collection of instruments it has some choir some band instruments organ guitar bass it's like 20 gigabytes something like that 20 25 gigabytes so there are a lot of wave sounds here let's bring up a simple acoustic piano grand piano well this sounds very bad this is not a good piano so let's see a couple of nice things that we can do with MIDI now I will hit record and I will try to play something oh just got some notes wrong there so let's see what we can do about it I need more screen space come here okay now let's listen to this and see what it went wrong here oh yeah thank you why can't I hear the sound oh sorry sorry sorry in my bed okay good so now let's see what what went bad here start from this point sounds good sounds good oh there was a note that I didn't want to hear this this time I don't think I want that let me remove it much better sounds like I really know to play piano and then oh god what was that like now I need to clean this up so this note wasn't here this note wasn't in my performance and this note as well I removed something usefully I don't know which one was actually useful there so now this one wasn't yeah it was the tiny little one so I can do that then I can select all these notes anybody here who plays piano a couple of them now I'm a guitar player I don't quite know how to play piano so I've kind of mapped my way around the C major scale but it's very hard for me to play other scales because they have another other shapes so what I will do I will record these things select all the notes here and just ah please let me move all of these like that so I played another key okay so I can do that this isn't another key right and professor do I have time for a quick short another example 38 okay then I will give you another small example I will delete this I will change my instrument to drums let's see Band drum kits pop kit oh okay couple of adjustments here okay so now I'll pick a metronome with one counting measure Tyvek on the recording is all your metronome lie okay so now I try to record some some drums at this temple and maybe I don't get them right let's see okay it's tough to to play wrong do you like this oh I do because I played it so what can I do I can use a plug-in that automatically moves my notes I don't I don't even need to move them manually this is called quantization so we can move all the notes this is the strength like how hard it pulls from the notes the resolution where do I want those beats to fall and it's a quarter it's a quarter note no it's a sixteenth note sorry okay so now let's see how it sounds so it sounds quite like a drum beat and I played so poorly but I just move the notes around okay so think again when you're listening to an artist because he has all these thingies don't say that he's a great musician until you are listening to a live performance okay which does not use recorded sounds or MacBooks okay so basically that's all I wanted to say if you have further questions because I forgot to give you my email address maybe regarding music or MIDI just take a picture of the slide where note down my email address if you want to ask me further questions so that will be all for introduction to media I really hope you understood what it is and I don't know maybe enjoy using it so thank
Info
Channel: Mihai Cosareanu
Views: 11,030
Rating: undefined out of 5
Keywords: midi, introduction, lecture, course, national university of singapore, school of computing, nus, mihai, cosareanu, sound and music computing, computing
Id: jT8lXP-H8HA
Channel Id: undefined
Length: 39min 10sec (2350 seconds)
Published: Sun Oct 18 2015
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.