6

I'm searching a tool that can be used in Python or via the command line (preferably Windows but Linux would also be okay) that returns a .wav or .mp3 file for a MIDI file.

What is the best choice for this task?

  • 1
    What Python version are you using? – Undo Aug 22 '14 at 12:30
  • 1
    And what command line (or rather, which OS)? – Izzy Aug 22 '14 at 13:46
  • 1
    @Undo: I'm okay with all Python versions. – Christian Aug 22 '14 at 14:09
5

You can use TiMidity++:

  • free and open source
  • CLI
  • Linux and Windows (although it seems to be painful to make it work on Windows, but maybe things have improved since then)
  • can convert MIDI files into WAV files: timidity input.mid -Ow -o out.wav
| improve this answer | |
3

You can use SoX - Sound eXchange:

  • free and open source
  • CLI
  • cross-platform (Windows, Linux, MacOS X, etc.)
  • can convert MIDI file to WAV: sox -t raw -r 44100 -e signed -b 16 -c 1 raw_audio audio.wav
| improve this answer | |
0

And for MP3 conversion you can put it together with timidity + ffmpeg:

sudo apt install timidity ffmpeg
timidity MIDI_sample.mid -Ow -o - | ffmpeg -y -f wav -i - MIDI_sample.mp3

Tested on Ubuntu 20.04 with this MIDI file: https://en.wikipedia.org/wiki/File:MIDI_sample.mid

Related: https://stackoverflow.com/questions/16295459/convert-midi-to-mp3

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.