Convert MIDI file to WAV using Fluidsynth on OS X

I am trying to convert a MIDI file to a WAV file in OS X.

So far I have this:

 fluidsynth -F output_sound soundfont.sf2 note.mid 

This creates an output_sound file, however, this file is not WAV, it seems to be in sint16 format, given that I get this output:

 ~ $ fluidsynth -O help FluidSynth version 1.1.6 Copyright (C) 2000-2012 Peter Hanappe and others. Distributed under the LGPL license. SoundFont(R) is a registered trademark of E-mu Systems, Inc. -O options (audio file format): 's16' 

Is there an easy way to convert output_sound to WAV file in Terminal (or in any script)?

+8
wav midi macos
source share
3 answers

Thanks CL. Comment I came up with this:

 sox -t raw -r 44100 -e signed -b 16 -c 1 raw_audio audio.wav 
+4
source share

There is an easier way to use SoX: when FluidSynth is installed with libsndfile support, it displays WAV by default.

For example, using Homebrew:

 $ brew install fluid-synth --with-libsndfile ... $ fluidsynth -T help FluidSynth version 1.1.6 Copyright (C) 2000-2012 Peter Hanappe and others. Distributed under the LGPL license. SoundFont(R) is a registered trademark of E-mu Systems, Inc. -T options (audio file type): 'aiff','au','auto','avr','caf','flac','htk','iff','mat','mpc','oga','paf','pvf','raw','rf64','sd2','sds','sf','voc','w64','wav','wve','xi' auto: Determine type from file name extension, defaults to "wav" $ fluidsynth -F output_sound.wav soundfont.sf2 note.mid 
+5
source share

I found the easiest solution for shyness:

 timidity input.mid -Ow -o out.wav 

If you use homegrown, this is also trivial to install:

 brew install timidity 
+3
source share

All Articles