Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: How exactly does album gain work? (Read 11268 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How exactly does album gain work?

Recently I've been using track gain on my library collection. I've done some research on replaygain trying to understand more about the different methods but I still have questions that I'd like answered.

Firstly, if album gain ensures equal loudness of all songs in the same album, then why does it reduce the overall volume so much? For instance one of the albums I have (in lossless of course) shows an album gain of -5.91db for every track in the album, while all track gain numbers are different - some in the album only -1.12db and others -6.30) Is this all necessary? I just don't fully understand why it reduces so much volume when it seems as if it isn't needed. If I used the preamp (I use Foobar) to add say +4.0db to album gain, if the album was amplified by -5.91 (as I noted above) and I apply +4.0db, then the audio still wouldn't be clipped right? So in other words, that would solve my problem of album gain reducing more volume than what is necessary? Or would using the preamp in this case cause problems?

Secondly, and in relation to my question above, aren't all official albums 'level' when released anyway? By this of course I'm not referring to peak levelling - I mean that all tracks in the album output the same perceived loudness. If so do the producers or sound engineers apply some kind of replay gain on the album? And if somebody rips a an album (CD) using EAC for instance, and they apply normalization on each track ripped (since it is already an existing EAC feature, and yes I heard that this isn't good), would this then have an effect on the album gain that one would later apply to the album? In fact, would it even have an effect on the album's natural track equality?

Lastly, do the tracks need track gain info in order to apply album gain? I've been scanning track gain also, but I'm now sure.

I do hope you are following and that I'm not complicating things too much. Thanks for reading!

 

How exactly does album gain work?

Reply #1
I think you're misunderstanding the way album gain works. It does not ensure equal loudness of all songs in the same album, as you say. That is what track gain does: each track is adjusted to be at the same reference volume. Album gain on the other hand, ensures that the album overall has the reference volume. You could say album gain treats the whole album as one single track to adjust the volume. That means more quiet songs will keep their relative loudness difference to the loud ones, just like quiet parts of a single track keep their volume difference to the loud parts of the song. (Unlike dynamic range compression, where quiet parts are boosted to match the loud parts).

As for the second part of your question, no, not all album have the same volume. The difference are often very large, I have albums with an album gain of -12db, then others with +3db. This is one of the reasons why ReplayGain exists. Different albums are mastered differently, some use dynamic compression, some try to squeeze as much volume out as possible, etc. So yes, some kind of volume normalization is applied at some stage. I'm not familiar with the normalization feature of EAC, but any change in volume would change the ReplayGain tags, because the adjustment to reach the reference volume will change, obviously.

From what I know, you don't need track gain tags to apply album gain - that's what the album gain tag is for. What RG does need to work properly are the corresponding peak tags though - something I don't understand, but is required by the reference design. Foobar2000 will happily work without them, but you might end up getting troubles on other players/devices.


How exactly does album gain work?

Reply #2
Firstly, if album gain ensures equal loudness of all songs in the same album, then why does it reduce the overall volume so much? For instance one of the albums I have (in lossless of course) shows an album gain of -5.91db for every track in the album, while all track gain numbers are different - some in the album only -1.12db and others -6.30) Is this all necessary? I just don't fully understand why it reduces so much volume when it seems as if it isn't needed.


It adjusts the album gain to hit a certain gain target.  If the album was loud, it gets quieter, if it was quiet, it gets louder.  Beyond that the track gains don't really factor into this directly.

If I used the preamp (I use Foobar) to add say +4.0db to album gain, if the album was amplified by -5.91 (as I noted above) and I apply +4.0db, then the audio still wouldn't be clipped right?


It may clip (especially if lossy is used), although you most likely won't notice since you're still reducing the gain by 1.91dB.  However, you don't need to speculate here, replaygain also includes the track peak value, so you can see when clipping begnis.

So in other words, that would solve my problem of album gain reducing more volume than what is necessary? Or would using the preamp in this case cause problems?


What is this problem you're trying to fix?

Secondly, and in relation to my question above, aren't all official albums 'level' when released anyway?


Nope.  Thats why replaygain was invented.

Lastly, do the tracks need track gain info in order to apply album gain? I've been scanning track gain also, but I'm now sure.


No, although both are computed at the same time so you'll generally have both.

How exactly does album gain work?

Reply #3
Quote
I just don't fully understand why it reduces so much volume when it seems as if it isn't needed.
It's trying to match the volume of ALL of your music, not just that one album...  Actually not just your music, but all of the music in the world!   

Since there are many quiet sounding songs with maximized/normalized 0dB, and these songs can't be boosted (without clipping/distortion) the only way to match volumes is to reduce the loud songs.  The actual ReplayGain level is a compromise, since you'd have to reduce the volume a LOT to match the quietest song with the biggest peak that was ever recorded.


