What Is MIDI and How Does It Work on a Piano?
MIDI is a standard way for a digital piano to send instructions (which key you pressed, how hard, and when) to a computer, phone or app. It carries no sound itself, only the information needed to make sound somewhere else.
MIDI stands for Musical Instrument Digital Interface. It is a shared language that lets a digital piano, a computer, a phone and music apps understand each other. When you press a key, the piano sends a tiny message saying which key you pressed and how hard, and no audio travels through the cable at all.
MIDI is instructions, not sound
This surprises many beginners. MIDI is closer to sheet music being played live than to a recording. The message says play this note now, fairly softly, and something else decides what that note sounds like. That something can be the speakers inside your digital piano, a piano app on your tablet, or a game.
This is why the same performance can be heard as a grand piano, an organ or strings without you playing any differently. It is also why MIDI files are tiny compared with audio recordings: they store instructions, not sound waves.
What is inside a MIDI message
MIDI has been around since 1983 and is still the standard today. Each message is only a few bytes long. These are the ones a piano player meets most often:
| Message | What it tells the receiver | Example |
|---|---|---|
| Note on | A key went down, with a note number and a velocity | You press a key firmly |
| Note off | The key came back up | You let go |
| Control change | A pedal, knob or slider moved | You press the sustain pedal |
| Program change | Switch to a different sound | Piano to strings |
| Pitch bend | A wheel was moved | Bending a synth note |
Two numbers matter most. Note numbers run from 0 to 127. A full 88-key piano covers 21 to 108, and middle C is usually number 60. Be aware that software disagrees on the octave label for number 60: some programs call it C3 and others C4. The number is the same, only the name differs.
Velocity also runs from 0 to 127 and describes how fast the key was moving when it went down. That is how an app knows whether to play a note loudly or softly. A keyboard without touch sensitivity sends the same velocity every time, so every note sounds equally loud.
MIDI also has 16 channels, which let one cable carry several instruments at once. For a single piano you will rarely need to think about this.
How a digital piano creates MIDI
Under each key there is a sensor. Many keyboards use two contacts per key and measure the tiny time gap between them to work out velocity, although the exact design varies between models and brands. The keyboard's electronics turn that into a note on message, and later a note off message when you release the key.
The same message usually goes two places: to the keyboard's own sound engine, so you hear it, and out of the MIDI port, so other devices can use it. If you connect to an app that also plays a piano sound, you might hear two sounds at once. This guide explains why and how to fix it.
USB, Bluetooth and 5-pin connections
MIDI can travel in three common ways:
- USB MIDI: the most common today. One cable connects the keyboard to a computer, and often to a phone or tablet with the right adapter. Look for a port labeled USB to Host, or similar. A port meant for USB sticks is a different thing.
- Bluetooth MIDI: wireless and convenient, supported by many newer keyboards. It can add a small delay, which this guide on Bluetooth delay covers in detail.
- 5-pin DIN: the original round plug found on older keyboards and hardware. To reach a computer it needs a MIDI interface or adapter in between.
If you want to link a keyboard to a phone, how to connect a keyboard to a phone walks through the steps.
What you can do with MIDI
Once your piano speaks MIDI, a lot opens up:
- Play piano apps and software instruments with much better sounds than a small built-in speaker.
- Use learning games and apps that show falling notes and check which keys you actually pressed.
- Record your playing and fix a wrong note afterward, since each note is stored as data you can edit.
- Write music notation from what you play.
- Practice quietly with headphones plugged into the keyboard or your computer.
Keyfall, the free game on this site, can read a digital piano over USB MIDI or Bluetooth MIDI and checks each note you play. If you want to try it, here is how to use a MIDI keyboard with a piano game.
What about acoustic pianos?
A traditional acoustic piano has no MIDI output. Some can be fitted with add-on systems, but that is a specialist upgrade. The simpler option is a microphone, which listens to the sound and tries to work out the notes. Keyfall supports this too. A microphone has to guess from the audio, while MIDI knows exactly which key was pressed, so MIDI is generally more reliable when you have a digital piano.
Quick fixes when MIDI does not work
- No sound: remember MIDI carries no audio. Check the volume and sound output of the app, or turn on the keyboard's own speakers.
- Keyboard not found: try another USB cable. Some cables only charge and cannot carry data.
- Notes feel late: a wired USB connection usually has less delay than Bluetooth, and closing other apps can help.
- Everything sounds the same volume: your keyboard may not be touch sensitive, or its touch setting may be turned off.
MIDI sounds technical, but for a beginner it comes down to one idea: your piano tells other devices what you played, and they decide how it sounds.
More about keyboards, midi and bluetooth
FAQ
Does MIDI record sound?
No. MIDI records which notes you played, when, and how hard, not the audio. That is why the files are very small and why you can change the sound afterward.
Do I need MIDI to learn piano?
No. You can learn on any piano or keyboard without ever using MIDI. It is simply a useful extra for apps, games and recording.
Can any digital piano use MIDI?
Most modern digital pianos have USB MIDI, Bluetooth MIDI or both, but very basic or older models may not. Check the ports on the back or the manual for the word MIDI.
Is MIDI the same as USB?
No. USB is a type of connection, and MIDI is the language sent over it. Many keyboards use USB to carry MIDI messages, but MIDI can also travel over Bluetooth or 5-pin cables.
Why does my phone not see my keyboard?
The connection method may not match: a phone may need an adapter for USB, or Bluetooth pairing may need to be done inside the app or browser you are using. Try another cable and check that the keyboard is switched on and in the right mode.
Does MIDI make my piano sound better?
It can, because it lets software play a different or higher quality piano sound than the keyboard's own. The quality depends on the app or software that receives the notes.
Practise it on your own piano. Keyfall is a free piano game: notes fall toward the keys and you play them on a digital piano, keyboard, phone or computer.
Play free