Skip to main content

Topic: Best way to avoild clipping / normalizing collection ? (Read 5246 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
Best way to avoild clipping / normalizing collection ?
The problem i am facing is this:

I do believe ReplayGain is the way to go. It's non destructive as it is merely a tag, and works for most filetypes.

But almost no portable players support ReplayGain.


So what do ?


A reversible normalizer like MP3Gain seemed like the way to go.

Yes, it is a destructive algorithm, but by activating an option it can eliminate all clipping while normalizing, and as long as you preserve the tag it generates, it's 100% reversible.

Problem is, it doesn't work for all filetypes. It hasn't been updated for a long time, so i don't think there are plans for it to work for all filetypes.

Anyway, I wouldn't want to apply the corresponding MP3Gain algorithm to a perfect FLAC sound file. =/

Also, it is a bit too sensible to file corruption. (Although I use another tool to fix corrupt files).

So, I was wondering, what solutions have you guys came up with?

At home I use foobar and integrated ReplayGain and Advanced Limiter "tools" to avoid clipping/normalize.

But as i take out a portable player, it seems if I don't want to keep adjusting the volume I still have to keep using MP3Gain on my collection.
It may not be a problem for people that listen to albums (which are usually somewhat normalized), but it is a problem for me, since I use smart playlists, and it is a problem for everyone out there that ever sets their player on random.

So, tell me whatcha think.
~this is not fullmooninu's signature~

  • 2Bdecided
  • [*][*][*][*][*]
  • Developer
Best way to avoild clipping / normalizing collection ?
Reply #1
Matching loudness and preventing clipping are two different things. It sounds like you want to do both.

It reads like you've seen this page, but if not, this is well worth reading...
http://wiki.hydrogenaudio.org/index.php?title=Replaygain


If the source audio is clipped (i.e. it's clipped on the CD), reducing the level will do nothing to help that clipping. It's already happened and it's outside of your control. You need some kind of de-clipping audio restoration tool to fix it, and these don't always work that well.

There are two types of further causes of clipping that can be prevented by reducing the level:
1. clipping introduced by lossy encoding then decoding
2. clipping introduced by the DAC itself due to inter-sample values over digital full scale, and limited DAC headroom.

It's debatable whether either of these causes an audible problem. mp3gain / ReplayGain will check for 1, not 2.
Problem 1 can't happen with lossless files (e.g. WAV, FLAC).
Problem 2 will almost inevitably go away if you reduce the level "enough" - ReplayGain doesn't check for this, but the reduction in level is usually "more than enough". If it worries you, you need to use something else. Or use a DAC that doesn't have this problem!


Do you listen to FLAC files on your portable player? A few players support FLAC + ReplayGain natively. If yours doesn't, Rockbox might enable you to use ReplayGain tags on your player - otherwise you're stuck with creating a FLAC copy with the ReplayGain change applied.

For mp3 or AAC, use mp3gain and/or AACgain, and/or foobar2k to apply the ReplayGain change for use on any portable player.


I know it's a very common request, but I don't personally understand the desire to reverse ReplayGain changes applied to mp3s. The original level isn't anything special. I'd use peak normalise-by-album in mp3gain instead. One of three things can happen:
1. If the original CD was well mastered and there was no encoder+decoder clipping, this will give you back the original level
2. If there was clipping, peak normalise will produce something that's a little quieter than the original level to avoid this clipping. Is this such a bad thing?
3. If the original CD didn't get near 0dB FS, peak normalise will sometimes produce something that's a little louder to compensate. Is this such a bad thing?

If mp3s themselves were lossless, than the advantage of being able to return to the original level losslessly would be obvious (you'd get the original CD data back) - but they're lossy files anyway - you've already lost the "original".

Cheers,
David.

  • a.k.a.
  • [*]
Best way to avoild clipping / normalizing collection ?
Reply #2
Fullmooninu, I have a similar dilemma.

Is the WAV format more subject to clipping and distortion?  Or is this a problem with particular software?


Using EAC, I have ripped a bunch of old first-pressing CDs from the '80s and '90s that had low-normalized gain.  I'm trying to turn up the gain so I can combine them into mix CDs for friends with more recent MP3s that are usually encoded with much higher gain.  I lack the right software tool to do this.  Can anyone suggest one?

Currently, the procedure is this:

1) Rip low-gain WAVs via EAC as FLAC.

2) When transcoding to WAV, use MediaCoder to raise the gain of the FLAC files.

3) Adjust gain of some MP3s using MP3DirectCut or MediaCoder.

