Linux Software Wavetable Support

There are two main packages available for performing software wavetable operations in Linux: TiMidity and SoftOSS. The former is a user-space program, which means you're restricted to playing MIDI files from TiMidity itself. You can't normally use TiMidity to handle MIDI music from games or MIDI editors. SoftOSS, on the other hand, is a kernel module that replaces access to your sound card's normal MIDI devices with a software wavetable device.

Both TiMidity and SoftOSS rely upon patch sets for the Gravis UltraSound sound card, such as MIDIA ( You can often find MIDI patch sets packaged along with TiMidity, as well. Most Linux distributions come with such a patch set, in a package called timidity-patches or midi-samples or something similar.

Using TiMidity

TiMidity is included with most Linux distributions, or you can locate it at file archive sites such as or The trickiest aspect to using TiMidity is configuring it. The program relies upon a configuration file called timidity.cfg, which can reside in the /etc directory or in some other directory that tends to vary from one distribution to another. This file specifies the association between individual samples and the instruments to which they correspond. For example, a configuration file might begin something like this:

dir /dos/ultrasnd/midi bank 0

0 acpiano.pat

1 britepno.pat

2 epiano1.pat

3 honky.pat

The first line specifies the location of the patch files—/dos/ultrasnd/midi. The second line indicates that the following specification applies to instrument bank 0, which handles most instruments. Subsequent lines assign a patch file to each numbered instrument—instrument 0

is an acoustic piano (acpiano.pat), for instance. (MIDI includes a standard set of assignments, 10

so instrument 0 should always be a piano, unless you want to achieve some instrument-

changing effects.) O

The timidity.cfg file can also contain a similar definition for drums, which begins drumset d

0 rather than bank 0. Some default configuration files use the source directive to push most of A

the configuration details into other files. S

Part III

When your TiMidity configuration is complete (as, with any luck, it will be upon installation), you can play a MIDI file:

timidity midifile.mid

The result will be a wavetable rendition of the MIDI file, albeit at high CPU use. On the AMD K6-2/475 system I use, TiMidity consumes 10%-20% of the available CPU time, depending upon the complexity of the MIDI file.

If you want a user interface that's a bit more appealing than the command line, you can use the -ic option to start TiMidity with a particular user interface. Type timidity -help | less to get a list of c values available on your system. (TiMidity can be compiled with many different interfaces, but chances are the binary you have supports only a few of them.) Figure 10.5 shows TiMidity using the Athena widget set interface.

ESP.MID I 1:14 I

jjjJU pau: Slop prev hank fwil nex! quil rani repi

Volume 70


A Track name Track name Track name Track name (Track name Track name Track name

Tchaikovsky Copyright (C) 1992 Voyetra Technologies B Piano B Celesta X Piano X Celesta

A GUI interface to TiMidity lets you control the MIDI playback dynamically.

On the whole, TiMidity can be a very useful utility if you lack a wavetable sound card and want to play an occasional MIDI file with better quality than you can achieve with FM synthesis. If you want high-quality MIDI playback from games or other utilities, though, you might be better off with SoftOSS—or better yet, a genuine hardware wavetable sound card.

Using SoftOSS

The Linux kernel includes a feature known as SoftOSS, which is a software wavetable function modeled after the wavetable features of the Gravis UltraSound (GUS) board. To use this feature, follow these steps:

1. Obtain an appropriate patch set for SoftOSS. SoftOSS uses GUS patch sets, such as the public domain MIDIA set

( Many Linux distributions include such patch sets, often as an adjunct package to TiMidity.

Chapter 10

2. Place the sound samples in the directory /dos/ultrasnd/midi. (Chances are you'll have to create this directory.) If you've obtained the samples by installing a package along with your Linux distribution, creating a symbolic link from this location to the default location will work.

3. Enable the SoftOSS software wave table engine support in the Sound area of the Linux kernel configuration, as shown in Figure 10.6. You can adjust the quality of the software wavetable by changing the sample rate and number of voices.

Figure 10.6

The SoftOSS feature turns any 16-bit sound card into a software wavetable sound card.

Figure 10.6

The SoftOSS feature turns any 16-bit sound card into a software wavetable sound card.

Was this article helpful?

0 0
The Ultimate Computer Repair Guide

The Ultimate Computer Repair Guide

Read how to maintain and repair any desktop and laptop computer. This Ebook has articles with photos and videos that show detailed step by step pc repair and maintenance procedures. There are many links to online videos that explain how you can build, maintain, speed up, clean, and repair your computer yourself. Put the money that you were going to pay the PC Tech in your own pocket.

Get My Free Ebook

Post a comment