Music Software Development

MIDI to WAV converter

A MIDI file contains notes, not sound, so most audio players cannot open it. This converter plays the notes through a small built-in synthesizer and saves the result as a WAV file you can play anywhere. It renders on your device, faster than real time, and never uploads the file.

Converter

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

How the conversion works

The file is parsed and its tempo map applied, so every note gets a start and end time in seconds. The notes are then scheduled on the browser’s OfflineAudioContext, which runs the same Web Audio graph as live playback but as fast as the processor allows. The synth gives each note an oscillator with a short envelope and plays channel 10 as synthetic drums. The finished audio is normalized to just under full scale and written as 16-bit PCM WAV.

The online MIDI player uses the same synth, so what you preview there is what you get here. The player’s Download as WAV button exports whatever is unmuted.

What it will and will not sound like

The instruments are simple waveforms grouped by General MIDI family: sawtooth for strings and basses, square for organs, sine for flutes and triangle for most others. A piano will not sound like a sampled piano, and controllers such as sustain pedal, pitch bend, volume and pan are not applied. The WAV is right for checking an arrangement, sharing a sketch, or making a guide track. For a realistic recording, load the MIDI file into a DAW or notation program with sampled instruments and export audio from there.

Tips

The rendering code is the tested module wav-core.mjs.