Quote
Secondly, and in relation to my question above, aren't all official albums 'level' when released anyway? By this of course I'm not referring to peak levelling - I mean that all tracks in the album output the same perceived loudness.
No!  Sometimes there are songs intended to be quiet and other songs intended to be loud on the same album.    Album gain retains these relative differences,and that's the whole point of album gain...  To retain these differences as the album was intended.  Track gain removes these intra-song dynamics.

A modern pop, rap, or metal recording is likely to be constantly-loud across all tracks.  A Broadway musical soundtrack, classical or jazz recordings are typically more dynamic with quite songs and loud songs on the same album (and usually some songs with loud parts and quiet parts).

Quote
If so do the producers or sound engineers apply some kind of replay gain on the album?
Usually it's done by ear, although the mastering engineer may be told to target some RMS level.    That's usually done with dynamic compression to boost the overall volume (possibly measuring the RMS level after the compression is applied to check the level).

How exactly does album gain work?

Reply #4
In my opinion, album gain is almost always preferable to track gain. Albums are professionally mixed so that you don't have to reach for the volume knob between tracks. If a track is quieter than the others, it's because it was intended to be by the studio engineer. Therefore, the whole album should really be adjusted by the same amount if ReplayGain is being applied.

ReplayGain is measured by calculating the loudness of 50 millisecond blocks, then it picks the block that represents the 95th percentile (ie 5% of the blocks are louder, the rest are quieter). Track gain only considers blocks from one track, Album gain considers blocks from all the tracks. Both values are stored, and if the whole album wasn't available during calculation (ie you had an "album" of 1 track), the album gain value will be the same as the track gain.

Hope that helps.

How exactly does album gain work?

Reply #5
Album gain on the other hand, ensures that the album overall has the reference volume. You could say album gain treats the whole album as one single track to adjust the volume.


I didn't think of this. Thanks for explaining so simply.

What is this problem you're trying to fix?


Well the problem I was referring to is why tracks become so much quieter when using track or album gain, especially track gain. Basically I meant that I have to turn my analogue volume up loads in order to reach the same loudness as if I wasn't using reaplygain. But I think DVDdoug has given me the answer.

Since there are many quiet sounding songs with maximized/normalized 0dB, and these songs can't be boosted (without clipping/distortion) the only way to match volumes is to reduce the loud songs.  The actual ReplayGain level is a compromise, since you'd have to reduce the volume a LOT to match the quietest song with the biggest peak that was ever recorded.


That perfect makes sense, however I have two important questions.
Firstly, a few of my songs I have normalized to -0.1db (I call it the safe zone since providing the song is lossless, clipping is never possible at -0.1db, from my experience) have actually increased in volume when track gain is applied. What confuses me is that they can't be amplified any more without causing clipping. I mean, is foobar aware that it has just clipped those couple of my songs? You mentioned the reason why replaygain reduces such a large amount of volume is to keep the volume of the entire collection constant - so how come some of my songs are clipped via replaygain? Why doesn't fb2k reduce a little more volume on all the songs in order to prevent clipping in any of them, to save me relying on the advanced limiter or preamp which would interrupt the track gain as many have stated before me?

Secondly, if the tracks in my primary collection (approx. 2000 songs, in flac) become so much quieter when track gain is applied, well what about when burning a small collection of them to a CD using foobar? When burned, will they be of the same loudness as they would on my pc? Basically is the size of the song collection relevant?

Track gain removes these intra-song dynamics.


What exactly do you mean by this? I was just thinking see, when I burn a collection of songs to an audio CD (with track gain), no matter how high I adjust the volume the songs just seem.. powerless. I'm not sure if this is some kind of placebo because of the reduction in volume, but my music just sounds more.. effective and lively without replaygain. Can somebody please explain this?

ReplayGain is measured by calculating the loudness of 50 millisecond blocks, then it picks the block that represents the 95th percentile (ie 5% of the blocks are louder, the rest are quieter). Track gain only considers blocks from one track, Album gain considers blocks from all the tracks. Both values are stored, and if the whole album wasn't available during calculation (ie you had an "album" of 1 track), the album gain value will be the same as the track gain.


Very technical. So by this do you mean that the software treats all songs in the same album as a single track, as ChronoSphere mentioned?

I apologise if I seem to be asking too much or if I induce any confusion at all. I don't learn the same way or as quickly as others do, but I'm determined to gain a total understanding of how replaygain works.

How exactly does album gain work?

Reply #6
I apologise if I seem to be asking too much or if I induce any confusion at all. I don't learn the same way or as quickly as others do, but I'm determined to gain a total understanding of how replaygain works.


We have a great wiki that explains this from a high level:

