HydrogenAudio

Hydrogenaudio Forum => Scientific Discussion => Topic started by: Not One Of Us on 2019-05-14 18:06:56

Title: Normalizing songs like a radio does.
Post by: Not One Of Us on 2019-05-14 18:06:56
(May be using the incorrect term there.  Also, apologies if this isn't the right forum for this topic.  Best I could figure.)

I'm trying to put together a set of music to play at work and in my car, but I'm running into the problem of the volume levels being all over the place.  Some are not so bad, but others are so drastically different that applying any permanent replaygain to them still doesn't get them to the level I want.

After looking around, I found the Normalization & Limiting part of this article ( https://ledgernote.com/columns/mixing-mastering/matching-levels-in-home-recordings-for-even-playback/ ) to essentially grasp what I'm trying to do.  After applying this method to a track with low volume levels (in this case, Berlin - The Metro from the album Pleasure Victim (first pressing?  Regardless, don't think there's been a remastered version)), I found it quite satisfactory.  However, it doesn't seem to be a universal method.  Some songs that are not as low as the previously mentioned track (like New Order - Blue Monday from Substance 1987), and applying this method directly causes too much loss in information.  Moreso the case with tracks that are too loud - they get a severe compression effect.

So what I'm wondering is: is there some way to automatically get this target volume right?  Does it being so reliant on perceived loudness mean I must do this manually and use trial & error for each song?
Title: Re: Normalizing songs like a radio does.
Post by: lithopsian on 2019-05-14 20:21:22
What you're looking for is called "replaygain" in this context.  Search for it here, or elsewhere.  Details are slightly different in each codec, but support is widespread.  In a car, support maybe not so widespread, but there are ways to "hard-code" the normalisation so that the track will just play at the right level.  While you're reading, pay attention to track and album normalisation, which will become obvious when you think about it.

To go further, we'd need to know which music format you want to use, then maybe run a test to see if your car radio will support replaygain tags directly.
Title: Re: Normalizing songs like a radio does.
Post by: DVDdoug on 2019-05-14 23:47:37
Quote
...applying any permanent replaygain to them still doesn't get them to the level I want.
Exactly how did you do that?
What format are your files?
Did you change the default target volume?
Are the "failures" too loud or too quiet?

ReplayGain (and MP3Gain) have worked fairly well for me but "nothing's perfect"...   Two different people might not agree when the volumes are matched, especially when the songs are different styles/genres, or if the song is highly dynamic with a quiet beginning and a loud ending, etc...  

There is a limit to how much you can boost the volume without clipping so some quiet-sounding songs will still be too quiet if you don't allow clipping (or apply limiting or compression).    The default target-volume is a compromise that works with most songs.  Some people increase the target volume, but then ReplayGain doesn't have "room to work" and many songs end-up unchanged.

If some songs are (relatively) too loud after applying ReplayGain you can reduce them manually, by ear, with an audio editor (such as Audacity).

Quote
After looking around, I found the Normalization & Limiting part of this article ( https://ledgernote.com/columns/mixing-mastering/matching-levels-in-home-recordings-for-even-playback/ )
Limiting (and compression) followed by Normalization or make-up gain can bring-up the loudness.     And, if you apply the same settings to all of your recordings it will trend toward the same loudness, but it's NOT really volume-matching and it's going to make everything louder, including the already-loud songs, so you still need to listen or otherwise measure the loudness. 

And of course, it does reduce the dynamics of the music and you may not want to do that.  (ReplayGain doesn't mess with the dynamics...   It makes one volume-adjustment to the whole song (or the whole album) before playback begins.)
Title: Re: Normalizing songs like a radio does.
Post by: castleofargh on 2019-05-15 08:53:30
what DVDdoug said. replaygain is doing what it can within the headroom you allow. which will go typically between clipping and some target level somewhere around 80 something dB. some songs will have more overall difference between each other, but more annoying is a song that's overall very quiet but with some content close to 0dB. that's usually where we get most issues as the "no clipping" order contradicts and cancels the subjective target for loudness.

against that, you can allow clipping, and maybe have some more or less clever limiting involved to compress the peaks instead of having them purely and simply clipped.
or you can set a lower target level, meaning that you're lowering the gain of all song by a bigger value. that way hopefully you'll bring everything down to the level of the troubling songs that were too quiet.
or a mix of both ^_^.

there will always be some songs that just have huge changes in amplitudes depending on the passage in the track, or simply tracks you'd want louder, but aside from handling those one by one, or removing them from your playlist, I don't see a solution. at least not a fully automated one that wouldn't end up ruining many songs just to "save" a few.
Title: Re: Normalizing songs like a radio does.
Post by: Not One Of Us on 2019-05-19 18:47:39
That's what about I figured.  Unfortunate, as that's gonna be a good deal of work, as there's a good amount of songs I really want to listen to at work.

Ah well, appreciate the help.
Title: Re: Normalizing songs like a radio does.
Post by: Muise on 2019-06-05 15:08:45
Does this have to be done manually for every song? Or did I get that wrong?
Title: Re: Normalizing songs like a radio does.
Post by: Sunhillow on 2019-06-05 17:49:46
If your audio is mp3, you can use MP3gain to losslessly alter the volume based on a replaygain analysis. This method changes the global_gain entry in each frame. There is a GUI to simplify using it. The volume is being changed in 1.5 dB steps.

There is also a AACGain.exe that can alter AAC and MP3, but I did not yet use this one.
Title: Re: Normalizing songs like a radio does.
Post by: DVDdoug on 2019-06-05 23:02:40
Quote
Does this have to be done manually for every song? Or did I get that wrong?
It depends...

With iTunes Sound Check, you just turn-on Sound Check and you're done!

MP3Gain can process a batch of files at once (I'm not sure if there's a limit).

ReplayGain can also scan/analyze multiple albums/files/folders at once.