TiMidity++ is a software synthesizer that can play MIDI files without a hardware synthesizer. It can either render to the sound card in real time, or it can save the result to a file, such as a PCM .wav file.

Fluidr3

There are other SoundFonts available. This will show how to install the fluidr3AUR SoundFont.

Now we have to add its path to the TiMidity++ configuration file. Just add this line:

/etc/timidity++/timidity.cfg

soundfont /usr/share/soundfonts/fluidr3/FluidR3GM.SF2

Daemon

Start and configure to autostart the timidity.service. Read Daemons for more details.

If you are using PulseAudio, that may not work. You may want to add the following command as an auto start program in your desktop environment. Or, if you just want to start TiMidity++ in daemon mode once, you can use the following command which will make console output viewable:

$ timidity -iA

Usage

Play files

There are two ways to use TiMidity++. Either as MIDI player or as daemon adding MIDI support to ALSA.

Standalone mode

You can simply use TiMidity++ to play MIDI files:

$ timidity example.midi

Add option -in or -ig for a text-based/gtk+ interface. E.g. as a Xfce/GNOME user you may want to set MIDI files to open with the custom command timidity -ig. There are many other options to TiMidity++. See man timidity or use -h to get help.

The GTK+ interface offers such features as a playlist, track length estimates, volume control, a file load dialog box, play and pause buttons, rewind and fast forward buttons, as well as options to change the pitch of or speed up or slow down the playback of a midi file.

Daemon mode

If you are runing TiMidity++ as a daemon (ALSA sequencer client), it will provide MIDI output support for other programs such as rosegarden, aplaymidi, vkeybd, etc.

This will give you four output software MIDI ports (in addition of hardware MIDI ports on your system, if any):

Option --addr 128:0 connects the input (readable) software MIDI port provided by vkeybd to the first output (writable) ALSA port provided by Timidity. Alternatively you can use aconnect(1), community/aconnectgui or AUR packages patchage, kaconnectAUR. As a result when you play around with the keys on the vkeybd TiMidity++ plays the appropriate notes.

Connect to virtual MIDI device

Once you have the TiMidity++ daemon running and it is working with aplaymidi, you can connect it to a virtual MIDI device that will work in programs such as rosegarden or scala.

Load the snd-virmidikernel module and (optionally) configure it to be loaded at boot. Read Kernel modules for more information.