How to record MIDI, part 1: What is MIDI?

This is the first article in a series on recording MIDI from a digital piano or electronic keyboard.

MIDI stands for “Musical Instrument Digital Interface”. It is a standard communications protocol for electronic instruments.

The main difference between audio recording and MIDI recording is that MIDI does not store the sounds you make, only the names of the keys that you pressed. It is like sheet music or the old piano rolls — but in electronic form.

Most digital pianos and keyboards have MIDI capability: at the very least they can send MIDI messages to other equipment (“MIDI OUT”), but usually they also have the ability to receive MIDI messages (“MIDI IN”).

NOTE: You can also install MIDI into an acoustic piano, but we won’t consider that in this article. Google for “MIDI piano strip” if you are interested in this.

How does MIDI work?

MIDI is a hardware standard that describes how electronic instruments can communicate, as well as a software standard. I’ll skip the hardware bits and briefly go into the software part of MIDI.

This is what MIDI cables look like:

MIDI cable

When you connect your digital piano to the computer through MIDI, the piano will send a message (or event) to the computer whenever something interesting happens. For example, when you press a key, when you release that key, when you press down the sustain pedal, when you choose another voice, when you roll the pitch wheel, and so on.

For a digital piano, MIDI sends/records the following:

  • Note On event: the name of the note (A0 to C8) and the “velocity” (how fast you pressed the key)
  • Note Off event: just the name of the note (although some high-end instruments also send a “release velocity” to indicate how fast you let go of the key )
  • Pedal event: either on/off or a value between 0 and 127 that indicates the pedal position (0 = up, 127 = down)

This is enough to record all the details of your performance.

The MIDI protocol uses 16 channels, each of which can have its own “voice” (instrument sound). Most MIDI messages are specific to one single channel, although some affect all channels at once.

If you layer two sounds — piano on channel 1 and strings on channel 2, for example — then pressing a key will always send two messages: one “key down” event for channel 1 and one “key down” event for channel 2.

If you play the piano in split mode with a bass sound in the lower register and a piano sound in the higher register, then a “key down” event is only sent for channel 1 when you play a bass tone, and a “key down” for channel 2 is only sent when you play a piano tone.

Channel 10 is reserved for drum sounds.

MIDI is an industry standard, so you can expect it to work the same way across products of different vendors. You can hook up a Roland keyboard to a Yamaha sound module and it will work. Each vendor can also add its own type of MIDI messages — these are called “system exclusive” messages (or “sysex”).

“General MIDI” is a standard for assigning voices (sounds) to the same MIDI codes. If your instrument is GM-compatible, it guarantees that sound 1 is always an acoustic piano, sound 12 is a vibraphone, sound 74 is a flute, and so on. Not all MIDI equipment uses this standard, though.

The reason for using MIDI is expandability. If your digital piano can send MIDI messages, you can connect it to an external sound module and thereby give it access to a whole range of new sounds.

For example, the Yamaha Motif ES sound module can produce more than 1,000 different sounds! All you have to do to use these sounds is connect your piano’s MIDI OUT to the sound module’s MIDI IN with a cable, and you’re ready to go.

Why record as MIDI?

I prefer to record my piano playing as MIDI for the following reasons:

MIDI files can be edited later. Notes can be made louder or softer, moved up or down by a semitone, played a little earlier or a little later, and so on. You could build your entire MIDI file from scratch by hand if you wanted to, but I just use this to tweak small errors.

MIDI files are much smaller than sound files. An average MIDI recording is about 1,000 times smaller than a file of the same duration in MP3 format. Even though disk space is cheap these days, I still prefer the tiny size of MIDI files. It just makes them easier to transfer and backup.

You can record without worrying about the sound. In the articles on recording audio, we spent a lot of time on getting the volume right. When recording MIDI, this doesn’t matter. It also doesn’t matter what sound you use.

When the time comes to turn my MIDI recording into audio, I can set up my instrument using the sounds and effects I want and then send it the MIDI file to play back using these settings. If the volume is too loud and clipping occurs, I can turn some knobs and try again.

How to record MIDI

MIDI can be used for a wide variety of things, but in these articles we will limit our discussion to recording. There are three ways to record MIDI:

With the sequencer that is built into your instrument. Many keyboards and digital pianos have a record function. If your instrument has a floppy drive or a memory stick, you can simply record your performance on the instrument itself and then transfer the files to your computer using the floppy or the memory stick. Refer to your manual for more detailed instructions.

With a special “sequencer” unit. This is a separate device that you connect to your instrument with MIDI cables.

With the computer. This is what we’ll go into in more detail in the rest of this series.

Read more articles on Piano Clues:

Basic Theory

Chords and Harmony

The Circle of Fifths

Arrangement, Improvisation and Composition

Reading Music and Sheet Music

How to Record Piano

Software and Virtual Instruments

Scales and Exercises

Digital Pianos

Links and Other Stuff


  1. wasky D says:

    this is really interesting. thanks guy for the tips
    wasky D

  2. Fred Manthey says:

    Our tiny church is buying a BEHRINGER CDP-2000 Digital Piano that has MIDI IN, OUT and RECORD. Now I’m not a musican, just a computer guy trying to help the church out. I know that a musician can play a song on this digital piano/organ and record it on the CDP-2000 for later playback. But, we have a lot of MIDI files that we would like to be able to ‘record’ onto the CDP-2000. If we connect a computer to the digital piano, and play the files, can we use the record feature on the piano to save the MIDI files? As you can see, I’m just a computer guy who likes music, but does not play any instruments. It seems logical to me that this would work, but I sure would appreciate some advice!

  3. admin says:

    Hi Fred,

    It is always possible to send MIDI to the digital piano for playback. However, whether you’re able to record those MIDI notes on the piano using its built-in recording function… that depends on the digital piano. My answer would be: “probably not”, but you’ll have to check the instruments manual to make sure.

    Some digital pianos have a disk drive or a slot for a memory stick. If yours has one, you can transfer MIDI files to the piano that way. Alternatively, you may be able to upload MIDI files over the digital piano’s USB connection if it has one. For instructions… see the manual. :-)

  4. Cy says:

    will a cheap keyboard without velocity, also hear the velocity on the computer? Or do it depends on the keyboard itself?

  5. admin says:

    If the keyboard does not transmit velocity to the computer, then the computer cannot play with velocity.

  6. micaelea says:

    How do you get music for the ISOLATED piano parts in songs? The sheet music usually gives you an approximation of the over all song. How do I find exactly what the pianist is playing in the recording? For example – I want to play the piano (harpsichord) PART in Walk Away Renee by The Left Bank, but all I can find is overall piano sheet music that is totally different from what the guy is playing in the song.

    • admin says:

      I’m afraid you’ll have to transcribe those piano parts yourself. Sheet music often contains a different arrangement than the recording. On the plus side, transcribing is good practice! ;-)

  7. Gordon Price says:

    I have started playing the piano again after many years. I hear that it is now possible to have your MIDI file print out the sheet music you play direct from your electric piano. Is this possible?

    • Matthijs says:

      @Gordon Price: Yes, that is possible. MIDI is essentially sheet music in electronic form. However, you usually need to clean up the MIDI data a bit (especially with respect to timing) before it is truly readable.

Brax.Me Build Private Communities

Privacy Focused Social Media. Free. iOS, Android and Desktop Join Free >>.

Leave a Reply

Your email address is required but will not be visible to others.