Sound synthesis, sound design and audio processing - Part 12Getting started
Understanding MIDI Modes and Messages
After having discovered the MIDI standard in our last installment, let's now have a more detailed look into it.
We'll start by examining the different modes used by MIDI devices to communicate between them.
In Mono mode, a MIDI device receives and transmits data on every channel. The transmission is exclusively monodic.
In Omni mode, a MIDI device receives data on all channels, but only transmits information on one channel. In Poly mode a device transmits data on several channels but receives only on one.
The Multi mode is specially adapted to multi-timbral devices, since they can respond to different channels simultaneously.
Finally, the General MIDI (GM) mode, which appeared back in the 1980s with the development of soundcards and computer video games that used MIDI soundtracks, standardizes the way in which sounds are ordered in multi-timbral systems, to guarantee a consistency when reading MIDI files in different devices. Some manufacturers, like Roland and Yamaha, developed their own modes based on GM (GS, XG, etc.). Check out the GM Level 1 sound set list at the MIDI Manufacturers Association site.
Main MIDI messages
As we saw in the previous article, the MIDI standard serves to transmit messages between two compatible devices. We'll address here the main messages used.
To illustrate our words, let's consider a synthesizer whose keyboard and different knobs and buttons don't control the synth's internal sounds, but rather those of an external module. Between synth and module we connect, via a MIDI interface, a computer that runs a software sequencer to record and save the messages transmitted. Do note that, in our example, we could've replaced the synthesizer "running the show" with a simple master keyboard without any sound production capabilities. The sequence of MIDI messages emitted by the control keyboard will be the following:
"Enable the recording of the MIDI sequence on the computer. Based on the keyboard of the synth controlling the external sound module, play, moderately loud, the E of the fourth octave using the sound of preset 245 of the module's 3rd bank. While keeping the key pressed, increase the cutoff frequency of the filter according to the pressure exerted on the aforesaid key, and modify the resonance of the filter by means of the rotation of the knob concerned. While still holding the key down, make the pitch note change by means of the pitch bend wheel. Silence the note."
And this is how it's translated…
"Enable the recording of the MIDI sequence on the computer" ─ MIDI clock and transport controls
The MIDI clock message allows several MIDI devices to be synced with each other. Transport messages control when a MIDI file starts, stops and is resumed. The recording message wasn't "MIDIfied" on sequencers until 1992 with the arrival of the MMC (MIDI Machine Control) standard, which allows the basic transport controls to be extended.
"Based on the keyboard of the synth controlling the external sound module..." ─ Local mode On or Off
This type of message allows you to define whether the keyboard (or any other playable element, like a pad, for instance) of the instrument controls the internal sounds or those of another device connected to the MIDI OUT. In this example, we chose the second option.
"… play…" ─ Note On
The Note On message indicates to the system a note has been played.
"… the E of the fourth octave…" ─ Note number
In MIDI, every note is identified by a number. In this case, it's number 52.
"… moderately loud...." ─ Velocity
It may seem strange to associate the volume of the sound produced with velocity, but you'll see it's pretty logical. In fact, the system measures the velocity with which a key goes from the state of rest to that of being pressed. Hence, the "louder" you play, the higher the velocity. "Moderately loud" would translate into MIDI velocity values between 60 and 70.
"...using the sound of preset 245…" ─ Program Change(Program Change)
Program Change messages command the receiving device to modify the current preset in order to change the sound ─ or effect, if it's an effects processor.
"…of the module's 3rd bank." ─ Bank Select
This message serves to select a bank when the device in question has more than 128 presets, which is the maximum number of presets a bank can have.
"While keeping the key pressed, increase the cutoff frequency of the filter according to the pressure exerted on the aforesaid key..." ─ Channel aftertouch or Polyphonic aftertouch
This function allows you to vary a parameter, in this case the cutoff frequency, depending on the pressure (which is not to be confused with the velocity!) exerted on the keys of the keyboard after pressing them. Most times, the pressure on one single key causes the same value to be sent for the entire keyboard. This is called Channel Aftertouch. However, some MIDI devices can differentiate pressure values for every key, which is called Polyphonic Aftertouch.
"...and modify the resonance of the filter by means of the rotation of the knob concerned." ─ Control change (CC)
Control change messages indicate that a continuous controller (knob, fader, wheel) is being used. This type of message can use up a large part of the transmission capacity of the MIDI channel concerned. That's why, as we pointed out in the previous article, this type of control elements often have their own 16-channel MIDI port on MIDI controllers that feature both a keyboard and parameter controls, in order to avoid any conflicts with the flow of MIDI data concerning notes.
"While still holding the key down, make the pitch note change by means of the pitch bend wheel." ─ Pitch Bend
This message regulates the changes in pitch of a note by means of the wheel of the same name. This type of message is somewhat unique because, unlike the others, it uses 14 bits and, thus, has 16,384 degrees of variation, instead of the 128 that are usual to MIDI. The modulation wheel, usually placed next to the pitch-bend one, transmits conventional CC messages of 128 values.
"Silence the note." ─ Note-off
When the key is released, the Note Off message is sent to mute the sound previously enabled. Some devices also have a "Panic" or "All-notes off" button, which allows you to mute any notes that are "hanging" after releasing the corresponding keys (aka "stuck notes"), which can happen from time to time.
Certain devices also recognize a release velocity, which allows you to modify the way in which a sound is silenced, according to the velocity with which you release the keys.
In addition to the standard messages detailed above, the MIDI standard offers different ways to go beyond its own constraints.
The first is the use of System Exclusive (SysEx) messages. Messages of this type are foreseen to transmit all data specific to the operation of a device. One of its most common usages is the recovery, within a sequencer, of the preset list of a device. But they can also be used to overcome the constraints of MIDI in terms of non-tempered music (the use of microtones, etc.).
The second is Registered Parameter Numbers (RPN) and Non-Registered Parameter Numbers (NRPN). There are five RPNs currently: Pitch bend sensitivity, coarse tuning in semitones or fine tuning in cents (hundredths of a semitone), modulation depth (see forthcoming article), and reset of the RPNs and NRPNs. Just like the Pitch Bend parameter, they have 16,384 values. NRPNs are different to RPNs in that they can be freely assigned to any parameter. However, not all MIDI devices can handle this type of data.