MIDI 1.0
Notes & Pitch
MIDI 1.0 does not carry pitch as a frequency. It carries a key number from 0 to 127, and the receiving instrument decides what that key sounds like. On standard 12-tone equal temperament instruments, the mapping below is the one everyone uses.
Note numbers
Key numbers go from 0 to 127 in semitone steps, more than ten octaves, from C five octaves below middle C up to G about five and a half octaves above it. A standard 88-key piano covers 21 (A0) through 108 (C8).
| Note # | Hex | Scientific name | Yamaha name | Frequency (Hz) | Landmark |
|---|---|---|---|---|---|
| 0 | 0x00 | C-1 | C-2 | 8.18 | Lowest MIDI note |
| 21 | 0x15 | A0 | A-1 | 27.50 | Lowest piano key |
| 36 | 0x24 | C2 | C1 | 65.41 | Common drum pad base; GM Bass Drum 1 |
| 60 | 0x3C | C4 | C3 | 261.63 | Middle C |
| 69 | 0x45 | A4 | A3 | 440.00 | Concert pitch reference |
| 108 | 0x6C | C8 | C7 | 4186.01 | Highest piano key |
| 127 | 0x7F | G9 | G8 | 12543.85 | Highest MIDI note |
C3 or C4? Octave naming
Every implementation agrees that note 60 is middle C. They disagree about what to call it. MIDI defines only the numbers, so software has to pick a convention:
- Scientific pitch notation: 60 = C4. Used by acoustics, music education, and many tools, including MuseScore and most programming libraries.
- Yamaha convention: 60 = C3. Used by Yamaha gear and by many DAWs and synthesizers, including Ableton Live, Logic Pro, and Cubase (Cubase's display is configurable). FL Studio goes one step further and labels note 60 as C5.
Roland has used both conventions over the years. When documentation gives a note name, look for the number as well. If you write a library, say which convention it uses or let the user choose. This site uses scientific notation (C4 = 60).
Note number to frequency
In 12-tone equal temperament with A4 = 440 Hz:
f = 440 × 2^((n − 69) / 12)
n = 69 + 12 × log2(f / 440)
A fractional n from the inverse formula is the distance from the nearest key: the fractional part times
100 is the offset in cents. A tuner reading 445 Hz gets n ≈ 69.196, which is A4 plus 19.6 cents.
Velocity
Note On velocity runs from 1 to 127, because 0 means note-off (see Messages). Each instrument decides how velocity maps to loudness or timbre. A common default treats velocity as amplitude on
a squared curve, roughly gain = (v / 127)², but curves vary widely between instruments. Devices without velocity
sensing should send 64 (0x40).
Note Off velocity (release velocity) is defined but rarely used. Senders that do not measure it should send 64. For finer resolution, CC 88 (High Resolution Velocity Prefix) can add 7 more bits of velocity. See Control Change.
Pitch bend
Pitch Bend (En ll mm) carries a 14-bit unsigned value:
value = (mm << 7) | ll // 0 … 16383
signed = value − 8192 // −8192 … +8191
center = 8192 = 0x2000 → ll = 0x00, mm = 0x40
The receiver decides what the extremes mean. The default pitch bend sensitivity is ±2 semitones, and senders change it with RPN 0. Pitch bend applies to the whole channel, which is why expressive controllers use MPE to give each note its own channel.
Converting to cents
cents = (value − 8192) / 8192 × range_semitones × 100
The scale is not perfectly symmetric. The maximum positive value is 8191, one step short of the full range. Most implementations divide by 8192 for both directions and accept the tiny shortfall at the top. Others divide positive values by 8191 so that full up-bend lands exactly on the range.
Worked example
Bend up a whole tone (+200 cents) with the default ±2 semitone range:
offset = 200 / 200 × 8192 = 8192, which clamps to 8191 because the scale tops out there.value = 8192 + 8191 = 16383 = 0x3FFFll = value & 0x7F = 0x7F,mm = value >> 7 = 0x7F- Send E0 7F 7F.
Bend down a quarter tone (−50 cents) with a ±2 semitone range:
offset = −50 / 200 × 8192 = −2048value = 8192 − 2048 = 6144 = 0x1800ll = 0x00,mm = 0x30, so you send E0 00 30.
Byte order
Pitch bend sends the LSB first. 14-bit controller pairs (CC 0–31 with 32–63) send the MSB first, as separate messages. Mixing up the two orders is a common parser bug.
Alternate tunings
MIDI 1.0 offers three ways to play outside 12-TET: the channel tuning RPNs (coarse and fine; see RPN & NRPN), the MIDI Tuning Standard (a set of Universal SysEx messages that retune individual keys; see System Exclusive), and per-note pitch bend with MPE. MIDI 2.0 adds per-note pitch and pitch attributes in the Note On message itself; see MIDI 2.0 & UMP.
Spotted an error? Edit this page on GitHub.