Search Gear
 

Sounds from Another Planet

January 1, 2004
share

For more than ten years, Linux has been gaining ground as a favoriteplatform for die-hard techies, power users, and programmers. Morerecently, Linux has moved into the corporate mainstream, oftenreplacing costly servers based on proprietary technology.


Illustration by Laura Williams

But when you perform a fresh Linux installation, you don'tnecessarily have a low-latency platform for music and audio production.That's where Planet CCRMA comes in. Assembled by the folks at StanfordUniversity's Center for Computer Research in Music and Acoustics(CCRMA), Planet CCRMA transforms a Linux system into a lean, mean,audio-production machine. And here's the best part: it's free. (Forbackground on how Planet CCRMA came into being, see the sidebar“In the Beginning…”.)

WHY LINUX?

With so many excellent applications available on Windows and Mac,why would anyone even bother with Linux? For starters, command-lineprograms are still in favor on Linux, and there are times when a fancyGUI just isn't appropriate. For example, you may need to process audiobehind the scenes in an amusement-park attraction or in a handhelddevice for the field. Linux has been known to fit in very smallfootprints.

Command-line programs are highly conducive to automation, and Linuxincludes plenty of automation tools. In a matter of minutes, you canwrite a “script” to identify all of your WAV and AIFFfiles, resample them to 48 kHz, add half a second of silence, and storethem on a file server. If you want this to happen every night atmidnight, it can.

Linux applications, whether GUI-based or command-line driven, makeno assumptions about where your keyboard, mouse, and monitor are. Ifyou want, you can stick five PCs in a rack, connected with nothing morethan power cords and Ethernet cables. You'll be able to runapplications on all of these machines simultaneously, using a keyboard,mouse, and monitor attached to any Linux machine. What's more, the GUIscreens from all of these machines can appear side-by-side on a singledesktop. Massive software synthesis, anyone?

And Linux is free, so you can load up all of those rackmounted PCswithout having to worry about how many licenses you purchased.Typically, the applications you run are also free, and source code isusually available for everything. Since Linux comes with a full suiteof development tools (also free), you can customize and extend anyprogram you use.

GET SET

Linux is open-source software, and it carries no licensing fees. Youcan get the Linux source code straight from the development community,compile it yourself, and cobble it together on your hardware. But theeasiest way to get up and running with Linux is to use a prebuiltdistribution from an organization like RedHat, SuSE, or Debian.

These Linux distributions contain the Linux operating system andlots of useful applications written by developers all over the world.The makers of these distributions typically put a user-friendlyinstallation routine on top of this collection of software and packageit all together with a pretty box and manual. You typically pay amodest fee for such a package, or you can download the distribution forfree from the Internet and burn your own CDs (you can even installdirectly from the Internet if you want to).

Depending on how Linux is configured and adjusted, it is capable ofperforming widely different roles: one Linux machine may act as ahigh-speed network packet router, another may be serving up thecompany's Web pages, and a third might be providing basicoffice-productivity applications like spreadsheets and wordprocessors.

Or maybe you'd rather set it up for audio, video, and MIDI —Planet CCRMA will show you the way.

EVERYTHING TO EVERYBODY

Planet CCRMA installs into RedHat only, so I'll zero in on thisparticular distribution. Since the folks at RedHat don't know howyou're going to use your system, they provide a general-purposeinstallation that provides a reasonable (but not necessarily optimal)platform for whatever you may want to do with it.

What's more, a default RedHat installation tends to be somewhatconservative. Its performance-tuning parameters won't necessarily pushyour hardware to its limits. And a machine running the “latestand greatest” RedHat distribution will often contain softwarethat is several versions older than what the developers havereleased.

There's a good reason to err on the side of caution. RedHat wantsmajor corporations to adopt its Linux distribution for use inenterprise-wide deployments, and major corporations want stability andeasy installations on a wide variety of machines. So when RedHatassembles a new version of its distribution, they use versions of thecore Linux software and applications that have seen plenty of use inthe real world, and they test the whole package to ensure it will besafe and stable on all kinds of hardware.

