what does MIDI do?

In addition to recording audio, most DAWs have the ability to record, edit and playback MIDI.

MIDI stands for – Musical Instrument Digital Interface. It is an electrical and digital protocol, a set of rules for how different pieces of can talk to each other. One part of the protocol defines the language, vocabulary and grammar of communication and another part defines the medium, the means that carry that language. In its early days MIDI was transmitted using 5 pin connector cables. Nowadays, most MIDI is transmitted over an USB cable or entirely inside the computer between pieces of software. Despite the change of the medium, MIDI still uses the same digital language it always has. The MIDI language is made up of numbers that stand for messages like note on and note off, pitch bend and many other.

The MIDI itself does not make any sound. Instead, MIDI is more like sheet music. It contains instructions of how to make sound. This is actually what MIDI is in its core. For example, the note on MIDI command tells a MIDI instruments when to play a note, which note it is and how loud to play it. The note off command tells the instrument when to stop playing that note. MIDI can sound both good or bad depending on what the instructions say and on which synthesizer it is following those instructions. A collection of MIDI data (a song for example) is called a MIDI sequence. It is a list of numbers that stand for commands in the MIDI language saying what should happen and time stamps, saying when it should happen. The software or hardware that manages these lists is called a MIDI sequencer. Whenever we are working with MIDI notes on a grid we are manipulating data. The most well known way to create MIDI data, except inputing it with your mouse in the DAW or using software to create MIDI, is for a human musician to play an electronic instrument that does not record sound but instead detects the performance itself. This instrument is called a MIDI controller. They come in many variations but the most common is the MIDI keyboard. Some of those keyboards are also synthesizers that actually produce sound but a non-synthesizer MIDI controller makes no sound by itself. All it does is to notice which keys are played, when and how they are played and it produces the corresponding MIDI language that describes those actions. All of the control messages can be edited after they have been recorded. Other knobs, pots and faders of our controller can be assigned to almost any parameter within our DAW.

Commonly MIDI data is used to control syhtesizers, samplers and virtual instruments but it can also be used to control lighting systems, mixers and other devices. Except keyboards there are many types of other MIDI controllers. Electronic drums, wind controllers and guitar controllers to name a few. The separation between how the performance is captured and what instrument plays it back allows for incredible flexibility when writing music with MIDI.

How is MIDI passed on?

If we plan to use MIDI to capture musical performances using a MIDI controller we need to be familiar with the signal flow of MIDI data to avoid issues like double triggered notes.

Compared to modern high-bandwidth connections like USB 3.0 that can transfer millions of numbers in a fraction of a second, MIDI is a low bandwidth connection that carries only a few thousand numbers per second. A standard MIDI cable has 5 pins, each of which connects to a wire inside the cable and an outer circular piece which connects to the cable’s shield. This type of cable was a common type of connection when MIDI was invented but it is rarely rare now.

Each MIDI cable only carries a signal in one direction. The MIDI data flows out of a MIDI out port on one device and in, to the MIDI in port of another device. A MIDI controller does not actually make sound. It transmits MIDI instructions through its MIDI outport along the cable. A synthesizer follows those instructions as they arrive at its MIDI in port and producer sound through its analog audio jacks. This type of simple MIDI connection is best for live performances it is what happens internally in most synthesizer keyboards. Inside a sythnesizer keyboard are two different parts. A keyboard controller – which senses the keys and produces MIDI instructions, and a synthesizer or tone generator, which receives MIDI instructions and produces sound accordingly.

To record MIDI with a sequencer we need three components.

  1. Controller – to send the MIDI instructions
  2. A MIDI sequencer – to receive, store and retransmit those instructions.
  3. A synthesizer – which follows the instructions to produce sound.

If we record this information on a sequencer, it will begin storing MIDI data from the keyboard controller, marking each item with a timestamp. Then if we rewind and play the recorded information from the sequencer, it will send those notes to the synthesizer in order and at the appropriate times, so that the synth can make the actual sounds. At the same time the sequencer can foreword every action, performed on the controller, to the synth so that we can hear what we are doing.

We can also do sequencing with a keyboard that contains both the controller and synthesizer. This is a synthesizer keyboard. For it to be useful when nit needs to be played live, with no sequencer connected, we need the keyboard controller to have a direct MIDI connection to its internal synth so that it makes sound when we press the keys. While sequencing, the sequencer needs to be in charge of all the MIDI send to the tone generator. If the direct internal connection of the keyboard synthesiser is still in place, then for every note we play will be two copies. One direct and one forwarded from the sequencer just a split second later. Most of the synthesizer keyboards have a way of managing the direct local connection. The setting for that is usually called local. Local on to make the connection and local off to brake that connection. If the local is off, when we play a note on the keyboard the tone generator only receives one copy, the one that is forwarded to the sequencer. So far, we are only speaking about hardware sequencers and tone generators. This is how the people always sequenced in the 80s and 90s. Now most of the MIDI sequencing and tone generation is done using computer software.

In the modern digital audio workstation, to bring MIDI from a five pin connection into a computer we need an USB MIDI interface. In its most simple form this is a box with a MIDI in port, MIDI out port and an USB port. The signal flow goes like this:

The controller keyboard sends MIDI through its out port going over a traditional MIDI cable that is connected to the interface’s MIDI in port. The interface passes that MIDI data to the computer over the USB connection. Meanwhile, the computer can send MIDI data in the other direction over that same USB cable. The interface passes the data along its MIDI out port which can then go into a hardware synthesizer. For the sound of the hardware synthesizer to be included in the mix, audio from the synth is brought to the DAW using an AD converter. Some MIDI interfaces have more than one pair of ins and outs and it is also possible to use more than one interface. In that case we can use software to route MIDI signals to different places both inside and outside of the computer. Most recent MIDI controllers are made without the traditional MIDI ports at all. Instead, their MIDI information is send out of a standard USB port, skipping the old 5 pin connection entirely. For those, we do not need an interface.

How to save and process?

MIDI’s editing flexibility makes it an excellent tool for sketching and composing music. Most DAWs include powerful tools to process, store and edit MIDI using a build in MIDI sequencer. Internally the sequencer stores MIDI instructions using numbers. Many DAWs can show us the raw numbers in a format called an event list. Most DAWs give us the option to represent MIDI data as: regular music notation, guitar tablature or in a grid format. This grid view is often called a piano roll view because it resembles the old player piano rolls with holes punched in paper. It is very convenient especially for people who do not read traditional sheet music and it has become the most common way to work with MIDI sequencers.

The location where a not in the MIDI sequencer starts is the “note on” command and where the place where it ends is the “note off” command. The sequencer thinks of it as one note but the synth just follows the note on and note off commands as they arrive. This is why on many DAWs when you start playback in the middle of a MIDI note it does not play it because the note on command was never send to the tone generator. If we have two overlapping notes on the same key, the first note off command sometimes causes both to stop because not all tone generators keep track of duplicate note ons.

MIDI sequencing is one of the most powerful and creative tools that exist. We can adjust the the performance instructions, dynamics and change the performing instrument, after we record it,  with a click of a button. We can easily correct a note in a chord or duplicate a not in a chord. We can correct timing by rounding off notes to the grid line. This is called quantizing the notes. It is the same word using in sampling but with a different meaning in this context. We can also transpose MIDI to a different key, without loosing sound quality. Reverse the order of the notes without reversing their sound or change the tempo without affecting the pitch or tone. All of this is much more difficult to do with recorded audio and easy to do because it separates the performance from the sound.