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: ReplayGain Scanner - Same results for old and new versions (Read 1054 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

ReplayGain Scanner - Same results for old and new versions

Hey there.

I'm currently updating and tweaking my foobar player with a special focus on Loudness. I'm happy to have found workarounds for the LUFS and PLR Calculating. But as these numbers differ up to 3, sometimes even more db, I began researching (for hours) why. First I thought it may be an error in the script, so I studied a bit the coding. That was nice and interesting but took way to much time as you can imagine ;-) Then I went to the start of the chain - the Replaygain Scanner Settings and there I think I've found the reason.

On my installation I get the exact same results for both versions of the scanner. That is the case for the track gain (I haven't testet with AlbGain) and the TruePeak calculation (4 times OS). I double-checked and tried one time directly after switching checkmarks and the other time after restarting foobar.

I then let the track get analyzed by YouLean Loudness Meter, DROlline Meter, TB_EBULudness and REAPER's internal SWS Function to analyze and adjust items automatically. All these results are within a 0.5db range. But the foobar RG Calculation are way off for that track. On the other hand the EBU R 128 Meter which I discovered during these investigations is very close to the real LUFS that the analyzers show and the EBU R128 Compressor (Normalization) is also doing a great job playing all tracks at the same loudness. That plugin alone makes it quite unnecessary to calculated RG for all tracks but I want the figures for my  preselection and also for the great SMP-Playlist Tools.

Attached you find some screenshots to show the numbers.

Please have a look into that because it's way more handy to calculate LUFS directly in foobar instead of doing it outside as it can be made during a performance until finally some day all tracks will have gotten their tags ;-)

Many thanks in advance!




P.S.: it would be so cool to get a $round(x,#) function for foobar. It took me way longer that estimated to understand the formulas only because of working myself through the way to round numbers ^^

Re: ReplayGain Scanner - Same results for old and new versions

Reply #1
My Foobar2000 derived True Peak figures used to to tally almost exactly with my other professional meters (RX9 Advanced, Youlean Loudness Meter, RME Digicheck etc.), but during one of the updates over the last couple of years (not exactly sure which one), they started to be further off than my other readings, always reading significantly higher. Not sure when it happened, or why, and sorry it's not very helpful for you, I'm just saying it's something I noticed and I would also like to know how to change it back to be more accurate with my other meters. The LUFS Integrated figures all still tally very closely. I'm wondering if the way True Peak is measured changed in one of the updates?

Re: ReplayGain Scanner - Same results for old and new versions

Reply #2
The LUFS Integrated figures all still tally very closely. I'm wondering if the way True Peak is measured changed in one of the updates?


I believe that depends really a lot on the tracks dynamic and versatility how good the RG measuring is. But the calculated figures between v1 and v EBU, especially True Peak, should be different. When to take a closer look to the png's you'll see that both the measurements in foobar seem to be the V1 result.... means, that the EBU measurement is currently not really working..

Re: ReplayGain Scanner - Same results for old and new versions

Reply #3
On my installation I get the exact same results for both versions of the scanner.
I can't reproduce it, using 1.6.10 here. "Classic ReplayGain" and "EBU R128" produce different results for me, with the latter being the same as with other software, for LUFS-integrated values.
Note that for sample rates above 48k the result can be affected by the "Downsample high-definition content" option, but it looks like you're comparing with a 44.1k file, so IDK.
I would suggest also testing with a clean (portable) install of f2k, if you haven't already.


My Foobar2000 derived True Peak figures used to to tally almost exactly with my other professional meters (RX9 Advanced, Youlean Loudness Meter, RME Digicheck etc.), but during one of the updates over the last couple of years (not exactly sure which one), they started to be further off than my other readings, always reading significantly higher. Not sure when it happened, or why, and sorry it's not very helpful for you, I'm just saying it's something I noticed and I would also like to know how to change it back to be more accurate with my other meters. The LUFS Integrated figures all still tally very closely. I'm wondering if the way True Peak is measured changed in one of the updates?
True Peak results can vary a lot depending on the resampler settings. IDK if the defaults have changed over the years in f2k, because I've only recently started to pay attention.
But I think SoX with the default settings (linear phase, 95% passband, x4) is pretty close to most other True Peak scanners. I found that changing phase and passband settings has the biggest effect.

Re: ReplayGain Scanner - Same results for old and new versions

Reply #4
Well, that is very strange...

After your comment Brand, I tried it again but I have to say, that one component crashed my foobar totally so I had to reset and rebuild everything again (beside the exported Display Settings that I could import).

The very first scan I've made I did in Classic Setting with true peak off. That was a totally different measure than before..

Then I activated TP-Scan and left the mode on classic. The results chainged as expected, but to my surprise both of em not just the tp/peak result.

Then I've made another measurement after I've chosen the new EBU mode and regular Peak. To my surprise none of the results have changed.

Last measurement has been EBU mode and TP on....Again the same results like when I only changed the TP measurement

Now, when I go back to V1 / regular Peak the result of the measurement stays the same and it's not going back to the very first V1 measurements. That's a bit odd, no?

anyhow....as it seems ..the results are now EBU and TP ;-)

Brand, what do you mean by that: True Peak results can vary a lot depending on the resampler settings. IDK if the defaults have changed over the years in f2k, because I've only recently started to pay attention.
But I think SoX with the default settings (linear phase, 95% passband, x4) is pretty close to most other True Peak scanners. I found that changing phase and passband settings has the biggest effect.?????

I now checked another song: TP measurements are quite equal but the RG (together with the LUFS Calculation Formular that I've found) are agin 1,5db off :/

Thanks for double-checking the 4 measurements like I did to find out what may be wrong on my side here that the measurement method doesn't change back.. And...mmhh.

Does anybody know if there is an already compiled component for the R128 Scanner? I can't find it

Re: ReplayGain Scanner - Same results for old and new versions

Reply #5
Does anybody know if there is an already compiled component for the R128 Scanner? I can't find it

ffmpeg can be used, I wrapped it on SPM to automatically tag files after analyzing, check Playlist Tools on my sig. Other tools/Write tags

There are also code samples to display LRA, LUFS and PLR there too at presets/UI

Re: ReplayGain Scanner - Same results for old and new versions

Reply #6
Brand, what do you mean by that: True Peak results can vary a lot depending on the resampler settings. IDK if the defaults have changed over the years in f2k, because I've only recently started to pay attention.
But I think SoX with the default settings (linear phase, 95% passband, x4) is pretty close to most other True Peak scanners. I found that changing phase and passband settings has the biggest effect.?????
True peak scanning in f2k lets you choose different resamplers and tweak their settings.
I posted some questions and findings about it in this thread. But long story short: "true peak" isn't very aptly named, because the peaks can change depending on how you produce them and the same applies to real world peaks, because not all DACs are the same. So there isn't one true peak value that applies to every playback device.

Anyway, I ended up using the SoX resampler component for TP scanning, with linear phase and 95% passband. I compared the results with some other TP scanners outside of f2k and they were similar, so I guess they also use linear phase filters when oversampling.

Re: ReplayGain Scanner - Same results for old and new versions

Reply #7
Anyway, I ended up using the SoX resampler component for TP scanning, with linear phase and 95% passband. I compared the results with some other TP scanners outside of f2k and they were similar, so I guess they also use linear phase filters when oversampling.

thanks - I'll try the SoX resampler

Re: ReplayGain Scanner - Same results for old and new versions

Reply #8
ffmpeg can be used, I wrapped it on SPM to automatically tag files after analyzing, check Playlist Tools on my sig. Other tools/Write tags

There are also code samples to display LRA, LUFS and PLR there too at presets/UI

Thanks regor! I've just discovered your great tools the other day and I'm trying to getting used to it. Since a day or two I get error warnings when I re-open foobar.

With regards to TP-scanning. I haven't used the Write Tag feature so far - will have a look into it, too.

The examples to add columns in playlist view I have discovered and they work as expected and I'm thankful for these well craftet presets. BUT they can only be as good as the basic analysing works. I think especially with regards to the ReplayGain Scan (...track_peak) as there is for me the biggest difference to other outside foobar tools. And as long as these values differ between 1.5 up to 3 or even more db to the values that the other named tools find all the other calculatins have to fail....

For me the R128 compressor works great and I'm a bit wondering that we don't have a scanner in foobar which uses this method ... I know the RG scan should do that, but with my oversations I think that RG does still work differently and at least on my machine I cannot switch to v1 calculations (at least the results don't change). There seem to be a glitch and ... well that is just my humble opinion.. I think RG scan even in R128 mode calculates a different result than the r128 compressor (internally) to manage the same playback loudness at -18dB for all playing tracks. The last one is really working great as I control the levels in REAPER through which all of my audio goes before heading the monitors.

Re: ReplayGain Scanner - Same results for old and new versions

Reply #9
Due to this thread I recently switched back to the SoX Resampler and now everything is as it was before and the True Peak results tally with my other audio software.

I can easily see LUFS I, True Peak, and PLR per track, but does anyone have a string to display Loudness Range/LRA figures?

Re: ReplayGain Scanner - Same results for old and new versions

Reply #10
Due to this thread I recently switched back to the SoX Resampler and now everything is as it was before and the True Peak results tally with my other audio software.

I can easily see LUFS I, True Peak, and PLR per track, but does anyone have a string to display Loudness Range/LRA figures?

I will defenitely try that one, too.

To calculate the other values check out regors great SMP

"There are also code samples to display LRA, LUFS and PLR there too at presets/UI "

Re: ReplayGain Scanner - Same results for old and new versions

Reply #11
Thanks, but I meant without having to use a third party component like Spider Monkey, e.g.

PLR:
$puts(PLR,$if(%replaygain_track_peak_db%, $puts(PLR,$sub($mul($replace(%replaygain_track_peak_db%,.,),10),$sub($mul($replace(%replaygain_track_gain%,.,),-10),18000))) $puts(PLR_TEN,$left($right($get(PLR),3),2)) $puts(PLR_ROUND,$ifgreater($get(PLR_TEN),40,$add($get(PLR),100),$get(PLR)))$iflonger($get(PLR_ROUND),4,<$left($get(PLR_ROUND),2)<.$substr($get(PLR_ROUND),3,3),$left($get(PLR_ROUND),1)<.$substr($get(PLR_ROUND),2,2)),))$get(PLR)

LUFS Integrated:
$if(%replaygain_track_gain%,$puts(l,$sub(-1800,$replace(%replaygain_track_gain%,.,)))$div($get(l),100).$right($get(l),2) dB,)

Re: ReplayGain Scanner - Same results for old and new versions

Reply #12
Thanks, but I meant without having to use a third party component like Spider Monkey, e.g.

PLR:
$puts(PLR,$if(%replaygain_track_peak_db%, $puts(PLR,$sub($mul($replace(%replaygain_track_peak_db%,.,),10),$sub($mul($replace(%replaygain_track_gain%,.,),-10),18000))) $puts(PLR_TEN,$left($right($get(PLR),3),2)) $puts(PLR_ROUND,$ifgreater($get(PLR_TEN),40,$add($get(PLR),100),$get(PLR)))$iflonger($get(PLR_ROUND),4,<$left($get(PLR_ROUND),2)<.$substr($get(PLR_ROUND),3,3),$left($get(PLR_ROUND),1)<.$substr($get(PLR_ROUND),2,2)),))$get(PLR)

LUFS Integrated:
$if(%replaygain_track_gain%,$puts(l,$sub(-1800,$replace(%replaygain_track_gain%,.,)))$div($get(l),100).$right($get(l),2) dB,)


I know that code :-) But that gives me results who are to way off the results that I get from the other ones mentioned enough here ;-) because the RG Scanner seems to calculate the RG track gain in EBU R128 mode not correctly or in a different way as the other tools. That said the result of calculations based on the RG results can't be better..

Re: ReplayGain Scanner - Same results for old and new versions

Reply #13
The LUFS I figures from that string correspond extremely closely to RX 9 Advanced, RME Digicheck, Youlean Loudness Meter, REAPER and Acon Acoustica, never off by more than a tenth of a dB, good enough for me!

It was the TP figures that were off for me, but fixed since going back to the SoX Resampler.

Re: ReplayGain Scanner - Same results for old and new versions

Reply #14
Thanks, but I meant without having to use a third party component like Spider Monkey, e.g.

PLR:
$puts(PLR,$if(%replaygain_track_peak_db%, $puts(PLR,$sub($mul($replace(%replaygain_track_peak_db%,.,),10),$sub($mul($replace(%replaygain_track_gain%,.,),-10),18000))) $puts(PLR_TEN,$left($right($get(PLR),3),2)) $puts(PLR_ROUND,$ifgreater($get(PLR_TEN),40,$add($get(PLR),100),$get(PLR)))$iflonger($get(PLR_ROUND),4,<$left($get(PLR_ROUND),2)<.$substr($get(PLR_ROUND),3,3),$left($get(PLR_ROUND),1)<.$substr($get(PLR_ROUND),2,2)),))$get(PLR)

LUFS Integrated:
$if(%replaygain_track_gain%,$puts(l,$sub(-1800,$replace(%replaygain_track_gain%,.,)))$div($get(l),100).$right($get(l),2) dB,)


I know that code :-) But that gives me results who are to way off the results that I get from the other ones mentioned enough here ;-) because the RG Scanner seems to calculate the RG track gain in EBU R128 mode not correctly or in a different way as the other tools. That said the result of calculations based on the RG results can't be better..
Theoretically if you can compute PLR and LUFS with ffmpeg (and sure you can) it would be trivial to add those tags to the list of tags to be calculated by my script. That's it... if you find ffmpeg being more accurate (?). I have to note that my RG results are pretty accurate too though (compared to audition, music bee, Izotope,... , so maybe there is an error on your config at some place (?).

