
If I understand the question correctly, you want to do the following: The other element of your question, which concerns randomly generated synths, can't really be addressed easily through the above approach. Timidity $file -Ow -o - | lame - $file.mp3 This script illustrates how this can be achieved without writing your own app. Stitching together Timidity and LAME, you can go from MIDI to MP3 via an SF2. LAME would be a good starting point here. To convert to MP3, you need an additional tool. A recent fork of Timidity++ can be found on Github.

Timidity++ "can play MIDI files by converting them into PCM waveform data".

MIDI to MP3 conversionĪssuming you want to go MIDI -> SF2 -> MP3, the Timidity++ source code would be a good starting point. OK, there are few different questions here, each with their own difficulties.
