Post by JohnG on Jul 5, 2011 14:01:00 GMT
An introduction to MIDI messages.
Before I can begin to answer a couple of the questions that have been asked, it's necessary for me to describe a little more about how MIDI works. I've attempted to do this with my previous article on tracks and channels midimart.proboards56.com/index.cgi?board=mb&action=display&thread=1188234603 and now I need to address, briefly, the types of messages that are sent back and forth between MIDI devices.
It really isn't necessary for most gigging musicians to understand the fine detail of all these MIDI messages but it certainly does help if you know a bit more when a file doesn't play properly, you have problems with overall volume, you need to adjust the relative volumes of the different channels or stuck notes at the end. Another frequent problem is when pitch bend or modulation wheels are used and the MIDI file fills up with a huge number of messages that the sequencer or sound module has trouble processing. Knowing how to "thin these out" is well worth while to stop a kind of stuttering occuring.
For instance, weeo recently asked how he could get the drums to play a bit louder in a MIDI file. By understanding a bit more about how a MIDI file is organised and the messages in it, he could quickly tweak the relative volumes of each channel so that he would get the file to play as he wants. This is the introduction to being able to do that editing. (Yes, it is just an intro long winded as it is!)
-----------------------------------------------------------------------------------------
What are MIDI messages? They are short (usually just a few bytes) bursts of data (instructions) that travel up and down the cable between, say, the laptop running a sequencing program and the sound module that is playing the music. It could also be from a keyboard to a sound module or from floppy disk in a MIDI file player to a sound generator. Or any other way of using a Standard MIDI File (SMF). The principle is that someone or something is creating or replaying MIDI messages and some other device is making the sound(s). The generator could be a keyboard, MIDI guitar, wind controller or a sequencer etc. and the device is the piece of hardware or software that converts those instructions into sound. The link could be as short as that between a software sequencer and the sound card inside a PC or as long as a 15 foot MIDI cable. Even longer if you use a wireless MIDI transmission system.
What do I mean by an instruction? Well, I mean a short message (a few bytes of data) that tells the device, which is about to create the sound(s), what do to. These messages are primarily split into two different types, System Messages and Channel Messages.
---------------------------------------------------------------------------------------
System Messages
If you're completely new to MIDI sequencing I shouldn't worry too much about these. Skip straight to the next main section on Channel Messages. (Don't forget to come back though.)
System Messages are split-up into three sub-groups:
System Common, System Real-Time and System Exclusive. What all these messages have in common is that they are focussed upon your complete MIDI system not upon any individual channel. However, I'm only going to deal with System Exclusive messages here (very briefly) as the vast majority of us will not see, nor be aware of the presence of, nor use Common or Real-Time messages. I may come back to these two sometime in the future. Except for one brief mention of a Real-Time Message below.
When I deal with Channel Messages (further below) you will discover that these cover nearly every function that we're routinely likely to need to set up and control the playing of individual channels of music. But some manufacturers wanted to be able to create MIDI devices that went beyond, in some cases way beyond, what was considered everyday usage. And so System Exclusive (SysEx) messages were created.
System Exclusive messages are primarily there to let individual manaufacturers (notably Roland; the GS standard and Yamaha; the XG standard) send control information to their specific devices. These types of manufacturer specific SysEx messages are capable of addressing just one device out of many that may be connected together and can provide a huge range of extra voices and controls that aren't available via normal Channel control. However, (there's always a however isn't there?) they require a level of sophistication in the end user well above that needed for normal or General MIDI. The messages are represented in something that instills fear in the bravest programmer called Hexadecimal. This is a special way of representing the bits stored in a byte. If there's a call for it I may cover this topic in a future tutorial. Otherwise enough about SysEx!
If you have a Roland or Yamaha sound module then at some stage you'll have to get to understand some of the GS and XG SysEx messages if you want to exploit their full capabilities.
However, yes another however but better this time, there are a few Universal SysEx messages that could prove useful to us. Master Volume, Master Pan and Time-Signature which should speak for themselves. Master volume sets the overall output of the sound card, module, software whatever. Master Pan allows you to shift the stereo image from centre stage to left or right should you need to and Time-Signature well you all know this, it's 4/4 or 3/4 or 6/8, i.e. how many quarter notes or eighth notes etc. in a measure (or bar).
The last message I'm going to mention here doesn't really fall into any category as it's neither a System nor a Channel message but it is one of the sequencer messages that needs to occur at the start of a MIDI file and sometimes gets altered as the file plays. It's Tempo. It's one that we need to enter into the sequencer but actually doesn't get sent to the sound module. We need to tell the sequencer how many beats per minute to play but the sequencer then sends a series of pulses (a Timing Clock, an example of a System Real-Time Message) to the sound module at 24 pulses per quarter note.
--------------------------------------------------------------------------------
Phew! That's enough about System Messages. For the time being anyway.
--------------------------------------------------------------------------------
Channel Messages
Okay so far? Probably not. Go and get yourself a cup of tea, coffee or something to refresh you, preferably not alcoholic as you'll need a clear head to absorb this. Then again ... !
What are Channel Messages? They are the messages sent down each of the MIDI channels that we're using (usually 16) that tell that channel which instrument sound to make, how loud, whereabouts in the stereo stage to sound and, of course, what notes to play, as well as a whole shed load of other things.
Channel Messages can be subdivided into five different categories. These are Program Change, Control Change, Note-On/Note-Off, Pitch Bend and Aftertouch and it's these messages that constitute the bulk (especially notes) of a MIDI file.
Notes. Well, at their simplest level they are the messages that tell the sound module which note to play, how hard the note was played and at what precise moment to play it (Note On) and when to switch the sound of that note off (Note Off). What is displayed on the sequencer screen, though, is
time, note number, force, duration. There are, of course, other messages that get sent during the playing of a file and the next most common are likely to be Pitch Bend and Modulation. Pitch bend is what guitarists do to their strings from time to time and modulation is usually (but not always) used to add vibrato to a sounding note.
Setup messages. At the beginning of a MIDI file there will be a set of messages on each channel that tell the channel what sound (Program Change), how loud, pan position, maybe reverb level (Control Change), etc. etc. etc. It may also have lots of other messages that allow the initial sound selected to be modified in many different ways. I imagine we'll be taking a look at some of these things in the near future.
Summary
MIDI Messages are instructions that get sent, for example, between a sequencer and a sound module to tell the module what to do. They start with initialisation messages for the whole system like tempo and key, and then continue with messages that tell the sound module what instrument to play e.g. piano or violin, how loud, what stereo position etc. After this setup sequence the rest of the file is filled with note data and sometimes with instructions to apply pitch bend or vibrato. Extra controller messages are sometimes included from time-to-time to change e.g. tempo or the volume of individual parts.
---------------------------------------------------------------------------
What am I going to put in the user files section? Well, I thought I'd set up what, for me, is a fairly typical initialisation file. I'll make two versions of it, the first for people with a simple GM (General MIDI) compatible sound module and then for one for GM2. So look for JGexGM01.mid, JGexG201.mid respectively all zipped up as JGexGM01.zip. Have a look at what I've done, then during a series of later lessons we'll go through the contents.
For future reference I shall be using Anvil Studio sequencer NOT JazzWare. The reason for this is that I've just discovered that JazzWare edits the timing of some messages without being asked to, as well as adding a whole load of Roland GS SysEx messages into the file, again without being asked, some in measure 11,651. At 120 beats per minute that's a MIDI file more than six and a half hours long! Consequently I shan't be using JazzWare again until it's suitably modified. Anvil Studio is much better behaved. I wondered why some control messages weren't being obeyed properly in my sound module.
But the next lesson will be looking at the various ways of adjusting volume in a MIDI file and specifically at one of weeo's files to get the drums louder. At last!
As always, please feedback comments, questions etc.
JohnG.
© John L. Garside, 2007.
Before I can begin to answer a couple of the questions that have been asked, it's necessary for me to describe a little more about how MIDI works. I've attempted to do this with my previous article on tracks and channels midimart.proboards56.com/index.cgi?board=mb&action=display&thread=1188234603 and now I need to address, briefly, the types of messages that are sent back and forth between MIDI devices.
It really isn't necessary for most gigging musicians to understand the fine detail of all these MIDI messages but it certainly does help if you know a bit more when a file doesn't play properly, you have problems with overall volume, you need to adjust the relative volumes of the different channels or stuck notes at the end. Another frequent problem is when pitch bend or modulation wheels are used and the MIDI file fills up with a huge number of messages that the sequencer or sound module has trouble processing. Knowing how to "thin these out" is well worth while to stop a kind of stuttering occuring.
For instance, weeo recently asked how he could get the drums to play a bit louder in a MIDI file. By understanding a bit more about how a MIDI file is organised and the messages in it, he could quickly tweak the relative volumes of each channel so that he would get the file to play as he wants. This is the introduction to being able to do that editing. (Yes, it is just an intro long winded as it is!)
-----------------------------------------------------------------------------------------
What are MIDI messages? They are short (usually just a few bytes) bursts of data (instructions) that travel up and down the cable between, say, the laptop running a sequencing program and the sound module that is playing the music. It could also be from a keyboard to a sound module or from floppy disk in a MIDI file player to a sound generator. Or any other way of using a Standard MIDI File (SMF). The principle is that someone or something is creating or replaying MIDI messages and some other device is making the sound(s). The generator could be a keyboard, MIDI guitar, wind controller or a sequencer etc. and the device is the piece of hardware or software that converts those instructions into sound. The link could be as short as that between a software sequencer and the sound card inside a PC or as long as a 15 foot MIDI cable. Even longer if you use a wireless MIDI transmission system.
What do I mean by an instruction? Well, I mean a short message (a few bytes of data) that tells the device, which is about to create the sound(s), what do to. These messages are primarily split into two different types, System Messages and Channel Messages.
---------------------------------------------------------------------------------------
System Messages
If you're completely new to MIDI sequencing I shouldn't worry too much about these. Skip straight to the next main section on Channel Messages. (Don't forget to come back though.)
System Messages are split-up into three sub-groups:
System Common, System Real-Time and System Exclusive. What all these messages have in common is that they are focussed upon your complete MIDI system not upon any individual channel. However, I'm only going to deal with System Exclusive messages here (very briefly) as the vast majority of us will not see, nor be aware of the presence of, nor use Common or Real-Time messages. I may come back to these two sometime in the future. Except for one brief mention of a Real-Time Message below.
When I deal with Channel Messages (further below) you will discover that these cover nearly every function that we're routinely likely to need to set up and control the playing of individual channels of music. But some manufacturers wanted to be able to create MIDI devices that went beyond, in some cases way beyond, what was considered everyday usage. And so System Exclusive (SysEx) messages were created.
System Exclusive messages are primarily there to let individual manaufacturers (notably Roland; the GS standard and Yamaha; the XG standard) send control information to their specific devices. These types of manufacturer specific SysEx messages are capable of addressing just one device out of many that may be connected together and can provide a huge range of extra voices and controls that aren't available via normal Channel control. However, (there's always a however isn't there?) they require a level of sophistication in the end user well above that needed for normal or General MIDI. The messages are represented in something that instills fear in the bravest programmer called Hexadecimal. This is a special way of representing the bits stored in a byte. If there's a call for it I may cover this topic in a future tutorial. Otherwise enough about SysEx!
If you have a Roland or Yamaha sound module then at some stage you'll have to get to understand some of the GS and XG SysEx messages if you want to exploit their full capabilities.
However, yes another however but better this time, there are a few Universal SysEx messages that could prove useful to us. Master Volume, Master Pan and Time-Signature which should speak for themselves. Master volume sets the overall output of the sound card, module, software whatever. Master Pan allows you to shift the stereo image from centre stage to left or right should you need to and Time-Signature well you all know this, it's 4/4 or 3/4 or 6/8, i.e. how many quarter notes or eighth notes etc. in a measure (or bar).
The last message I'm going to mention here doesn't really fall into any category as it's neither a System nor a Channel message but it is one of the sequencer messages that needs to occur at the start of a MIDI file and sometimes gets altered as the file plays. It's Tempo. It's one that we need to enter into the sequencer but actually doesn't get sent to the sound module. We need to tell the sequencer how many beats per minute to play but the sequencer then sends a series of pulses (a Timing Clock, an example of a System Real-Time Message) to the sound module at 24 pulses per quarter note.
--------------------------------------------------------------------------------
Phew! That's enough about System Messages. For the time being anyway.
--------------------------------------------------------------------------------
Channel Messages
Okay so far? Probably not. Go and get yourself a cup of tea, coffee or something to refresh you, preferably not alcoholic as you'll need a clear head to absorb this. Then again ... !
What are Channel Messages? They are the messages sent down each of the MIDI channels that we're using (usually 16) that tell that channel which instrument sound to make, how loud, whereabouts in the stereo stage to sound and, of course, what notes to play, as well as a whole shed load of other things.
Channel Messages can be subdivided into five different categories. These are Program Change, Control Change, Note-On/Note-Off, Pitch Bend and Aftertouch and it's these messages that constitute the bulk (especially notes) of a MIDI file.
Notes. Well, at their simplest level they are the messages that tell the sound module which note to play, how hard the note was played and at what precise moment to play it (Note On) and when to switch the sound of that note off (Note Off). What is displayed on the sequencer screen, though, is
time, note number, force, duration. There are, of course, other messages that get sent during the playing of a file and the next most common are likely to be Pitch Bend and Modulation. Pitch bend is what guitarists do to their strings from time to time and modulation is usually (but not always) used to add vibrato to a sounding note.
Setup messages. At the beginning of a MIDI file there will be a set of messages on each channel that tell the channel what sound (Program Change), how loud, pan position, maybe reverb level (Control Change), etc. etc. etc. It may also have lots of other messages that allow the initial sound selected to be modified in many different ways. I imagine we'll be taking a look at some of these things in the near future.
Summary
MIDI Messages are instructions that get sent, for example, between a sequencer and a sound module to tell the module what to do. They start with initialisation messages for the whole system like tempo and key, and then continue with messages that tell the sound module what instrument to play e.g. piano or violin, how loud, what stereo position etc. After this setup sequence the rest of the file is filled with note data and sometimes with instructions to apply pitch bend or vibrato. Extra controller messages are sometimes included from time-to-time to change e.g. tempo or the volume of individual parts.
---------------------------------------------------------------------------
What am I going to put in the user files section? Well, I thought I'd set up what, for me, is a fairly typical initialisation file. I'll make two versions of it, the first for people with a simple GM (General MIDI) compatible sound module and then for one for GM2. So look for JGexGM01.mid, JGexG201.mid respectively all zipped up as JGexGM01.zip. Have a look at what I've done, then during a series of later lessons we'll go through the contents.
For future reference I shall be using Anvil Studio sequencer NOT JazzWare. The reason for this is that I've just discovered that JazzWare edits the timing of some messages without being asked to, as well as adding a whole load of Roland GS SysEx messages into the file, again without being asked, some in measure 11,651. At 120 beats per minute that's a MIDI file more than six and a half hours long! Consequently I shan't be using JazzWare again until it's suitably modified. Anvil Studio is much better behaved. I wondered why some control messages weren't being obeyed properly in my sound module.
But the next lesson will be looking at the various ways of adjusting volume in a MIDI file and specifically at one of weeo's files to get the drums louder. At last!
As always, please feedback comments, questions etc.
JohnG.
© John L. Garside, 2007.