This is an example of my batch file, which outputs LRA to a json file
Code: [Select]
REM Helper to execute ffmpeg.exe (%3) on input (%1) and save output to file (%2)
REM Retrieves LRA data as json
@ECHO OFF
%3 -i %1 -af loudnorm=dual_mono=true:print_format=json -nostats -f null -  2>&1 | > %2 FINDSTR /BIR "{ .*\" }"

If you manage to do the same for PLR and LUFS (it would be preferable to have both values calculated at once), I would gladly code the other part (menu entries, tagging, etc.).

Quote
Thanks regor! I've just discovered your great tools the other day and I'm trying to getting used to it. Since a day or two I get error warnings when I re-open foobar.
Error warning? Or slow script popup? The second is not a problem of my scripts but a SMP thing, you can configure SMP to adjust the time before warning at advanced config.

Re: ReplayGain Scanner - Same results for old and new versions

Reply #15
The LUFS I figures from that string correspond extremely closely to RX 9 Advanced, RME Digicheck, Youlean Loudness Meter, REAPER and Acon Acoustica, never off by more than a tenth of a dB, good enough for me!

It was the TP figures that were off for me, but fixed since going back to the SoX Resampler.

That is really strange.... maybe I chose only hard to calculate tracks..don't know. The results on my machine are to a very high degree between 1,5 and 3,5 db different and so the LUFS and PLR Calculation...mmhh., and I'm pretty sure that I've copied the formula exactly....