http://wiki.hydrogenaud.io/index.php?title=Replaygain

and then links to the actual replaygain specification if you want to be really technical:

http://wiki.hydrogenaud.io/index.php?title...n_specification




How exactly does album gain work?

Reply #7
(Unlike dynamic range compression, where quiet parts are boosted to match the loud parts).

This is not how dynamic range compression works. Loud (dynamic) parts are made quieter (compressed) to more closely match the level of the quiet parts and the gain of the entire track is typically boosted.

How exactly does album gain work?

Reply #8
95th percentile

Isn't this only used in the older algorithm, or is it still being as part of the current version that uses BS.1770?

How exactly does album gain work?

Reply #9
(Unlike dynamic range compression, where quiet parts are boosted to match the loud parts).

This is not how dynamic range compression works. Loud (dynamic) parts are made quieter (compressed) to more closely match the level of the quiet parts and the gain of the entire track is typically boosted.
Are the loud parts being compressed because boosting the quiet parts could increase the noise?


How exactly does album gain work?

Reply #11
Are the loud parts being compressed because boosting the quiet parts could increase the noise?

Loud parts are being compressed because this is how it is implemented.

An increase in noise resulting from boosting is unavoidable.  Or, if one compresses without boosting, a decrease in SNR is and unavoidable result from a reduction in dynamic range.

How exactly does album gain work?

Reply #12
95th percentile
Isn't this only used in the older algorithm, or is it still being as part of the current version that uses BS.1770?


Yes, the older algorithm. Just to be pedantic though, it's also the current algorithm (RG 2.0 is just a proposal, and AFAICT not much uses it yet).

How exactly does album gain work?

Reply #13
Being pedantic indeed, though I guess one can argue whether anything is official rather than just "proposed".  David was very clear that 1.0 was just a proposal.

As far as what software has implemented BS.1770(/R-128) (no doubt an incomplete list)...
http://wiki.jriver.com/index.php/Release_Notes_MC19
http://www.dbpoweramp.com/dbpoweramp-dsp.htm
http://www.foobar2000.org/changelog
(see 1.1.6)

I hope you aren't discounting the people who use these programs.

How exactly does album gain work?

Reply #14
I'm not discounting them at all. But since the OP didn't explicitly mention fb2k, I'll assume he/she doesn't use it. Most people don't.

How exactly does album gain work?

Reply #15
Quote
That perfect makes sense, however I have two important questions.
Firstly, a few of my songs I have normalized to -0.1db (I call it the safe zone since providing the song is lossless, clipping is never possible at -0.1db, from my experience)
Your DAC and "regular" integer WAV files are limited to 0dB.  If you "try" to go over, they will clip.  You can clip your DAC by using a software "preamplifier" or by boosting the bass with EQ, etc.

A limiter applies a type of "soft clipping" where the waves are rounded-over instead of squared-off.  In order to limit at 0dB, of course the limiter has to kick-in and start rounding-over the waveform before you hit 0dB.

foobar2000's Advanced Limiter is like a fast look-ahead compressor where the volume is tuned-down just before the peak comes-along.

You can also clip an analog amplifier.  Although if you are listening to a portable device, the amplifier gain is usually matched to the DAC so the DAC clips before the amplifier.

Quote
...have actually increased in volume when track gain is applied. What confuses me is that they can't be amplified any more without causing clipping. I mean, is foobar aware that it has just clipped those couple of my songs?
ReplayGain has an option of allowing clipping.  I believe the default is to not allow clipping.  Normally (when you don't allow clipping) some songs won't be boosted to your target ReplayGain volume setting.

Quote
...Why doesn't fb2k reduce a little more volume on all the songs in order to prevent clipping in any of them, to save me relying on the advanced limiter or preamp which would interrupt the track gain as many have stated before me?
If you set the ReplayGain volume lower, your files will have lower volume. 

i.e. If you set ReplayGain for less than the default 89dB, you'll give ReplayGain more room to work, but of course, your songs will be quieter.  If you set the level higher, your songs will be louder but you are leaving it less room to work, so either more songs will be clipped (or limited), or if you don't allow clipping more songs won't be affected at all because they are already as loud as they can go (without clipping or limiting).

Quote
Secondly, if the tracks in my primary collection (approx. 2000 songs, in flac) become so much quieter when track gain is applied, well what about when burning a small collection of them to a CD using foobar? When burned, will they be of the same loudness as they would on my pc? Basically is the size of the song collection relevant?
ReplayGain is applied at playback-time so it shouldn't affect burned files (since Audio CDs don't support ReplayGain).  If you apply WAVGain to your WAV files before burning, WAVGain does adjust the file itself.

Quote
Quote
Track gain removes these intra-song dynamics.

