Converting MIDI output to an audio file

General information and assistance with DOSBox.

Converting MIDI output to an audio file

Postby truth_deleted » 2014-1-20 @ 04:39

Inside dosbox, pressing the key combination CTRL-ALT-F8 will Start/Stop the recording of a raw MIDI file. This file is sent to a /capture directory by default (for example, c:\dosbox\capture). One method to convert the raw MIDI file to the wav format is by fluidsynth and sox, like so in the case of Windows:
fluidsynth.exe -F output.mid Scc1t2.sf2 setup_000.mid
sox.exe -t raw -r 44100 -e signed -b 16 -c 1 output.mid output.wav

The file named setup_000.mid is the raw MIDI file; Scc1t2.sf2 is a soundfont file (substitute with your .sf2 soundfont); and output.mid if the audio file which is generated by the fluidsynth program.

Sox uses the output.mid audio file as input and outputs a "wav" file, given the above command. Then, a third program is optional for compressing the wav file into the "ogg" or "mp3" format.

The fluidsynth program was built in mingw32 and attached. The sox program is obtained from here: http://sourceforge.net/projects/sox/fil ... p/download ; only sox.exe and zlib1.dll are required from that zipped archive.
Attachments
fluidsynth.zip
fluidsynth software
(564.17 KiB) Downloaded 62 times
truth_deleted
 

Re: Converting MIDI output to an audio file

Postby truth_deleted » 2014-1-22 @ 03:17

Have a (simpler) second method to convert MIDI output to an audio file. Attached is the fluidsynth binary with dependent libaries (dll files) which were compiled by mingw32/gcc. This binary was compiled with libsndfile, so the "sox" program is not necessary to create a "wav" audio file.

To convert the "captured" raw MIDI file to the wav format (using attached fluidsynth+dlls):
fluidsynth.exe --chorus no --reverb no --gain .6 -F doom2_000.wav Scc1t2.sf2 doom2_000.mid

The binary+dlls are in the attached archive but a soundfont is also required, in this case Scc1t2.sf2 was used. The parameter "gain" provides increased volume in output; chorus and reverb are turned off.
Attachments
fluidsynth-2.zip
fluidsynth v.2 software
(718.51 KiB) Downloaded 93 times
truth_deleted
 


Return to DOSBox General

Who is online

Users browsing this forum: No registered users and 4 guests