Linux DevCenter    
 Published on Linux DevCenter (http://www.linuxdevcenter.com/)
 See this if you're having trouble printing code examples


Semi-Pro Linux-Based Recording

by John Littler
06/24/2004

First, a cheer to the people who've been writing the code for these apps that make it possible for me to write an article like this. Make that plural -- cheers! Not so long ago, an article about making a semi-professional music studio with Linux would have seemed more optimism than reality. Not so now. It is still true that putting the components together for a music studio can be time-consuming, but this is true of any complex music-making program on any platform, not just Linux.

What's Semi-Pro?

(A quick look at aspects of a pro studio including interoperability and gee-whiz stuff.)

Let's look at a pro studio. Within your market segment, you'll need to interoperate with other studios and will need gear and software that is known and widely used. If you want to have eccentric moments, you'll need to have them in some kind of secondary studio room.

In a certain segment of the market you'll need many-input SSL desks and the likes of Westlake monitors with dual 15s for the bottoms. Once you've heard this sort of setup, you'll want it. Also remember that while you were listening to that very expensive studio setup, you were doing so in a carefully crafted silence that is also very expensive to achieve.

In lots of ways, a semi-pro setup is more fun. You can do exactly what you want, and if no one else on the planet understands how it works or how to turn it on, who cares?

Learning Lab TigerLinux/Unix System Administration Certification -- Would you like to polish your system administration skills online and receive credit from the University of Illinois? Learn how to administer Linux/Unix systems and gain real experience with a root access account. The four-course series covers the Unix file system, networking, Unix services, and scripting. It's all at the O'Reilly Learning Lab.

For now, let's say that semi-pro means good quality output, but not necessarily the last word.

The Studio Chain

There are several components of the studio. In rough order, they are: room, inputs, mixers, soundcards, computer, monitors, and outputs. We'll treat them individually.

Room

Ideally, we don't want noise from outside. Neither do we want to pollute our neighbors' lives. What you have available in the way of a room might well determine what you can do. If you live in an acoustically transparent apartment in a big, busy city, the only sort of live recording you will be able to do without spending money and time on sound deadening is the sort that actually incorporates your sonic background. Hopefully, it won't have your neighbors taking out contracts on your life.

In that sort of situation, you may do well with electronic music monitored with headphones.

The actual design of the acoustics of the monitoring space is another subject again, and somewhat subject to the vagaries of fashion. Live end/dead end is one example of a design philosophy. This setup has some reflectivity at one end of the room and very little at the other. You can achieve these sorts of effects cheaply by using thick carpets in ways that might aesthetically offend those who have to share the space.

Have a look at specialist reading on the subject; Fostex used to have a nice booklet on arranging domestic studios, and might still have.

Inputs

Buy the best inputs you can afford. Cheap leads, for example, whatever their sonic qualities, will develop intermittent faults and drive you completely nuts as well as wasting time. Mics may or may not be crucial to your plans. We'll come back to them in a minute.

Mixers

If you are planning to do any sort of recording or mixing of multiple tracks, you'll need a mixer or control surface. A mouse and GUI are fine, useful things, but they can't be in two places at once. Fingers can.

Mixer choice is very personal, so go to the shop and play. Mackie and Soundcraft are good brand choices for our semi-pro studio. Some people say that Behringer models are quite okay, while others say they are wooly. Some people also like some of the small digital mixing desks, and the Yamahas are popular.

Related Reading

Linux Music & Sound
How to Install, Configure, and Use Linux Audio Software
By Dave Phillips

Soundcards

If we're talking semi-pro equipment, we should talk about a limited subset of the cards we can use in Linux. Let's start by mentioning the RME cards and the M-Audio series. The more sophisticated cards allow for high sample rates, multiple inputs and outputs, low noise, and full-duplex operation. Full duplex allows signals to travel both ways simultaneously. In other words, you can monitor inputs at the same time as recorded tracks -- just what you need when adding a vocal track to an already recorded instrumental background, for example.

Occasionally, you'll find that the Linux driver doesn't support a card's full capabilities. Do your research! We'll discuss this in a moment.

Computer and Monitor

Recording two or three tracks and mixing them with few effects doesn't require much computing power. If you render your effects in non-realtime, you can use fairly ancient hardware -- a PII is conceivable. Having lots of RAM and gobs of disk space will help, though.

For lots of tracks and lots of realtime effects processing, then the faster your setup, the better. Lots of RAM is good for holding large files in memory. For storage, SCSI disks used to hold the lead. They're still fine, but more people have started to use fast-spinning ATA hard drives.

GUI apps take up a lot of screen space. If you want to record a large number of tracks, you might need a large screen. A dual-headed setup is a useful option, even though we can take advantage of multiple desktops on Linux.

Monitor Speakers

You can't mix music properly if you can't actually hear what's there. For monitors in our semi-pro studio, one good approach is to consider self-powered, active, bi-amped small speakers. Mackie makes a very nice model, and cheaper, though still good, options come from Yamaha, Genelec, and Tannoy. Some of them are quite compact, too.

For a general look at speakers, see my MStation article that looks at different aspects of speakers.

There are also some very good headphones available, but it can be difficult to put together a good stereo mix for speakers on them.

A variety of people use surround sound. I don't have space here to explore it fully, but if you're recording for domestic devices, you could just use one of the better quality domestic systems.

Outputs

By outputs I mean Red Book CDs and different file types such as WAV, MP3, and Ogg Vorbis. We need to able to produce compressed files, even if some of us (me) think that compressed music sucks. I've recently published a recent test of various output formats.

Types of Music

The primary type and genre of music you intend to record has implications on how you put together your studio.

Classical and Acoustic

Here we want purity and smoothness throughout the signal chain. This is the most expensive of the categories here; mic and mixer quality is essential. For mics, think Neumann (a solidly pro brand if ever there was one), with some models of Shure as a minimum. If you're recording this kind of music at home, you also need a very quiet space.

Electronic

If there's a natural category for our semi-pro studio, this is it. If you don't having any acoustic instrument additions, you won't even need a mic. You will most likely need a music keyboard, as entering notes with a mouse is unbelievably tedious, but you can use software keyboards and the computer keyboard for entry if the budget is very tight.

Grunge

Some might say that with grunge you don't have to worry about any sonic quality, but although distortion is welcome, you'll usually prefer a certain sort of distortion that can be as difficult to produce as purity. If you really want to do this, consider assembling a second-hand analog studio using tape. There are some nice and cheap tape decks available, but beware of the costs of tape head replacement. Not that you can't do grunge on digital.

The attractive thing about tape is that the second-order distortion that tape produces is quite human-friendly. You can also buy second-hand gear cheaply that once cost a small fortune -- Studer mastering machines, Otari multi-tracks, and the higher end of brands such as Teac and Fostex. I'm not the only person thinking this way, as prices in some parts of the world have gone up again.

Linux

With some rough ideas for the available equipment, let's consider what Linux has to offer for our studio. The use of Unix for audio has grown over time. In the early days of Linux, the first audio apps were ported from flavors of Unix. At that time, mostly academic circles used Unix for audio with programs such as csound and snd.

The growth of Linux has also seen a growth in specialized development communities. Audio production is no exception. As a result, there is quite a variety of applications to use.

The most encyclopedic list of Linux audio apps is at Dave Phillips' Sound & MIDI Software For Linux. The items on the list are not rated in any way, so you will need to test them for yourself. Some are small hobby projects by beginning developers, and some compare quite well to big commercial projects with teams of experienced developers.

Mstation.org has a variety of developer chats and articles on its software page and also articles on "making it" in the music section.

Linux Audio Dev is a mailing list where developers exchange information.

Linux Audio Users and Alsa Users are also mailing lists.

Another resource is the ALSA project. This was intended as a replacement for the then-current OSS/Free driver set. One of the aims of the ALSA project has been to create a more useful and usable API for higher-level audio devices. The ALSA drivers are now in the 2.6 kernel, so I'll say no more about OSS or OSS/Free.

One of the extremely useful things at the ALSA web site is their sound card matrix. Here you can check on the status of any card you're thinking of adding to your system.

Example Linux Apps

After you've decided which card or cards to use, the next step is to put together some applications to use for your music projects. Doing this on a one-by-one basis can be hard work, especially if you're not very experienced with handling libraries. One of the frequent causes for dismay among beginners is downloading a beautiful application only to find that it has megabytes of essential dependencies to track down and install. If you're using RPM, you may descend into RPM hell, where everything seems to clash with everything else.

As a good example of what not to do, when I first started with Linux audio, I added to an RPM system by willy-nilly, compiling any libraries I wanted. The system behavior grew more and more bizarre until a conversation with Eric Teidemann revealed that some libraries do not like to share the same roof with others.

These days there's a good and painless way around all of that. There are specialized collections of audio apps and even full-fledged distros that concentrate on bundling software that plays well together. They include:

One of the important issues addressed by a specialized distro or add-on is the one of latency. When processing music we want as little system lag as possible, and different techniques have developed for dealing with this with different kernels. For a background on this, see the Low-latency mini-how-to.

Now let's look at some apps.

Ardour and Others

Ardour is a recording application. In some ways, it is the Linux audio flagship: it is big and complicated, it has the ambition to compete with the likes of Pro Tools, and it is very good indeed. One caveat is that just as you wouldn't expect to know your way around Pro Tools in five minutes, don't expect to know your way around Ardour, either. Its great flexibility and power mean that you will need to read and experiment. There is a manual in development (though the author requests payment) and scattered tutorials for specific circumstances on the Web.

For quickly recording and editing a small sample, you can choose from a host of other apps, including audacity and good old snd. Another powerful recording app is Ecasound. This can be command-line or GUI, and with a little thought, can be used on machines with very low resources.

MIDI Apps

For some sorts of music, sequencers are a valuable tool. Jazz++ was the original big sequencer that handled audio for Linux. The new contender is Rosegarden, which does much the same thing, except has active development.

Trackers

Trackers still have their adherents, primarily among the electro-dance set. Some interface with MIDI. The main contender used to be Soundtracker, but development has stopped and you will need an old version of ALSA to run it. Cheesetracker is a newer alternative.

JACK and LADSPA

JACK and LADSPA aren't apps. JACK is a protocol for Linux apps to share audio and LADSPA is a plugin protocol. This is part of a design philosophy that prefers small applications working together rather than one huge application that does everything, an analogue of the way Linux development itself works.

To use these JACK with the LADSPA collection of plugins, start JACK with jackd -d alsa (or whichever sound system you prefer), then use something like jack-rack to load effects into the stream.

An Example

Let's have a little session where we use Ardour to record the output of a drum machine, a synth, and some voice.

First, start JACK with the command jack -d alsa or equivalent. Alternately, use qjackctl.

Next, start jack-rack and examine some of the effects you can add.

To see your available connections, start qjackconnect. This will display the ins and outs available. At this point, you should only see jack_rack and alsa_pcm.

Now we need some input. Start hydrogen and play around to make a pattern or two.

Also start zynaddsubfx. Click on vK to bring up the keyboard on screen and play around some here too. Sometimes the sound seems to magically make its way to an output, but in theory, you should use qjackconnect to send outputs to inputs. For zynaddsubfx (you'll remember after typing it twice) click on the + icon in front of the app name to reveal the outputs. Highlight and connect them to alsa_pcm playback. Away you go!

Start ardour and add the inputs in the mixer section (edit section). Maybe you've made a nice pattern in Hydrogen, so let's start with that. Because Hydrogen has stereo output, we'll dedicate two tracks to it. Click on Record in the mixer strip, then click the red circle in the transport (the top left corner of the edit window), click the play icon, and click play in Hydrogen.

Oops, we didn't set the levels! Go to the mix window and do that now with the fader. When you've finished recording, click Stop in the transport.

Now let's add some synth. We can practice if we start Ardour playing tracks one and two while we tinkle away on zynaddsubfx. If you can't hear the synth, check qjackconnect. If you jump the gun and disconnect the synth from alsa_pcm and connect it in Ardour to the next track, you won't hear anything while the drums play. At least, I didn't. Set track three to record, click on the red button and play, and then play along with the drums.

So it goes. Note that so far, any extraneous noise has been irrelevant.

Now let's add a little voice by adding another input and making the appropriate connections for the mic. Alternately, you could use a simple recording app to record the voice and then import it into Ardour. (I had to do this because my test machine has no mic-in at all. So I recorded it elsewhere and transferred it over the network.) When you've finished, choose Export Session from Ardour. You can use Audacity to produce an Ogg Vorbis file from the WAV and to do some cleaning up if you wish.

When you're done you probably won't end up with anything like this, which I recorded as I wrote this. One weird thing is that, in playing this Ogg Vorbis file on the test system with XMMS, the word "girl" after "beautiful" disappears completely. Weird! Alsaplayer played it fine. The mic was a medium-priced AKG held too close to the mouth to reduce background noise.

Another weird thing that illustrates the minefield of making a mix quite well is that I transferred loosie.ogg over to a Mac OS 10.3 machine and played it again over the same speakers and using the ported version of Audacity (which I used to encode and play on Linux). The low midrange had disappeared! The voice, which had sounded lowish but intelligible on Linux, was now totally unintelligible. A while back, I also experimented with different MP3 encoders and found the results varied widely. Beware! My conclusion is that Red Book CD is the safest distribution medium at the moment.

Other Example Situations

As usual, your preferred genre may require a different approach. Here's how I would handle different musical styles.

Garage Band

The method and apps we've just explored will do fine for recording garage bands, except that we'll almost certainly need a mixer, particularly if there's a live drummer involved. You could use a multiple input soundcard and the Ardour mix GUI, or even only one mic if you're after a lo-fi sound (or if you really had no other choice).

Electronic Dance Music

We could use a tracker here or one of the sequencers. Jazz++ isn't JACK-capable, so Rosegarden seems a better bet. Another alternative is to use one of the apps in the next category in conjunction with something like Hydrogen or Rosegarden. If you create samples with Csound and load and play them with Hydrogen, you can dynamically alter their sound characteristics as you're recording the output, which could add to the interest of the result.

Soundscapes

Csound and Pd are the first apps to come to mind in this section. They both require commitment as far as learning is concerned, but that commitment can lead to rich rewards given the scope of what you can do.

You can also alter, cut, and paste sound files in ardour, ecasound, audacity, or snd.

Violin and Voice

This is conceptually pretty much the same as the garage band, except that you'll want everything as clear as a bell with no distortion at all. Assuming a good setup, our problems are outside of the range of the computer, except we will want to record at as high a sampling rate as we can which implies a top-end soundcard. Why bother if, we'll end up reducing our output to the Red Book CD sample rate? It will give you more options with the original file, and you will have the pleasure of listening to the original recording in higher fidelity. This holds true for the other situations, as well.

Conclusion

One of the joys of experimenting with Linux audio is that trying a wide variety of software won't cost you a fortune. You can also produce very good results with older hardware, provided that you're careful and patient.

There is no law that says Linux software of any sort has to be free of charge. In a time of offshoring and outsourcing, there is added pressure on developers to make a living and pressure to make at least some money from development work. So if you use and like software where the developers have indicated that they welcome donations, then please give some thought to giving some money.

I think I'd like to see some developer teams bite the bullet and actually do something like Quake marketing, where the core is free and add-ons are not. Anecdotal evidence suggests that contributions to developers from ordinary users are almost non-existent. Where there are contributions, they most likely come from other developers.

Thanks to hoojum.com for the loan of a 3.3GHz P4 with 1GB of RAM.

John Littler is chief gopher for Mstation.org.


Return to the LinuxDevCenter.com.

Copyright © 2009 O'Reilly Media, Inc.