Convert .mid to .mp3 with Debian Linux with timidity/fluidsynth and twolame encoder

By technese - Last updated: Sunday, January 29, 2012 - Save & Share - Leave a Comment

Install timidity and twolame

$ aptitude install timidity twolame
$ timidity file.mid -Ow -o - | twolame -b 256 -r - file.mp3
---------------------------------------------------------
Input Filename: STDIN
Output Filename: file.mp3
Raw input format: 2 channels, 16-bit, 44100 Hz
---------------------------------------------------------
LibTwoLame 0.3.12 (http://www.twolame.org)
Input : 44100 Hz, 2 channels
Output: 44100 Hz, Stereo
256 kbps CBR MPEG-1 Layer II psycho model=3
[De-emph:Off     Copyright:No     Original:Yes]
[Padding:Off     CRC:Off          Energy:Off  ]
---------------------------------------------------------
Playing file.mid
MIDI file: file.mid
Format: 1  Tracks: 8  Divisions: 384
Track name: Guitar 1
Track name: Guitar 2
Track name: Guitar 3
Track name: Piano
Track name: Synth
Track name: Bass
Track name: Drums

Encoding frame: 7788Playing time: ~210 seconds
Notes cut: 0
Notes lost totally: 0
Encoding frame: 8976
Encoding Finished.
Total bytes written: 7.77 MB.

or

Install fluidsynth and twolame

$ aptitude install fluidsynth twolame
$ fluidsynth -l -T raw -F - /usr/share/sounds/sf2/FluidR3_GM.sf2
file.mid | twolame -b 256 -r - file.mp3

---------------------------------------------------------
Input Filename: STDIN
Output Filename: file.mp3
Raw input format: 2 channels, 16-bit, 44100 Hz
---------------------------------------------------------
LibTwoLame 0.3.12 (http://www.twolame.org)
Input : 44100 Hz, 2 channels
Output: 44100 Hz, Stereo
256 kbps CBR MPEG-1 Layer II psycho model=3
[De-emph:Off     Copyright:No     Original:Yes]
[Padding:Off     CRC:Off          Energy:Off  ]
---------------------------------------------------------

Encoding frame: 8976
Encoding Finished.
Total bytes written: 7.77 MB.
Posted in General • • Top Of Page