What exactly do you mean by this?
Dynamics is the variation in loudness...  A dynamic Broadway musical might have a loud song followed by a quiet song.  With track gain, the loud song will likely be adjusted-down, and/or the quiet song adjusted-up so that they they are approximately equal. 

Album gain will adjust all of the songs on the album by the same amount, leaving the differences between the songs.  It's gong to basically treat the album as a single song, and try to match your target ReplayGain volume the same way it would adjust a song with loud parts and quiet parts.

How exactly does album gain work?

Reply #16
@Jebus:
I edited my post while you were replying, conceding your pedantry.

Do you have any actual data supporting the idea that users of foobar2000 and other RG scanners that use BS.1770 don't constitute a majority?

the OP didn't explicitly mention fb2k

You might want to have another look...
I use Foobar

How exactly does album gain work?

Reply #17
Ah, missed that.

No, no data to back up my claim. Is that a TOS violation? 



How exactly does album gain work?

Reply #19
Thanks very much for the info, peeps, and the answers to my quotes too. I definitely have a better understanding after reading all this.

Just one last thing DVDdoug. In your previous post you mentioned

ReplayGain is applied at playback-time so it shouldn't affect burned files (since Audio CDs don't support ReplayGain).  If you apply WAVGain to your WAV files before burning, WAVGain does adjust the file itself.


The thing is, it seems to work for me. Foobar has an option for applying replaygain or any DSP to a collection of files upon CD burning. I assume that foobar applies gain to the collection and then burns it as it is. I'm not saying you're wrong, you seem to have more knowledge that myself, however, I've burned many CDs using replaygain during burning (only in Fb2k) and there is definitely a difference - it works, unless it's just my ears.

Then I wonder, if you're right about this, then what results in the volume changes of the burned tracks? Either way, I don't exactly like using this method, since as I mentioned earlier, the burned tracks just seem.. powerless.. no matter how much I increase the volume.

How exactly does album gain work?

Reply #20
The thing is, it seems to work for me. Foobar has an option for applying replaygain or any DSP to a collection of files upon CD burning. I assume that foobar applies gain to the collection and then burns it as it is. I'm not saying you're wrong, you seem to have more knowledge that myself, however, I've burned many CDs using replaygain during burning (only in Fb2k) and there is definitely a difference - it works, unless it's just my ears.


I believe you're right. It won't affect the files you used to burn the CD from but the data written to the CD will have been adjusted accordingly. At least that's my understanding of how it would work. dbPoweramp has a similar type of DSP.

How exactly does album gain work?

Reply #21
Quote
ReplayGain is applied at playback-time so it shouldn't affect burned files (since Audio CDs don't support ReplayGain).  If you apply WAVGain to your WAV files before burning, WAVGain does adjust the file itself.


The thing is, it seems to work for me. Foobar has an option for applying replaygain or any DSP to a collection of files upon CD burning. I assume that foobar applies gain to the collection and then burns it as it is. I'm not saying you're wrong...
    CONFESSION - I've never burned a CD with foobar2000.

If nobody knows for sure, and you want to go to the trouble of doing an experiment.  You can use an audio editor* to make two test tones at obviously different volumes and try it.   

I did something similar once because I wasn't sure if Sound Check was affecting the output from the docking port on my iPod Classic, which i use in the car.  I created two 500Hz test tones.  One at 0dB and one at -12dB.  (It was working, and with Sound Check they both played-back at the same volume in the car.)



* I probably used GoldWave, but Audacity can also do it.

How exactly does album gain work?

Reply #22
ReplayGain is applied at playback-time so it shouldn't affect burned files (since Audio CDs don't support ReplayGain).  If you apply WAVGain to your WAV files before burning, WAVGain does adjust the file itself.


The thing is, it seems to work for me. Foobar has an option for applying replaygain or any DSP to a collection of files upon CD burning. I assume that foobar applies gain to the collection and then burns it as it is. I'm not saying you're wrong, you seem to have more knowledge that myself, however, I've burned many CDs using replaygain during burning (only in Fb2k) and there is definitely a difference - it works, unless it's just my ears.
Foobar's burning plugin does have the option to apply ReplayGain to files, yes. It decodes the files to be burned to wav into your temp file directory, applies selected gain on them, then burns them to the disc. Files in your collection are not affected, else you'd see the replay gain tags change if you rescan those files after burning them to disc.

Quote
Then I wonder, if you're right about this, then what results in the volume changes of the burned tracks? Either way, I don't exactly like using this method, since as I mentioned earlier, the burned tracks just seem.. powerless.. no matter how much I increase the volume.
That seems like some sort of placebo effect of you expecting music to have less "punch" because the volume was decreased via RG. They sound the same at the same volume.