What is MIDI (a simple introduction)

MIDI is not audio. You can think of MIDI as a language—a language understood by computers and most electronic music devices, such as keyboards and synthesizers. It’s a technology that allows these devices to communicate. The MIDI language consists of a series of messages that devices can read in order to create sound or perform some kind of action. These messages include data such as the pitch of each note played (C, C#, D, D#, etc.), its velocity (how hard the key was pressed), and its starting and ending points in time. There are also messages, called program changes, that define which instrument (piano, bass, guitar, drums, etc.) should be used when playing the notes. There are various other message types in MIDI, but we’re going to omit them for now to keep things simple.

What is a MIDI file?

A MIDI file is just a collection of MIDI messages. You can think of it as a recipe for a certain music piece, or as sheet music that computers and instruments can understand. MIDI files usually use the .mid file extension and are small in size (mere kilobytes) compared to common audio formats like mp3 (a few megabytes).

Tracks, Channels, and Types

A MIDI file is organized in containers called tracks. Each track is usually used to store notes played by a different instrument and other data associated with said notes (panning, modulation, etc.). There is no limitation on the number of tracks that a file can contain. The first track in the file is typically used for metadata such as the key signature and the copyright message. When we import a MIDI file into a Digital Audio Workstation (DAW), tracks appear as horizontal lanes of data that we can edit individually using a key editor or piano roll. A file that has a separate track for each instrument is a Type 1 MIDI file. Type 1 files are more common and more versatile, making them better suited to most tasks.

Graphical representation of a Type 1 MIDI file.

There is another format, called Type 0, that contains all instruments and their data on a single track. How does the computer know which instrument to use for each note in this case? It groups messages by their channel. Certain MIDI messages “belong” not only to a track but to a specific channel as well. There are 16 channels available, numbered from 1 to 16. Therefore, when we have various notes and other control messages on a single track, the computer knows that the notes assigned to channel 2 should only be “affected” by other messages assigned to channel 2, the notes on channel 3 by other messages on channel 3, etc. This is also how conversion between Type 0 and Type 1 is rendered possible.

Graphical representation of a Type 1 MIDI file.

There are Type 2 files as well, but are rarely used.

Practical examples of Track and Channel separation

Different tracks, same channel

Let’s say we have a Type 1 MIDI file with the drums on channel 10. By placing each cymbal (kick, snare, closed hi-hat, etc.) on a separate track, we can achieve a higher level of separation, making it easier to edit each cymbal individually, particularly when creating a remix. All drum notes keep being on channel 10, which means one program change message is enough to make sure that all cymbals are played by the same drumkit.

Same track, different channel

Now let’s say we have a Type 1 MIDI file with a piano part on one of its tracks, with all the notes being assigned to channel 1. We want to import the file into a notation software, such as Sibelius, and have the notes for the left and right hand assigned correctly to the treble and bass clefs while keeping the whole piano part on a single staff. Notation software usually creates a new staff for each track in a MIDI file, so it wouldn’t be wise to separate the left and right hands to different tracks. What we can do instead is assign all left-hand notes to channel 2. This way, the notation software will be able to “understand” which notes should go to which clef.

Why does a MIDI file sounds different across devices

The same way a recipe contains only instructions but none of the ingredients, a MIDI file contains instructions but it doesn’t contain any actual sound. As such, the tone quality of the sound produced when playing a MIDI file is not dependent on the file itself but rather on the quality of the sound generated by the device playing it. The file can only instruct which notes to play, when, with what intensity, and which instrument to use for each one. It cannot, however, guarantee that the sound generated is going to be “realistic” or have certain tone qualities. The exact same file will “sound” completely different on an entry-level keyboard and a high-end workstation. Likewise, it will sound different when played by the softsynth coming preinstalled on Windows and when played by a Digital Audio Workstation (DAW) with high-quality virtual instruments (VSTi).

The only ways for a MIDI file to sound identical on two different devices are:

  1. To use the same Soundfont or VSTi (when reproducing on a computer)
  2. To use the exact same device (when reproducing on keyboards, synthesizers, hardware MIDI/karaoke players, etc.)

Why is this info important

Hopefully this article has shed some light on the magical world of MIDI. Having a grasp on the basics can help you:

  1. Choose and buy MIDI files that are better suited to your end use.
  2. Work with MIDI regardless of the hardware/software you use.
  3. Facilitate the communication with a MIDI professional by forming educated questions and getting the answers you need faster.

If you have questions or would like to expand your knowledge further, please contact me here.