TiMidity is a MIDI to WAVE converter and player that uses Gravis Ultrasound(*)-compatible patch files to generate digital audio data from general MIDI files. The audio data can be played through any sound device or stored on disk. On a fast machine, music can be played in real time. TiMidity runs under Linux, FreeBSD, HP-UX, SunOS, and Win32, and porting to other systems with gcc should be easy.
The original version of this program was written by Tuukka Toivonen <email@example.com> (he discontinued development because he was too busy with work). Since then, Masanao Izumo and others have begun to improve it, and now TiMidity++ has officially been released.
Please see here for more details.