Re: ReplayGain Scanner - Same results for old and new versions

Reply #16
Thanks, but I meant without having to use a third party component like Spider Monkey, e.g.

PLR:
$puts(PLR,$if(%replaygain_track_peak_db%, $puts(PLR,$sub($mul($replace(%replaygain_track_peak_db%,.,),10),$sub($mul($replace(%replaygain_track_gain%,.,),-10),18000))) $puts(PLR_TEN,$left($right($get(PLR),3),2)) $puts(PLR_ROUND,$ifgreater($get(PLR_TEN),40,$add($get(PLR),100),$get(PLR)))$iflonger($get(PLR_ROUND),4,<$left($get(PLR_ROUND),2)<.$substr($get(PLR_ROUND),3,3),$left($get(PLR_ROUND),1)<.$substr($get(PLR_ROUND),2,2)),))$get(PLR)

LUFS Integrated:
$if(%replaygain_track_gain%,$puts(l,$sub(-1800,$replace(%replaygain_track_gain%,.,)))$div($get(l),100).$right($get(l),2) dB,)


I know that code :-) But that gives me results who are to way off the results that I get from the other ones mentioned enough here ;-) because the RG Scanner seems to calculate the RG track gain in EBU R128 mode not correctly or in a different way as the other tools. That said the result of calculations based on the RG results can't be better..
Theoretically if you can compute PLR and LUFS with ffmpeg (and sure you can) it would be trivial to add those tags to the list of tags to be calculated by my script. That's it... if you find ffmpeg being more accurate (?). I have to note that my RG results are pretty accurate too though (compared to audition, music bee, Izotope,... , so maybe there is an error on your config at some place (?).