When I use MP3DirectCut to carefully crank up the gain on files, they sometimes sound distortion free, and sometimes clip badly.  It's trial and error, not because of the gain level, but because MP3DC sometimes botches the process with random clipping, and sometimes does just fine.  Same file.  Same gain adjustment.  Variable output quality.

But even some of the MediaCoder and MP3DirectCut gain adjustments sound like crap (hugely distorted) when they are subsequently saved as WAV.  So I'm stumped:  Is this a problem with the WAV format, or a problem with EAC / MediaCoder / MP3DirectCut?  Are there any good programs for giving a bunch of disparate files (FLAC, MP3) a standard gain level that won't distort when transcoding into WAV to burn a CD?

Sigh....


  • 2Bdecided
  • [*][*][*][*][*]
  • Developer
Best way to avoild clipping / normalizing collection ?
Reply #3
Is the WAV format more subject to clipping and distortion?
No, the wav "format" doesn't do anything at all to the audio. It's lossless.

Quote
Using EAC, I have ripped a bunch of old first-pressing CDs from the '80s and '90s that had low-normalized gain.  I'm trying to turn up the gain so I can combine them into mix CDs for friends with more recent MP3s that are usually encoded with much higher gain.  I lack the right software tool to do this.  Can anyone suggest one?
No. Here's why...

http://replaygain.hydrogenaudio.org/faq_quiet.html

You could dynamically compress the quiet tracks to match the louder ones, but it would be easier to turn down the louder ones.

Cheers,
David.

  • mjb2006
  • [*][*][*][*][*]
Best way to avoild clipping / normalizing collection ?
Reply #4
When I use MP3DirectCut to carefully crank up the gain on files, they sometimes sound distortion free, and sometimes clip badly.  It's trial and error, not because of the gain level, but because MP3DC sometimes botches the process with random clipping, and sometimes does just fine.  Same file.  Same gain adjustment.  Variable output quality.


If you really get that random clipping then clearly there's some problem with MP3DirectCut. I suggest posting about it in the support forum or emailing Martin Pesch directly. Probably he'll want to see a sample file.

Best way to avoild clipping / normalizing collection ?
Reply #5
Yes, I had forgotten to cover the option of applying ReplayGain to the mp3 data , and the like.

I will read your post a few more times to grasp all the concepts.

As for my usage of mp3Gain. Since i find  the default 89dB to be a little low, I apply a per track gain boost to 91dB, but, i turn on the option to avoid clipping. This way, each file i normalized as close to 91dB as possible.

Yes, a few files never reach 91dB, but the majority does, and I get no reported clipping this way.

Thank you
~this is not fullmooninu's signature~

  • DVDdoug
  • [*][*][*][*][*]
Best way to avoild clipping / normalizing collection ?
Reply #6
Quote
Using EAC, I have ripped a bunch of old first-pressing CDs from the '80s and '90s that had low-normalized gain. I'm trying to turn up the gain so I can combine them into mix CDs for friends with more recent MP3s that are usually encoded with much higher gain.
I assume that you don't want to alter the sound, except to change the volumes?    Dynamic compression can make a song sound louder by increasing the average volume without increasing the peaks.  But, this squishes the dynamic contrast out of the song and makes it boring (like most modern over-compressed junk).      If you do want to use compression, let us know... 

Here's what I suggest:
1. Convert the MP3s to 44.1.kHz 16-bit WAV.  (You'll need to decompress to make an audio CD anyway.)
2. Normalize all of the files (adjust the volumes for a peaks of 0dB, the digital maximum).
3. Listen to the volume-adjusted songs and choose the quietest sounding track.  (This is your reference.)
4. Adjust-down the volume of each track if needed (by ear) to match your reference track.
5. Mix & burn as usual

The above procedure will insure that the quietest sounding track (after normalization) will have maximized peaks, but no peaks on any track will be clipped.  And, it will give you the loudest-possible, unclipped, matched-volume mix. 

This situation is a little different from what Replay Gain is trying to solve...  Replay Gain tries to match ALL possible songs to a universal standard volume...    Your task is simpler.  You only need to match 10 or 20 songs to each other.   And since all of your peak levels are known (or can be known) you can match all of the perceived volumes and you can normalize (overall) without fear of clipping!  (If somebody wants to apply ReplayGain to your volume-matched mix CD and match it to all of their other music, that will still work.)

Tools like MP3Gain or WAVgain might help to assist your "by ear" volume adjustments, but the key is to normalize/maximize all of the files first, and then never increase from there...  only make level reductions to match volumes.

Quote
When I use MP3DirectCut to carefully crank up the gain on files, they sometimes sound distortion free, and sometimes clip badly. It's trial and error...
  Since most tracks (even quiet sounding tracks) are already normalized/maximized, you can't usually increase the volume without clipping.  So, volume matching usually requires reducing the loud tracks.

Quote
1) Rip low-gain WAVs via EAC as FLAC.
There's no harm in using FLAC, but the file has to be decompressed to make an audio CD or to edit...  WAV should rip, open, and save a bit faster.

