Some sound cards do not have a WaveTable synthesizer for playing MIDI files with the loaded sound font (or instrument patch). In this case, use a software WaveTable synthesizer like fluidsynth or timidity++.
After the program is started with a command like fluidsynth -a alsa -m alsa_seq gm.sf2, fluidsynth appears in the list of writable MIDI ports and can be used as sound source. In this example, gm.sf2 is a file in the widely-used SoundFont format. Suitable files are available on the Internet. fluidsynth has numerous command-line options that can be displayed with fluidsynth -h.
timidity++ is configured by means of the configuration file /usr/share/timidity/timidity.cfg. View documentation for the configuration with man timidity.cfg. Also refer to the documentation in /usr/share/doc/packages/timidity.
Suitable instrument patches are available at http://www.stardate.bc.ca/eawpatches/html/default.htm. From this URL, you can download the file eawpats12_full.rar. Although the size of this file is 22 MB, the download is worthwhile, because it equips you with a full set of GM, GS, and XG instruments. To use these patches with timidity++, proceed as follows. First, assume the root user identity. Then create the directory /usr/share/timidity/eawpats, copy eawpats12_full.rar there, and change to this directory. The command unrar x eawpats12_full.rar decompresses the archive.
Now edit the file timidity.cfg in the directory /usr/share/timidity/. It should only contain the two lines shown in File 15.2. “timidity.cfg”.
eawpats12_full.rar also contains a file called timidity.cfg, which is placed in the directory eawpats following the decompression. The file is included with the source command. In this file, only the four lines shown in Example 15.3. “timidity.cfg of eawpats12_full.rar” are relevant. All other lines can be deleted.
Example 15.3. timidity.cfg of eawpats12_full.rar
source gravis.cfg source gsdrums.cfg source gssfx.cfg source xgmap2.cfg
Then the file permissions must be updated. To do this, enter the command chmod -R a+r /usr/share/timidity/eawpats. To use sound fonts instead of the Gravis instrument patches, modify the file /usr/share/timidity/timidity.cfg. For example, to use the Vintage Dreams sound font with timidity++, create a timidity.cfg consisting of a single line: soundfont /usr/share/sounds/sf2/Vintage_Dreams_Waves_v2.sf2. More information about this subject is available in /usr/share/doc/packages/timidity/C/README.sf.
There are few programs that offer as many program interfaces as timidity++. For an overview, enter man timidity. The Athena Widget Interface is a mature interface that is started with /usr/bin/timidity -iatv &.
You should not be in the directory /usr/share/timidity when you start timidity++.
To start timidity++ in the ALSA server mode, enter /usr/bin/timidity -iA -B2,8 -Os &. A message, such as Opening sequencer port: 128:0 128:1, will be displayed, showing the MIDI port by means of which the synthesizer can be addressed (e.g., with vkeybd --addr 128:0). To terminate timidity++, enter killall timidity to kill all timidity++ processes.