Use timidity to convert MIDI to WAV
Use lame to convert WAV to MP3
$ timidity sound.mid -Ow2
$ lame -s48 -b256 sound.wav sound.mp3
Better to use bladeenc as the encoder, as it does not dilute the Bass of the audio being converted. Bladeenc is available in BEnc*.rpm. Look for it on the internet.