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: Feature request: "Equalize loudness" mode for ReplayGain scanner (Read 3300 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Feature request: "Equalize loudness" mode for ReplayGain scanner

Currently foobar2000 has 2 (classic) modes of ReplayGain calculation: "per track" and "per album". What I miss sometimes is a calculation that will equalize loudness of selected tracks. "Per track" mode does not guarantee equal loudness because it calculates track gain completely independently, and "per album"'s aim is just opposite - to preserve difference in loudness between tracks.

So is it possible to add yet one mode (that will write its results to the "track_gain" tag)?

Re: Feature request: "Equalize loudness" mode for ReplayGain scanner

Reply #1
There is option to scan selected tracks and treat them as an album. It ignores tags and treats selection as all tracks were from same release.

Re: Feature request: "Equalize loudness" mode for ReplayGain scanner

Reply #2
There is option to scan selected tracks and treat them as an album.
Yes, and thus existing difference in loudness is preserved. While I need to eliminate it.


Re: Feature request: "Equalize loudness" mode for ReplayGain scanner

Reply #4
"Per track" mode does not guarantee equal loudness
Why?
Because RG scanner tries to reach a target volume, BUT preventing clipping. And if some long and overall quiet track has one short but high peak, that peak may prevent raising the volume to necessary level.

So what?
So, maximally reachable level for any file from the selection may be lower than target, and value of this reachable level is individual for every file in the selection.

Re: Feature request: "Equalize loudness" mode for ReplayGain scanner

Reply #5
Quote
Because RG scanner tries to reach a target volume, BUT preventing clipping. And if some long and overall quiet track has one short but high peak, that peak may prevent raising the volume to necessary level.
The "Apply Gain" option will NOT prevent clipping.

Re: Feature request: "Equalize loudness" mode for ReplayGain scanner

Reply #6
The "Apply Gain" option will NOT prevent clipping.
As for me, "Playback" branch name and "apply gain" selection choice assume that it is applicable at playback time, not during scanning.

Anyway, before creation of this topic I had synthesized short (5 sec) file with quiet (31.6% = -10 db) pure sine signal with -1 db (89%) peak in the middle. ReplayGain scanner with your settings (which are default for foobar2000, AFAIR) proposes -8.19 dB track gain, thus lowering volume level even more.
(I have nothing against lowering, I just need consistency between files' loudness  >:( )


Re: Feature request: "Equalize loudness" mode for ReplayGain scanner

Reply #8
Turn off the prevent clipping option?
Where? Both settings that I know ("Playback" -> "Processing" and "Advanced" -> "Tools" -> "ReplayGain Scanner" -> "File content alteration" -> "Prevent clipping") have no influence on ReplayGain calculation.

Here is my abovementioned example. Try to equalize its loudness with any of your files by any of the current ReplayGain scanner mode and settings.

Re: Feature request: "Equalize loudness" mode for ReplayGain scanner

Reply #9
I think you misunderstood something about RG. RG tries to reach just target loudness level. Exact number, for each file. Peaks have no impact on values achieved during scanning (apart from "peak" values themselves). To perform this, RG scanner scans file and calculates several values:
- track gain (required to achieve target loudness for track)
- album gain (required to achieve target average loudness for whole album)
but also:
- track peak - value that allows to LOWER REAL LOUDNESS to avoid clipping. You may ignore this value (mode: track, processing: apply gain), to achieve TARGET LOUDNESS UNTOUCHED however when it is ignored you may encounter audible crackles due to clipping
- album peak - value that allows to LOWER REAL LOUDNESS in several tracks belonging to an album, to avoid clipping at certain point across whole album - which may occur in completely different track than the one which is played at the moment. You may ignore this value (mode: album processing: apply gain), to achieve TARGET AVERAGE ALBUM LOUDNESS however when it is ignored you may encounter audible crackles due to clipping at least in one track from an album.

Remember, that not only "processing" setting is important in perceived loudness, but also mode - track/album. ALBUM will produce different PERCEIVED loudness for each track, while assuring, that overall/average loudness of an album will be at target level.

Re: Feature request: "Equalize loudness" mode for ReplayGain scanner

Reply #10
Clipping can be prevented only during playback. Replaygain scanner doesn't take this into account and doesn't try to prevent clipping.
Anyway, before creation of this topic I had synthesized short (5 sec) file with quiet (31.6% = -10 db) pure sine signal with -1 db (89%) peak in the middle. ReplayGain scanner with your settings (which are default for foobar2000, AFAIR) proposes -8.19 dB track gain, thus lowering volume level even more.
It doesn't mean that RG scanner tries to prevent clipping (there's no clipping to begin with).

Re: Feature request: "Equalize loudness" mode for ReplayGain scanner

Reply #11
Finally, I have discovered the root of my fallacy: http://wiki.hydrogenaud.io/index.php?title=ReplayGain_specification, https://en.wikipedia.org/wiki/ReplayGain (and many other sources that I read) state that ReplayGain target level is 89 dBSP = -14 DBFS. After that, I was not able to understand why calculated replay gain does not match to my expectations, and, moreover, why for -15..-17 dB tracks it is negative. I decided that this is impact of high peaks.

Today, after a new set of synthetic tests and calculations, I discovered that real target level is -18 dB. So now "all bits fell into their places in bytes" ;D

Thanks to all.

Re: Feature request: "Equalize loudness" mode for ReplayGain scanner

Reply #12
IIRC Peter implemented EBU128 in the RG scanner of foobar2000. Not sure this is of any help to you and I don't know much about all this gain scanning but I just remember I read that somewhere here in the forum.

Re: Feature request: "Equalize loudness" mode for ReplayGain scanner

Reply #13
You can find information about how foobar has set its reference level in an Advanced preferences page. See attached image.


Re: Feature request: "Equalize loudness" mode for ReplayGain scanner

Reply #14
EpicForever, that setting only affects SoundCheck tags. SoundCheck is the Apple's volume normalization scheme which foobar2000 can now write to Apple-supported formats. The reason to allow adjustment is to let user choose if he wants the loudness to match Apple computed values or ReplayGain values.

Apple values are useful if library consists of both Apple scanned files like iTunes purchases and foobar2000 scanned files and listening happens with Apple's player. ReplayGain level is useful if all files are scanned with foobar2000 and playing happens with both Apple player and third party ReplayGain-enabled players. That way the loudness with different players is the same.

Re: Feature request: "Equalize loudness" mode for ReplayGain scanner

Reply #15
I know what these settings do, however in this case they are also indicative - foobar uses -18dB as reference level (while SoundCheck uses -16 and RGv1 uses -14). And this is rather important information for @yup2 - that's why I posted this printscreen.
Knowing foobar's advanced settings could allow - at least at some rare cases - avoid prolonged searching for "what is reference level for RG" ;)

 

Re: Feature request: "Equalize loudness" mode for ReplayGain scanner

Reply #16
The thought occurred to me that you may mean to use it just for information purposes. But I figured to post the warning anyway. There have been confused people who have thought ReplayGain reference level is user configurable.

One correction though, ReplayGain reference level that has been in use has never changed, it's 89 dB SPL or "calibrated to a pink noise reference signal with a RMS level 14 dB below a full-scale sinusoid". Since the ITU BS1770 method computes loudness differently it needed to be level-matched to the ReplayGain levels. The match was found out to be -18 LUFS.