This is an example of my batch file, which outputs LRA to a json file
Code: [Select]
REM Helper to execute ffmpeg.exe (%3) on input (%1) and save output to file (%2)
REM Retrieves LRA data as json
@ECHO OFF
%3 -i %1 -af loudnorm=dual_mono=true:print_format=json -nostats -f null -  2>&1 | > %2 FINDSTR /BIR "{ .*\" }"

If you manage to do the same for PLR and LUFS (it would be preferable to have both values calculated at once), I would gladly code the other part (menu entries, tagging, etc.).

Quote
Thanks regor! I've just discovered your great tools the other day and I'm trying to getting used to it. Since a day or two I get error warnings when I re-open foobar.
Error warning? Or slow script popup? The second is not a problem of my scripts but a SMP thing, you can configure SMP to adjust the time before warning at advanced config.

thank you regor! I'll check it out when I'm back home on my studio pc

Re: ReplayGain Scanner - Same results for old and new versions

Reply #17
Does anybody know if there is an already compiled component for the R128 Scanner? I can't find it

ffmpeg can be used, I wrapped it on SPM to automatically tag files after analyzing, check Playlist Tools on my sig. Other tools/Write tags

There are also code samples to display LRA, LUFS and PLR there too at presets/UI

Moin regor. It seems that I'm missing a dll or something... I'm now having ffmpeg on my pc and it works. When I go to Write Tags two items are greyed out: foo Fingerprinting and EBUR 128 Scanner. How can I get these to work? I'd really love to try that ebu scanner as the regular RG scanner doesn't show the right figures for me. TP is only the regular peek, I double checked that with a lot of songs and the so called TP value is exactly the same as the regular peak with all the other analyzers... May I'm missing a dll on my system that TP scanning is not really working? Yesterday I scanned a track and TP was 1,3 db higher than regular peak so all the calculations based on that number can only be wrong...

Re: ReplayGain Scanner - Same results for old and new versions

Reply #18
"This is an example of my batch file, which outputs LRA to a json file"

regor - please help me. Where and how do I use this batch file? Does it have to be in a specific folder?

 

Re: ReplayGain Scanner - Same results for old and new versions

Reply #19
Quote
Theoretically if you can compute PLR and LUFS with ffmpeg (and sure you can) it would be trivial to add those tags to the list of tags to be calculated by my script. That's it... if you find ffmpeg being more accurate (?). I have to note that my RG results are pretty accurate too though (compared to audition, music bee, Izotope,... , so maybe there is an error on your config at some place (?).

I checked a couple tracks with all the analyzers I've got and on my system RG Scanner is not working correctly but indeed the ffmpeg results are very very close to the results of youlean, etc...

How can I get ffmpeg into your great scripts and/or how do I get the EBUR 128 Scanner available? That is all a bit high for my current scripting skills..