If you want to work with soundfonts, you'll definitely want to have Josh Green's excellent Swami in your toolkit. Swami is a powerful soundfont editor with a well-designed GUI and a wealth of useful features (Figure 5). You can edit and create composite instruments or individual samples, and you can design your own SF2 banks. Swami also utilizes Peter Hanappe's
iiwusynth, a software synthesizer that uses soundfonts as fuel for its synthesis engine. The program really deserves an article of its own, but I can tell you that using Swami is very easy, so I won't say more about it here. Just get it and have fun ...
Figure 5: Josh Green's Swami in action
If you are truly hardcore and swear by the definitively cheesy sounds of the OPL3, then you must have John Meacham's OplEdit. This handy little program presents the OPL3 FM synthesis parameters in a simple interface for editing existing patches or creating new 2- or 4-operator sounds. No bank editor, sorry, but the program does have a neat patch randomizer. By the way, starting OplEdit with the
-d /dev/midi1 option sets up the editor to listen for any MIDI messages arriving on my first ALSA virtual MIDI device, allowing realtime sound editing. For example, I can route the output from the
pmidi MIDI file player to /dev/midi1 by setting its port flag to the device's port number (determined by running
pmidi -l). I can then create and edit patches in realtime while
pmidi plays the MIDI file of my choice. (Note: The astute reader may wonder what happened to /dev/midi0. ALSA recognizes the CS4232 as the first soundcard in my machine, and /dev/midi0 belongs to that card. The devices themselves are actually ALSA's /dev/snd/midiC0D0 (/dev/midi0) and /dev/snd/midiC1D0 (dev/midi1).)
Figure 6: John Meacham's OplEdit dignifies the OPL3
I recently discovered that the STEEM Atari ST emulator can communicate with Linux's /dev/midi. I have some external MIDI equipment, so I was pleasantly surprised to find that XSteem (STEEM for X) worked with my ALSA MIDI system. STEEM's audio hardware support is emulated only for the SoundBlaster16, but that's enough to give access to the MIDI hardware (/dev/midi) and the PCM device (/dev/dsp) of the basic OSS/Free API. As already noted, my laptop has no MIDI interface hardware, but after working with TiMidity++ as an ALSA server/sequencer I wondered if I could wire the output of an Atari MIDI application from STEEM to TiMidity++. So I fired up TiMidity++ with the options shown above, then I started XSteem and Bob Ham's excellent ALSA MIDI patch bay (a GUI for ALSA's
aconnect utility). I connected ALSA's virtual MIDI port 0 (
== /dev/midi1 in Xsteem) to the TiMidity++ client (Figure 7), and voila, I had the output from an emulated Atari ST MIDI program routed to the GUS patch set via TiMidity++. None of this activity would matter much if it weren't for the fact that the Atari ST/Falcon computers acquired many excellent MIDI sequencers, notation editors, and synthesizer patch editors and librarians. Atari MIDI software also boasts an outstanding collection of algorithmic and experimental composition programs, many of which are now available for free at Tim's Atari MIDI World (see Resources). I've been able to run David Zicarelli's M, Jim Johnson's Tunesmith, and Clarence Barlow's Autobusker on my Omnibook via ALSA's
virmidi module, which to my mind is just very cool.
Figure 7: The ALSA MIDI Patch Bay making its connections
Xsteem's performance is good under normal user conditions, but the quality of the timing is improved greatly by launching TiMidity++ as root. Doing so will ensure that the rendering engine will run
SCHED_FIFO (i.e., the Linux scheduler will give it a high priority).
Figure 8: Xsteem presents Jim Johnson's Tunesmith algorithmically playing away on a GUS piano patch
So What's Your Sound Like?
After going through my own Linux laptop audio setup gauntlet, I decided to poll the members of the Linux Audio Users mail list to see what they are getting from their machines and to ask how they made it happen. The results were quite interesting, and I've prepared a separate page tabulating the LAU responses (Table 1). I would like to keep the table current, so please contact me with your own Linux laptop audio information and I'll add it to the list.
My experiments go on: I have yet to work with any PCMCIA audio cards, and I have not checked out serial port MIDI interfaces or USB audio devices. I'm also eager to test other emulation environments on this machine, particularly DOSemu and UAE (the Universal Amiga Emulator). But I'm out of space now, so you'll either have to wait on my next report or write one yourself. Meanwhile, I hope this article has indicated what you need to know and may have to go through in order to successfully set up sound on your own machine. If you'd like to share your experiences with me, feel free to write to me at email@example.com or via the LAD/LAU mail lists. Now go forth with your Linux laptop and make a joyful noise!
I must give vast thanks to Dev Mazumdar at 4Front Technologies and to Takashi Iwai at ALSA for their assistance while I wrote this article. Thanks also to the crews on the LAD/LAU mail lists for being such creative and informative people: I'll see you all in the bitstream!
- Linux On Laptops
- Linux Laptop HOWTO
- Takashi Iwai's Patches
- ALSA MIDI Patch Bay
- Tim's Atari MIDI World
- Linux Audio Developers Mail List
- Linux Audio Users Mail List
Return to the Linux DevCenter.