Courtesy Loni:
Timidity will play midi files quite nicely, and also output to a variety of formats. To play and output to a wav file:
timidity mymusic.mid -Ow -o mymusic.wav
UPPERCASE O (OH!) = output mode, lowercase ‘w’ (for wav file), then
lowercase o (oh) = output filename.
There are other options available too, specifying stereo/mono output, and much more. timidity -h is quite readable, the man page is more convoluted.
For stereo wav:
timidity mymusic.mid -OwS -o mymusic.wav
(be careful of the case of both the O’s (OH’s!) and the options for the mode O (uppercase). wav format = ‘w’ (lower), stereo = ‘S’ (upper)
Easily scriptable as something akin to:
(in your midi subdirectory, of course)
for f in *.mid; do
timidity "$f" -Ow -o "${f%.mid}.wav"
done
(umm, the %.mid bit only works with bash > v7.00)
I suppose I should do it pre-bash 7 too:
for f in *.mid; do
timidity "$f" -Ow -o "$(basename $f .mid).wav"
done
(not as pretty as the former, but still works!)
Hope this helps
Loni
————
Thanks Loni
Related Articles
No user responded in this post