Building A Linux Music Studio Part 2

By: Carla Schroder
Thursday, January 3, 2008 10:56:42 AM EST
URL: http://www.linuxplanet.com/linuxplanet/tutorials/6449/1/

Fixing Volume Levels

Last week we made a music CD from a live digital recording the easy and simple way. Today we're going to fix volume levels and do graceful fades and transitions using Audacity and normalize. Give yourself a lot of disk space, make copies of your original sound files before you start, and remember that Audacity has Undo and Redo commands, so don't stress out over making mistakes.

Normalization is a term you hear a lot, and it has two different meanings. One is to adjust all tracks to the same volume level, so that you're not surprised by a loud song following a soft song. Another meaning is to amplify a single track proportionally, or part of a track, making it as loud as possible while preserving its dynamic range. Audacity does the latter, but it cannot normalize a diverse batch of songs. For that we use the excellent command-line tool, normalize.

First let's see what Audacity can do. Select the track or portion of track that you want to normalize, then hit Effect--Normalize. For now stick with the default settings, which is to have "Remove any DC offset" checked, and "Normalize maximum amplitude to -0.0 dB". Figure 1 shows a track with three songs that were recorded at too low a level. We have two options here: normalize the entire track, or portions of it. Figure 2 shows what happens when the whole track is normalized at once. The first song is still a lot quieter than the second song. So I can select the first song and normalize it, as Figure 3 shows. Now it's about the same volume level as the second song.

Use the Amplify command for more control over volume levels. Highlight the part you want to change, go to Effect--Amplify, and set your desired level, either higher or lower.

Keep in mind that this is all a question of taste; just listen to your tracks and decide for yourself what sounds right.

Fades and Smooth Transitions

Audacity makes fading in and out as easy as tipping over. Select the part that you want to fade and the duration- note the time meter above your tracks- then do Effect--Fade In or Fade Out.

The Envelope tool gives you more control over fades and volume variations. You can gracefully amp up quiet sections or reduce overly-loud bits. Look to the right of the playback controls to find the tool buttons. Click the Envelope tool, then mark several locations on the track you're working on by clicking the mouse at different spots. Each location has two pairs of adjustment points. Use the outer pair to draw smooth curves, and the inner pair for fine-tuning. Click and hold, then move the cursor up to increase the sound level, down to decrease, and side to side to change duration. This is a tool that takes some getting used to, but it gives you a lot of control.

Figure 4 shows the result of several minutes of random fiddling around.

Normalizing Batches of Songs

The normalize command (which is called normalize-audio on Debian and its offspring) adjusts the volume levels of WAVE, MPEG, and OGG files. Your own live recordings tend to vary more in volume levels than commercial CDs, but no matter where your tunes come from you can easily adjust a batch of them to similar levels. Its simplest invocation looks like this:

$ normalize *.wav

This converts all the WAVE files in a folder to the same absolute volume level. This gives you a consistent volume level for everything; for example, you're building a music collection on a hard drive, so you're adding to it over time, or you like stuffing batches of CDs into your player and letting it run for hours. Using normalize this way ensures that everything will always be at the same volume level, so you won't get any rude surprises. You may even convert one song at a time.

But you might not always want to do this. Suppose you accidentally recorded an entire session at too low a level- you want to amplify it, and you want to preserve the relative sound levels of the songs. So all the songs won't be the same, but some will be quieter. You'll want the -b, or batch mode for this:

$ normalize -b *.wav

The -m or mix mode is different from either of these. It does not use an absolute value, but adjusts the volume level to an average of all the songs in the set:

$ normalize -m *.wav

So there will be variations from one set to the next.

You may also use this on mp3 and ogg files; look for the normalize-mp3 and normalize-ogg scripts. These convert to WAVE, normalize the files, and then convert them back. If your distribution doesn't have these, installing normalize from sources is easy. Or you can use the SoX command to convert the files to WAVE and back again. A source of confusion is normalize can operate directly on mp3 files without performing a WAVE conversion, but this does not re-encode the files; it just changes a tag in the file, and many mp3 players don't support these tags. It's better to actually re-encode the files.

Resources

Copyright Jupitermedia Corp. All Rights Reserved.