Planet CCRMA provides three things you need to transform yourgeneral-purpose, default RedHat installation. First, you get a“tuned” Linux kernel that is optimized for low-latencyoperation. (The kernel is the innermost core of Linux and operatesdirectly on your hardware. Everything else communicates with thekernel.)

You also get an advanced Linux sound architecture, which isn'tprovided in the RedHat distribution. This architecture is actually acollection of interrelated projects, with interesting names like ALSA,Jack, and LADSPA (I'll cover each of these in detail later on). WithoutPlanet, you'd have to download, compile, and configure each of thesemanually.

Finally, you get a huge set of applications that can take advantageof this turbocharged audio foundation. It's important to note that muchof this software is created by folks who have nothing to do with CCRMA.Planet CCRMA represents a convenient packaging job for applicationsthat are created by a host of different people in locations all overthe world. You can acquire all of this software directly from thedevelopers, but you'd have to visit a ton of Web sites to get it.

CREATING A PLANET

Before I could set up Planet CCRMA, I had to establish a workingRedHat Linux machine in my studio. I downloaded installation-CD imagesfor RedHat from a mirror site at Georgia Tech and burned the CD-ROMsusing software in Windows. Be aware that these are huge downloads. Ifyou don't have a broadband Internet connection, you'll probably want topurchase the CDs from RedHat instead. Now would also be a good time toread the “Preflight Checkup” sidebar to make sure you'rementally prepared for this endeavor.

I dedicated an unused disk partition on my main studio computer toLinux and proceeded with the RedHat installation. A completedescription of this process is beyond the scope of this article, butthere are plenty of resources available to help you with it (see thesidebar “Resources and Links”). Linux can coexistpeacefully with other operating systems, so I set up a dual-bootconfiguration that let me switch back to my commercial software inWindows 2000 whenever I needed to.

All of the Planet CCRMA software is located on the CCRMA Web site orone of its mirrors. This represents another huge download, but onceagain you have options. I have a fast Internet connection, so I choseto install everything online. You can also download CD-ROM images,however. That option is handy if you have a friend or workplace with abroadband connection, but lack one yourself.

