Normalizing Music?
Beans asks: "I have a couple classical music CD's which I listen to at work, and use for putting the baby to sleep. I can never find the correct volume, I can't hear soft spots, so I turn it up, only to have a rising crescendo rouse the baby, or at work, have co-workers glace over. What is a good way to normalize them (read on for what I mean by normalize)? All of the normalizing software I have seen uses the entire song for the window of normalzing. Basically makes determines a static value required to get the average volume of the song to the user defined level, then applies that value to the entire song. What I need is something that normalizes over a sliding window, or say 5 seconds, or whatever. In effect making soft spots louder, and crescendo's quieter. Not the way the music was intended to be heard, but perfect for music-at-work, or putting kids to sleep. Does anyone know of any software that does this? On a side note, I work for a Seismic processing company, and we do stuff like this all the time on Seismic waves, not sound waves. If I can't find any canned software to do this, I may modify some of our code to work with WAV files, but I don't want to reinvent the wheel."
it seems the music "industry" has been doing a very good job of this. What exactly you want is dynamic compression, not normalization. click here for more information.
I've used normalizer plugins in both XMMS and Winamp. They aren't perfect, but they're generally alright.
Check out http://volnorm.sourceforge.net/ for an XMMS plugin, or one of the many Winamp plugins here.
What you want is a compressor. Audacity (GPL software for Linux, Mac, Windows) includes a simple built-in compressor, and also works with compressor plug-ins like SC4 by Steve Harris. (You can get SC4 by installing the swh-plugins collection on Linux or Unix; it's also included with the Windows version of Audacity).
Yes iTunes calls it "Sound Check", and IIRC it normalizes the entire song.
/* oops I accidentally made a comment, sorry */
That's not normalizing, that's dynamics compression.
Normalizing scales the entire file so that the highest sample is the highest value that can be represented. For many sound formats, this is 32768, for 15 bits. (1 bit left for the sign). This lets the sample use the full range. However, the volume of the file is based on the value of one sample.
What you want is to amplify different parts of the file so that the level of the song is more consistent. For example, sample every 1/4 second and adjust the level based on the average of that sample. A typical value might be 2:1 compression above -10 db. In this case, if the volume is above -10 db, the amount above -10 db is cut in half. -10 stays at -10, but -6 is scaled to -8, 0 to -5. (0 db is the highest value that can be represented.) There is a lot more to it, including look ahead, recovery time, multiple levels, etc.
It is similar to riding the voume control manually and turning it down for the loud parts and back up for the soft parts, but very quickly.
After dynamics adjustment, you usually normalize the sample.
I edit speech audio for my church and deal with this all the time. I use Cool Edit 2000 and it is great at this. However, it is no longer available. But most audio editing programs can do this. Try Audacity.
Classical music with its large dynamic ranges is meant to be loud at times. People think classical is something nice and calm like a little old lady, but much of it is meant to be exciting, and brash.
I'd do something interesting, but my server can't handle a slashdotting.
What you want is 'compression', not normalization. I don't mean data compression (ie. making smaller file), btw.
h tm lh tml
Music studio use "compressors" to reduce the dynamic range of sound. Ones that work in real time have to be a bit sophisticated (sliding window, like you said), but doing it offline is easier, since you can know the max and min sound values beforehand.
I don't know what tools are out there in PC land, hopefully someone will answer. But I will mention that I used to have a portable CD player with a built in compressor (to help keep your music above the ambient background noise, espicially when driving) and it was GREAT! It is a feature that I don't see much in portable devices anymore, which surprises me...
Anyway, hopefully this might give you a new term to google for, at least. Try searching for "dynamic range compressor", or something...
Alright, I found some windows plugins that might help; Anyone with some Linux/MacOs/Unix equivalents?
http://www.divx-digest.com/software/tfm_filter.
http://www.divx-digest.com/software/dedynamic.
"It's overkill, of course. But you can never have too much overkill." - Anonymous Slashdot Coward
It sounds like volume equalization is what microsoft calls compression. Compression is where the amplitude of music is altered depending on the average amplitude of the last few moments of music. It's basically like the device/computer has its hand on the volume nob and tries to keep the volume comming out at the same level, which is exactly what the poster described. Any good sound editing program has compression effects and I would be supprised if many audio players didn't offer it as well. I know my creative nomad has the feature available. FYI, audio compression is also what radio stations use to make their station sound louder.
You want quiet, listen to Enya. But don't go around raping the masters because of mundane utilitarian reasons.
On my nForce 2 motherboard, the sound applet has a "Night Mode" which um... "compresses" the sound so you don't have to turn it up as loud to hear the soft notes...
It's a pretty niffty feature to have, but I've never seen it anywhere else that I can think of...
Wiwi
"I trust in my abilities,
but I want more then they offer"
Geez...I'm surprised nobody brought this up yet. MP3gain normalizes MP3's, but it NOT based on an average of the entire song. Read the site for more info. This is exactly the solution you are looking for.
MP3 Gain at Sourceforge
Sangloth
I'd appreciate any comment with a logical basis...it doesn't even have to agree with me.
http://trikuare.cx/code/AudioCompress.html
Works with most players -- xmms plugin as well.
Ratboy
Just another "Cubible(sic) Joe" 2 17 3061
I recommend the Volume Logic plugin for iTunes. It provides dynamic automatic gain control (AGC) over multiple bands. I find it really brings out the nuances in quiet music without blowing me away, when things get loud.
Michael.
Linux : Mac
What you need to take advantage of is called "clipping" by sound experts.
Let's say your stereo can play a waveform that varies between -1.0 and 1.0. If you send it a peak of +/- 2 for instance, it will clip to +/- 1.
What you need to do is find the lowest peak in your music. Even the "silent" parts have a little noise.
Let's assume that it goes +/- 0.01 in those parts. Find the recipricol (1/0.01) = 100 and set your gain to that.
The quiet parts will range +/- 1, and the loud parts will be clipped to also be +/- 1. Voila! You've "expanded" and "compressed" without all that fancy professional equipment.
Note: if you don't have an easy way to estimate the gain you need, just use a round estimate like 1000. You can find op-amps at your local Radio Shack that will amplify even higher than this! Just be sure to leave off the "feedback" part of the circuit. We all know that feedback is bad, right?
And as an added advantage, your child will grow up with a love of music by the Japanese artist Merzbow. It's a win-win-win.
> It sounds like volume equalization is what microsoft calls compression
It's pretty much a standard term.
> FYI, audio compression is also what radio stations use to make their station sound louder.
It's what TV advertisers do to make their station ads louder. FM transmissions pretty much have to be compressed. Get too loud with AM and you'll just clip and distort. Get too loud with FM, and you'll bleed into a neighboring station. Radio stations don't really like compression all that much, as it tends to cause listener fatigue.
Typical compression doesn't really need to sample the last few moments of music, it just clamps the volume to a baseline and reduces any positive or negative gains. If the song is highly dynamic, it simply hits a limiter, and just doesn't get any louder -- too soft usually isn't an issue except with classical.
Good compression normalizes over the entire track, but the term "normalization" usually applies to making the average volume level the same over several tracks of an album.
The audio processing algorithm being requested here is called "compression", and it's a standard feature of most audio editing package such as SoundForge. You can also buy hardware compressors for under $100 (dbx and Alesis make stereo compressors) that are good for hooking into a home stereo/theater system.
I keep an Alesis digital stereo compressor hooked into my home stereo system so that when loud spots (commercials, action scenece, etc) come on it doesn't suddenly get orders of magnitude louder and drive my apartment neighbors nuts.
Some DVD players have audio compression built-in as a feature. Some newer TV sets have it built-in also.
Moderator hint: a comment is neither "Flamebait" nor "Troll" if it is true.
Similarly, you can increase the dynamic range of the sound by putting the bulb in parallel to your headphones. Loud sounds increase the temperature (and thus the resistance) of the bulb filament, which diverts more current through the headphones. Quieter sounds don'y heat the filament as much and allow more current to take that route, thus making them even quieter.
You may have to experiment with different types of lamps to find which works best.
Unknown host pong.
What you want is a compander. (compressor/expander). It is so called because it compresses or expands the dynamic range of the input audio. Sox includes one, if you like command lines.
.1,.1 -60,-10 0 0 .1
.1s to specify how fast it changes the volume; change the -60,-10 (always negative) to more similar values to make the compression less severe.
For winamp, I've found Rocksteady is beautiful, and does separate compression for several frequency bands (i can't begin to express how good this is for pop/rock).
For XMMS, AudioCompress does a sufficient job, although the windowing is somewhat stupid (not predictive == you'll get pops if things suddenly get loud) and it doesn't separate into multiple frequency bands, so it won't sound so good if you're playing something where the bass is really pushed (like Fiona Apple) next to something where it's not (classical).
Neither allow you specify complex transfer functions (of input volume to output volume).
For your purposes, sox is really the right thing, although it may feel a bit like "ack! drowning in sea of unexplained options!". You could start off trying:
$ sox infile.wav outfile.wav compand
will give you VERY hard compression. Change the
$ man sox
will tell you something more.
- KLS