MIDI pitch bend calculator
Pitch bend is a 14-bit number from 0 to 16383, with 8192 meaning no bend. How far a full bend moves the pitch is not part of the message: it is a setting on the receiving synth, usually ±2 semitones. Enter a bend in semitones, a raw value or the two data bytes, and the calculator converts between all three for the bend range you choose.
Calculator
Message bytes: E0 00 60
Set the receiver’s bend range (RPN 0)
B0 65 00
B0 64 00
B0 06 02
B0 26 00
B0 65 7F
B0 64 7F
How the 14-bit value works
A pitch bend message is three bytes: the status byte E0–EF (the low four bits are the channel), then two 7-bit data bytes. The first data byte is the least significant 7 bits and the second is the most significant, so value = LSB + MSB × 128. That gives 0–16383. Centre is E0 00 40: LSB 0, MSB 64, value 8192. Many parsers get this backwards, because most other MIDI pairs send the most significant part first.
The value is scaled to the receiver’s range. With the common ±2 semitone setting:
| Semitones | Value | LSB MSB | Message |
|---|---|---|---|
| -2 | 0 | 00 00 | E0 00 00 |
| -1 | 4096 | 00 20 | E0 00 20 |
| -0.5 | 6144 | 00 30 | E0 00 30 |
| 0 | 8192 | 00 40 | E0 00 40 |
| +0.5 | 10240 | 00 50 | E0 00 50 |
| +1 | 12288 | 00 60 | E0 00 60 |
| +2 | 16383 | 7F 7F | E0 7F 7F |
The range is not symmetrical. Downward there are 8192 steps (8192 down to 0) and upward only 8191 (8192 up to 16383), so a full upward bend is one step short of the nominal range. This calculator maps the full range exactly onto 0 and 16383 by scaling each direction separately. Some code scales both directions by 8192 and clamps the top; the difference is one step, about 0.02 cents at ±2.
Setting the bend range with RPN 0
To change the range, send Registered Parameter Number 0, “pitch bend sensitivity”: select the parameter with CC 101 = 0 and CC 100 = 0, set semitones with Data Entry (CC 6) and cents with CC 38, then send CC 101 = 127 and CC 100 = 127 (the “RPN null”). The null step matters: without it, a later stray CC 6 would change the bend range. Many hardware synths and some plug-ins ignore RPN 0 and use a range from their own patch settings, so check the result by ear. For per-note pitch control, such as MPE controllers, the usual range is ±48 semitones.
In code
// value: 0–16383, channel: 1–16
const bend = (value, channel = 1) => [0xE0 | (channel - 1), value & 0x7F, value >> 7];
// semitones → value for a ±range receiver
const toValue = (semis, range = 2) => Math.min(16383, Math.max(0,
Math.round(8192 + (semis / range) * (semis < 0 ? 8192 : 8191))));
To decode bends from a log or a device, paste the bytes into the MIDI message decoder. The MIDI CC chart lists the other registered parameters, and MIDI messages in bytes explains status and data bytes in general.