Quote
I lack the right software tool to do this. Can anyone suggest one?
  Do you have an audio editor, besides MP3directCut?  If you're making "mix CD's" I assume you're using an audio editor to crossfade between tracks???  I use GoldWave[/color] ($50 USD).  Audacity[/color] is FREE!!!!
  • Last Edit: 10 August, 2010, 05:02:23 PM by DVDdoug

  • a.k.a.
  • [*]
Best way to avoild clipping / normalizing collection ?
Reply #7
Here's what I suggest:
1. Convert the MP3s to 44.1.kHz 16-bit WAV.  (You'll need to decompress to make an audio CD anyway.)
2. Normalize all of the files (adjust the volumes for a peaks of 0dB, the digital maximum).
3. Listen to the volume-adjusted songs and choose the quietest sounding track.  (This is your reference.)
4. Adjust-down the volume of each track if needed (by ear) to match your reference track.
5. Mix & burn as usual


DVDdoug, it sounds like all the advice is pointing in this direction.  Thanks, everyone, for pointing out why reducing volume is the only way to go here.

The question now is about Step 4 above.  Are there any tools that will actually pick a reference volume, and if not actually adjust all tracks downward (ideally), then at least tell you what gain level adjustment you'll need to use manually?

I just tried to get a gain readout from WAVgain and find its CLI output to be way clunky.  The ReplayGain console in foobar2000 didn't immediately seem like it offered that sort of display either.  Also annoyed that it's not easy to do with three different original file types (FLAC, MP3, WAV).  Ideally, one should be able to transcode and apply gain adjustments in the same operation, rather than run it through two different programs.

This is such a common issue with audio files.  How come there's no straightforward app to do this?

a.k.a.

  • cliveb
  • [*][*][*][*][*]
  • Developer
Best way to avoild clipping / normalizing collection ?
Reply #8
Here's what I suggest:
1. Convert the MP3s to 44.1.kHz 16-bit WAV.  (You'll need to decompress to make an audio CD anyway.)
2. Normalize all of the files (adjust the volumes for a peaks of 0dB, the digital maximum).
3. Listen to the volume-adjusted songs and choose the quietest sounding track.  (This is your reference.)
4. Adjust-down the volume of each track if needed (by ear) to match your reference track.
5. Mix & burn as usual


DVDdoug, it sounds like all the advice is pointing in this direction.  Thanks, everyone, for pointing out why reducing volume is the only way to go here.

The question now is about Step 4 above.  Are there any tools that will actually pick a reference volume, and if not actually adjust all tracks downward (ideally), then at least tell you what gain level adjustment you'll need to use manually?

I hesitate to contribute here, because it could be seen as an advertisement. But given your requirements, I feel that I do have to say something. Apologies if this is against forum rules; I just thought that since a.k.a. specifically asked for an application to automate the process, I should mention it....

People round here will know me as the author of Wave Repair. I happen to have another shareware program, called Volume Balancer. Once you have your files in 16/44.1 WAV format, it does pretty much exactly what you want. In a nutshell: you add the WAV files for your compilation into Volbal, then tell it to balance them according to a defined reference level. It first normalises them all, and then uses gain reduction and/or dynamic range compression to bring all the files to the same loudness. Provided you tell it to use the quietest file as the reference level (which is the default), then no dynamic range compression will be applied, of course. A new set of WAV files is generated as the output - the original files are left unchanged. It doesn't do the actual burning to CD - you'll need to do that with your favourite CD writing application.

  • 2Bdecided
  • [*][*][*][*][*]
  • Developer
Best way to avoild clipping / normalizing collection ?
Reply #9
I haven't tried CliveB's software - I bet it's perfect for the job.

But DVDdoug - what a tortuous procedure you propose! You can short circuit it by doing the analysis in WavGain (it has a gui you know), checking the values, entering an appropriate offset to bring the peak up to 0dB FS (there's a box for that in WavGain's GUI), and then running it again to apply the values.

Still sounds like Clive's programme is a neater solution.

Cheers,
David.

  • Zarggg
  • [*][*][*][*][*]
Best way to avoild clipping / normalizing collection ?
Reply #10
+1 to what Clive and 2Bdecided said. I'm not a moderator or admin, and make no claims to set policy, but as a contributor/member to the forums, I see no problem "advertising" one's own work if it's actually relevant to the topic.