Planet CCRMA uses a special installation tool that must be installedfirst. Once in place, this tool remembers the location of the CCRMArepository (whether it's on your CD or at Stanford University) anddramatically simplifies the process of downloading and installingapplication files.

Next you must replace RedHat's default kernel and sound drivers. Thecommands for doing this are straightforward, but because of thelow-level nature of these operations, you do have to edit some systemfiles and such (all of this is described on the Planet CCRMA Web pagein a step-by-step fashion).

This is the point at which you're most likely to run intocompatibility problems with your hardware. If you can't bring up thenew kernel, Planet CCRMA provides an alternate “safer” onethat contains just enough changes to run the audio platform, but at thecost of higher latency.

The sound drivers come from the ALSA (Advanced Linux SoundArchitecture) project. There's more to ALSA than just the drivers, butI'll get to that later.

Before jumping into a Planet CCRMA installation, you need to checkthe ALSA Web site to make sure that your sound hardware is supported.Unfortunately, neither my Lynx Studio LynxONE nor my MOTU 828 has ALSAsupport as of this writing. However, many multichannel professionaldevices are supported, particularly models from Echo DigitalAudio, RME, and M-Audio. Some USB devices require special installationsteps, but Planet CCRMA makes easy work of these (I know this because Iinadvertently did it the hard way for my M-Audio Midisport2×2).

Many consumer-grade devices are also supported, so that SoundBlaster in the junk drawer is likely to work. The built-in soundcircuits on my Intel motherboard had support, as did the sound chips inmy laptop. But be sure to read the fine print on the ALSA Web site— in the case of my laptop, “supported” meant“for playback only.”

Once you have your new kernel and drivers running, the rest is easy.Planet CCRMA provides detailed instructions on tuning your system, butmost of these steps aren't necessary with recent versions of Linux. Atthis point, you're ready to load all the applications. I executed asingle “download and install everything” command and wentto bed. The next morning, I was ready to rock and roll.

AUDIO PATCHWORK

Before ALSA, Linux typically came with OpenSound System (OSS) sounddrivers. These drivers provided reasonable support and performance fora variety of devices, but they weren't necessarily low latency.However, older Linux sound applications may not be written for ALSA, soyou need to be aware of OSS (ALSA can emulate OSS if necessary).

If an application supports ALSA drivers for both audio and MIDI,it's likely to have excellent performance as a standalone program. Butyou're missing out if you stop here, because the real power of thisplatform exists in its support for sound applications that communicateand integrate with each other.

There are several integrating technologies at work here. For MIDI,there's the ALSA Sequencer interface. Applications that support thisinterface can “publish” their inputs and outputs, allowingother applications to connect to them. If a MIDI-based drum machine anda MIDI sequencer both provide ALSA Sequencer support, you could recordthe activity of the drum machine by simply connecting it to thesequencer.

You can do the same with audio using a technology called Jack. AnyJack-aware application can connect its output to the input of another.Want to record your soft synth with your audio-recording program? It'sas easy as connecting them together.

My physical audio and MIDI connections are always available for use.When I'm ready to record from or play back to the outside world, Isimply connect the ports I'm using to the applications that will dosomething with them.

There are several programs you can use to make these connections.Typically, these present the available “writers” on theleft and the “readers” on the right. You connect a writerto a reader by selecting them and pressing a button. I settled onkaconnect for MIDI connections and QJackConnect for audio (see Fig.1).

PLUG IT IN

Many Linux audio applications support the LADSPA (Linux AudioDeveloper's Simple Plug-in API) plug-in architecture. Roughlyequivalent to the DirectX or VST plug-ins that you're probably familiarwith, the LADSPA plug-in architecture allows a single set of audiotools to be shared by all of the audio applications on your system.

More than 100 LADSPA plug-ins are installed with Planet CCRMA, andthere are quite a few applications that can take advantage of them. Ifound flangers, delays, reverbs, filters, phasers, and all sorts ofother audio manglers. Many are quite good, some are mediocre, andothers are downright goofy.

The real magic starts when all of the pieces (ALSA, Jack, andLADSPA) come together. Here's an example: I connected a MIDI fileplayer to a software synthesizer using the MIDI patch bay in kaconnect.Then I found an application called Jack Rack that allows you toassemble a chain of LADSPA plug-ins and use them in real time

I configured an interesting set of LADSPA effects in Jack Rack androuted the audio from the software synthesizer into it (usingthe audio patch bay in QJackconnect). Then I connected the output ofJack Rack to studio monitors and an audio-recording program. What'smore, I could connect one of my physical MIDI inputs to Jack Rack andcontrol effects parameters in real time. The whole setup worked like achamp, which is particularly impressive when you consider that each ofthese programs was written by a different person in a different part ofthe world.

If I needed visual feedback on all of this, I could have easilystarted the “meterbridge” program and inserted it in themidst of any of the audio streams listed above. This notion of extrememodularity is quite pervasive in the Linux and UNIX worlds. For years,Linux users have been stringing together simple commands to makecomplex operations take place.

BRING ON THE APPS

There are well over a hundred packages that can be downloaded fromthe Planet CCRMA site. There's simply no way I can cover all of them— most of these programs are so deep that I can only scratch thesurface of the ones I do cover.

I'll mention my favorites, focusing solely on the audio and MIDIapplications (Planet CCRMA contains video, multimedia, and systemapplications as well). For electronic musicians, the most interestingapplications are the ones that support Jack for audio, the ALSASequencer Interface for MIDI, and LADSPA plug-ins.

I'll start with a full-featured digital audio workstation calledArdour. This program rivals similar commercial applications infunctionality, with support for 24 or more channels of 32-bit audio.You can manage your recorded audio in an intuitive editing window (seeFig. 2), automate your mix with graphical envelopes, or mixeverything down in a separate mixing screen, complete with graphicalcontrols and level displays.

Command-line applications are still alive and well on the Linuxplatform, and a remarkable audio package called ecasound operatescompletely without a graphical interface. But that doesn't mean it'sshort on power: In addition to playback and recording, ecasound can beused for mixdown, effects processing, and format conversions. It evenlets you manipulate audio in real time with MIDI continuouscontrollers.

Ecasound's mode of operation is remarkably simple. Specify audiohardware as inputs and a file as an output, and you're recording. Do itthe other way around and you're playing back. Using nothing butcommand-line statements, you can build “chains” ofarbitrary complexity, allowing you to do just about anything with youraudio.

There are several audio editors in Planet CCRMA. I like Snd. It'salmost unnoticeable when it opens; all you see is a tiny menu bar. Butthe deeper you go, the more you realize what you can do. Snd can becompletely customized with a programming language called Scheme (whichis similar to Lisp). The learning curve is steep for this program, butthere's not much it won't do.

MIDI MAYHEM

On the MIDI front, there are two heavy-duty sequencers available:Muse and Rosegarden. Both have many of the features you'd see in MIDIsequencers on other platforms, and you can record or import audio intoeither application. However, these integrated audio capabilities aren'tquite as refined as what you see in the commercial applications onother platforms.

I think Rosegarden has the cleaner user interface (see Fig.3). In addition to the typical track, event-list, and piano-rollviews, Rosegarden lets you see your music in standard notation, whichis great for a free program. Rosegarden also allows you to you exportmusic for use by Csound or LilyPond (described shortly).

Muse has a few features not found in Rosegarden, including a nicemixer window and integrated access to some of the software synthesizersavailable on the platform. I had a hard time picking a favoritesequencer — I'll probably use either or both, depending on mycurrent project.

I did have trouble syncing these applications to other programs,however. Judging by their GUIs, Muse and Ardour can both act as MIDITime Code masters or slaves. I should have been able to route MIDI fromMuse to Ardour (or vice versa) and have MIDI and audio running inlockstep. But neither app seemed to recognize synchronization messagescoming from the other. I asked about this issue on a few mailing lists,and a few users described similar experiences.

Rosegarden and Ardour seem to support the Jack Transport Interface,which is a new development intended to allow synchronization usingJack. But again, the applications wouldn't sync to each other (thedevelopers of both applications informed me that they haven't yetimplemented the latest version of this interface). All of theseapplications are in active development, so the situation should improveby the time you read this.

THAT SOFT SOUND

There is no shortage of software synthesizers in Planet CCRMA. Icounted at least eight that profess to be nothing but a softwaresynthesizer (there are plenty of other programs that can generate theirown sounds).

One of the most useful synthesizers is probably the least flashy ofthe bunch. FluidSynth can load multiple SoundFont files and play on 16MIDI channels at once. And it does so without a graphicalinterface.

Once you've loaded your SoundFonts, you can choose among the loadedinstruments using MIDI Bank Select and Program Change messages (orthrough command-line instructions). And if you need to create or editSoundFont files, a nice editor called Swami is close at hand.

There are synthesizers with graphical interfaces as well, includinga couple that let you patch together modules in any configuration youchoose. My favorite is AlsaModularSynth (see Fig. 4). Thissoftware synth has a clean, intuitive interface, powerful capabilities,and lots of included example patches.

If building your own modular synthesizers isn't challenging enoughfor you, you can go deeper. Planet CCRMA includes Csound (covered indepth in the July 2002 issue of EM). Also included areextensions to the Lisp programming language that enable you to generatesound, write music, and create music notation from within the Lispenvironment.

AND EVERYTHING ELSE

Speaking of notation, Planet CCRMA includes LilyPond, which takes aspecially formatted text file and converts it into printable musicscores. I was only able to try out this program with some trivialexamples, but by all accounts, LilyPond excels at creating gorgeousscores that rival hand engraving (check out lilypond.org if you'd liketo see how they do it). For those who object to creating scores bytyping text files, there are other programs in the Planet that canexport the LilyPond format.

There are many more applications in Planet CCRMA — I found DJtools, a high-quality sampling-rate converter, CD-burning software, anda modular audio and MIDI-processing package called Pd that resemblesCycling '74's Max/MSP (Pd was developed by Miller Puckette, who alsodeveloped the original version of Max. And there are plenty of handyutilities for smaller tasks, such as MIDI file playback, sound-cardcontrol, and format conversion.

Can you perform real work on this platform? Absolutely. Sounddesigners, composers, and musicians alike will find tools on Linux thatthey can't find anywhere else. I would be a bit wary of booting up someof these tools in the midst of an expensive recording session (at leastnot until they become more stable and mature); home recordists,however, should find plenty of valuable software here.

My biggest problem was the distraction factor: there is so much toexplore and discover, I found myself playing with all of these goodiesinstead of actually making music. But that's a good problem to have,and you certainly can't beat the price. So if you're ready to travel tothe brave new world of Linux audio, download Planet CCRMA and strapyourself in.


Allan Metts is an Atlanta-based musician, software andsystems designer, and consultant.

IN THE BEGINNING …

Planet CCRMA is actively maintained and supported by FernandoLopez-Lezcano, who is a lecturer, composer, and system administrator atCCRMA. I asked him how the Planet came into existence and learned thatit didn't really happen intentionally — instead, it evolvedorganically. Over time, students and faculty began using Linux insteadof the NeXT and SGI workstations that had primarily been in usepreviously. Many of the music and sound applications they were usingwere ported to Linux as well.

Lopez-Lezcano started creating installation packages to ease themaintenance and configuration headaches associated with the Linuxmachines. Then he started incorporating some of the low-latencycapabilities and drivers that were under development.

“Eventually it became obvious that some students and facultymight want to install Linux at home and add the packages I had createdto their machines,” says Lopez-Lezcano. “At first I justpointed them to the collection of packages I had in the server, andmuch later I created a Web page to better organize the packagecollection. So that was the start of Planet CCRMA.”

Today, Planet CCRMA is thriving, with an active mailing list and awell-organized Web site. On the site are comprehensive installationinstructions and detailed descriptions of each of the Planet'sapplications. What's more, there are three mirror sites, which ensuresthat you can download all of this software from a location nearyou.

PREFLIGHT CHECKUP

Installing and using Planet CCRMA is a fascinating journey. Butbefore you embark on this trip, you need to give yourself a littletest: Are you intrigued by technology, or do you need for things to“just work” for the sake of your music and your projectdeadlines? Do software failures cause you to curiously dig to the rootof the problem, or do they cause you to write angry letters to companypresidents?

The current state of this technology is far from a “one-buttoninstallation.” But if you are reasonably savvy with technology,and if you stick to the script, you'll be fine. However, you do need aworking understanding of Linux and how to get around in it (or at leasthave access to a friend with these qualifications). There are plenty ofbooks available on the subject if you need to study up a bit.

If your hardware is supported and all goes well, you'll be makingmusic in no time. If things don't go smoothly, you may find yourselfmessing with device-configuration parameters and adjusting low-levelparameters in the operating system.

But you are not alone in your suffering. Interestingly, I findsupport in the open-source community is often better than the support Iget from commercial software vendors. There are Internet sites andmailing lists devoted to all of this software, and a good Google searchwill usually lead you to someone who has seen your problem before. Andas long as you ask your questions clearly and politely in theappropriate forums, some kind soul will usually help you out. Often,you'll actually be talking to the very person who wrote the code in thefirst place (as opposed to an entry-level tech support representativeat a commercial firm).

RESOURCES AND LINKS

Advanced Linux Sound Architecture (ALSA)
www.alsa-project.org

Free Software Foundation
www.gnu.org

The Linux Documentation Project
www.tldp.org

Linux in a Nutshell, 4th. ed., by Ellen Siever et al.(O'Reilly & Associates, 2003)
www.oreilly.com/catalog/linuxnut4

Open Source Initiative
www.opensource.org

Planet CCRMA
www-ccrma.stanford.edu/software/planetccrma

RedHat Linux
www.redhat.com/download/products.html

Show Comments

These are my comments.

Reader Poll

Do you use music streaming services?


See results without voting »