eawpatches.pet <-- optional higher quality sound patches (37 MB decompressed)
TiMidity++ is a softsynth. It takes in a MIDI file, then uses a sound font or sound patch to transform it into normal audio. You can use it to convert MIDI files directly into the WAV format, or you can use it to play the file through the speakers. Another things it can do (the most useful IMHO) is run as a daemon to give you an Alsa port for MIDI playback. This lets all those other audio programs that normally play MIDI files through a port to use Timidity instead. In my case, I use it to let me play MIDI files from Audacious (using the Amidi-plug plugin). I believe it should also work with Rosegarden (a sequencer). The aplaymidi program can also use it. Basically it mimics what would happen if you had and properly configured a soundcard which is MIDI capible. This uses more CPU power than letting the card do it though. Not a huge amount - modern PCs should handle it fine - but if you're also doing some heavy lifting in other programs it could probably get pretty choppy (renicing it to a higher priority should help).
Note: When I compiled this, I didn't enable any interactive interfaces except for ncurses. If playing files with Timidity directly, you can either use it with no interface:
Code: Select all
timidity /path/to/my/midi_file.mid
Code: Select all
timidity -in /path/to/my/midi_file.mid
So, how to set Timidity up this way? Easy. I added a script at /etc/init.d/timidity_server to do it automatically at every boot. If you want to disable it, just remove the executable bit on that script (chmod 644 /etc/init.d/timidity_server to remove, and chmod 755 /etc/init.d/timidity_server to make it executable again). There's one catch: when you first install this the daemon won't be started automatically until you reboot. To start it by hand just run this:
Code: Select all
/etc/init.d/timidity_server start
I mentioned that it uses a sound font or sound patch to make the audio from the MIDI file. Sound patches are a bunch of samples of audio from different instruments and what not that Timidity will transform appropriately to match the note which is supposed to be played. Sound fonts are essentially a group of patches combined into a single file, but not as simple as that. They also support more features than patches.
Sound fonts and patch collections can be quite large (up in the 70 megabytes or more). Because we are puppians, I tracked down and included a "very small" (~4 mb) collection put together by Shom. (Shom's TiMidity++ page)
For those who'd like better quality, I also made a package of the ~30 mb 'eawpatches' collection from Gentoo. When installed it will automatically set itself as the default To revert to 'minishom', go to /usr/share/timidity/ and symlink 'minishom/' to 'current/'.
Note: if you are using it as a daemon for Alsa, you'll have to restart it before a change in patches will take effect. The hard way is to reboot. The easy way is /etc/init.d/timidity_server restart
Configuring Timidity to use any old patch or font you download is an exercise left to the reader. I did simplify things a little by setting up Timidity to look in /usr/share/timidity/current/timidity.cfg for the data, where the 'current' directory is actually a symlink. This way you can have multiple sound fonts / patch collections each in their own director of /usr/share/timidity (or elswhere and symlinked in, to save space in the savefile in case you use large ones). Within each directory you'll want to set up a 'timidity.cfg' file to use whatever fonts or patches you put in it. Then to switch, just change where the 'current' directory points. And as above, if you're using it as a daemon you'll need to restart it before the change takes effect.