Music Software Development

MIDI tempo changer

Change how fast a MIDI file plays, then download the new file. You can scale every tempo by a percentage, set one fixed BPM, or flatten a file’s tempo changes into a single tempo without moving any note in time. The file is changed on your device and never uploaded.

Tempo changer

Or drag a file onto this box, or try a sample:

How to change the tempo

Which option to choose

A MIDI file stores note positions in ticks (fractions of a beat) and stores tempo separately, as Set Tempo events. So “changing the tempo” can mean three different things:

Try all three on the tempo changes test file (120, 60 and 240 BPM over three bars, 7 seconds). At 200%, it lasts 3.5 seconds. Set to 60 BPM, its 12 beats last 12 seconds. Flattened to 100 BPM, it still lasts 7 seconds, and every note keeps its time to within one tick.

What changes inside the file

Only Set Tempo events (FF 51 03), and in the flatten mode the event times, are rewritten. Notes, velocities, controllers, program changes, lyrics and the file’s format and resolution are kept. The tempo stays in the track that held it, normally the first track of a format 1 file. Tempos are limited to 4–1,000 BPM. Files with SMPTE time division have no tempo to change, because their ticks are fixed fractions of a second.

To check the result, open it in the MIDI file analyzer, which lists every tempo event, or play it in the MIDI player. To convert single values by hand, use the MIDI tick calculator. If a file plays at the wrong speed only after importing it into a DAW, the problem is usually the import, not the file; see MIDI imports at the wrong tempo. The code is the tested module tempo-change-core.mjs.