Music Software Development

MIDI troubleshooting

MIDI faults are easiest to find when you look at the bytes rather than at the sound. Each section below goes from the symptom to the likely causes, how to check each one, and the fix. The checks use free tools on this site:

SymptomCheck first
No soundDo messages arrive at all? Then check the channel, the instrument and the volume.
Notes keep soundingNote Off missing or on another channel; sustain CC 64 stuck on
Wrong octave or note namesC3/C4 naming convention, transpose settings
Late, uneven or drifting timingAudio buffer size, timer-based scheduling, tempo map
Doubled notes or flamsLocal control, MIDI thru/echo, loops
Device not listedOperating system’s MIDI device list, cable, drivers, another app holding the port
Web MIDI errors in the browserBrowser support, HTTPS, permission
File imports wrongFormat 0 vs 1, tempo events, PPQ
Knobs or pedals do nothingCC number and channel, the receiver’s mapping

No sound

Symptom: keys are pressed or a file plays, but nothing is heard.

Likely causes

How to check

  1. Open the monitor and press a key. If nothing appears, the problem is upstream: the cable, the port or the device (see device not listed).
  2. Read the channel in the monitor’s output (channel=1) and compare it with the receiver’s setting.
  3. For a file, open it in the analyzer. Check which channels carry notes, whether each has a Program Change, and whether CC 7 or CC 11 is set to 0.
  4. Play the file in the MIDI player. If it sounds there, the file is fine and the problem is in your DAW or synth setup.

Fix

Select the right port, set matching channels (or set the instrument to “omni”/any channel), assign an instrument, and send Bn 07 64 (volume 100). On a keyboard with built-in sounds used with a DAW, turn Local Off and enable the DAW’s MIDI echo/thru, or turn Local On and disable the echo, but not both (see doubled notes).

Stuck notes (hanging notes)

Symptom: a note keeps sounding after the key is released, or after playback stops.

Likely causes

How to check

  1. In the monitor, play the stuck key and look for its Note Off. Check that the channel and note number match the Note On.
  2. Watch for controlChange controller=64. A value of 127 that never returns to 0 is a stuck pedal.
  3. For a file, inspect the events in the analyzer and look for a Note On without a later release of the same note on the same channel.

Fix

To silence everything now, send a “panic” on all 16 channels. Release sustain first: by specification, All Notes Off does not cut notes that the sustain pedal is holding.

B0 40 00   sustain pedal off (CC 64 = 0)       } repeat for
B0 78 00   All Sound Off     (CC 120 = 0)      } channels B0
B0 7B 00   All Notes Off     (CC 123 = 0)      } through BF

The Web MIDI guide has a panic() function that sends exactly this. Some devices ignore CC 120 or CC 123. In that case, send a Note Off for every note on every channel (128 × 16 messages), or power-cycle the device. In your own code, track what is sounding and release it on Stop. Apply transpose when the note starts, and store the transposed number for its release:

// Remember what is sounding so Stop can release exactly those notes.
const sounding = new Set(); // channel * 128 + note
function noteOn(out, ch, note, vel) { out.send([0x90 | ch, note, vel]); sounding.add(ch * 128 + note); }
function noteOff(out, ch, note) { out.send([0x80 | ch, note, 0]); sounding.delete(ch * 128 + note); }
function stopAll(out) {
  for (const key of sounding) out.send([0x80 | (key >> 7), key & 127, 0]);
  sounding.clear();
}

For pedal polarity, unplug and replug the pedal with the keyboard off, or use the keyboard’s polarity setting. The CC 64 entry in the CC chart describes the sustain controller.

Wrong octave or wrong note names

Symptom: a part plays an octave too high or low, or two programs disagree on what a note is called.

Likely causes

How to check

Compare note numbers, not names. The monitor prints both (note=60 (C4)). The note calculator converts any number to a name and frequency, and plays it, so you can match it by ear.

Fix

If the numbers match, only the labels differ: change the display setting, or tell your users which convention you use. If the numbers differ by 12, find the transpose setting that adds it. To shift a whole file deliberately, use the MIDI transposer.

Latency, jitter and drift

Symptom: notes sound late after a key press (latency), unevenly (jitter), or slowly drift away from another device or the audio (drift).

Likely causes

How to check

Fix

Lower the audio buffer size, use wired headphones for playing, and request latencyHint: 'interactive' in Web Audio. In code, schedule ahead with timestamps rather than timers. Use the look-ahead scheduler for audio, and timestamped send() for MIDI. Make one device the clock master, and average incoming clock intervals before deriving a tempo. Use the BPM calculator to check what the spacing should be.

Doubled notes, flams and MIDI loops

Symptom: each note sounds twice or slightly flammed, notes pile up, or a device becomes unresponsive while the MIDI activity light stays on.

Likely causes

How to check

In the monitor, a loop shows every message twice (or endlessly) within a millisecond or two, often on two different inputs. Disconnect outputs one at a time until the duplicates stop.

Fix

Choose one path: Local Off with DAW echo, or Local On without it. Disable soft thru on devices that don’t need it. In your own forwarding code, never send to the port you are reading from, and if several ports could form a loop, tag or filter forwarded messages.

Device not detected

Symptom: the controller or interface does not appear in the port list.

Likely causes

How to check

First ask the operating system: Audio MIDI Setup on macOS, Device Manager on Windows, or aconnect -l / amidi -l on Linux. If the device is missing there, the problem is the cable, the power or the driver, not your app. If it is listed there but not in your app, look for another app holding the port, or restart the app.

Fix

Use a known data cable plugged directly into the computer. Install the manufacturer’s driver if the device is not class compliant. Close other MIDI apps. Restart the app (or browser) after connecting.

Web MIDI errors in the browser

Symptom: a web MIDI app says MIDI is unsupported, permission was denied, or no devices are found.

Likely causes

How to check

Open the monitor: it reports which of these cases applies. In Chrome, the site information icon in the address bar shows the MIDI permission. The browser support table lists current support.

Fix

Use a supported browser over HTTPS (or localhost). Allow MIDI in the site settings, then reload. Request sysex only when the feature needs it. Developers should catch every rejection and show the user what to do. The error table has wording you can reuse.

MIDI files that import incorrectly

Symptom: everything lands on one track, the tempo is wrong, notes are in the wrong place, instruments are wrong, or notes are missing.

Likely causes

How to check

Open the file in the MIDI file analyzer. Inspect the header (format, track count, division), then the tempo events, channels and Program Changes, and compare them with what the importer did. Then play it in the MIDI player to hear the file as written.

Fix

Use your DAW’s “split by channel” option for format 0 files, or re-export as format 1. Enable “import tempo” (or the equivalent) in the DAW. Add Program Changes at tick 0 for each channel. If you are writing the exporter, check it against the MIDI file pitfalls, and test your reader with the MIDI test files.

Knobs, faders or pedals do nothing

Symptom: notes play, but moving a control has no effect.

Likely causes

How to check

Move the control with the monitor open and note the CC number, channel and value range. Look the number up in the CC chart (for example, CC 74).

Fix

Use “MIDI learn” in the receiver, or remap the controller to a CC that the receiver already understands. Make sure notes and controls share a channel. For RPN-based parameters such as pitch bend range, send the full sequence shown in Control Change.

Still stuck? Reduce the problem to the bytes. Capture what is sent with the monitor or the analyzer, and compare it with MIDI messages in bytes. Once you can see the bytes, the cause is usually clear.