@Case
After googling a lot it seems that for LUFS-I positive values and negative values are both used to talk about the same thing.
It seems as if %truepeak_scanner_track_lufs_i% only has negative values.
Is it correct to assume Truepeak Scanner never publishes positive values?
For display purposes I only report positive values.
I want my routine for displaying LUFS-I and PLR as flexible as possible, so when available I use Truepeak tags and otherwise fallback to RG tags.
When %truepeak_scanner_track_lufs_i% exists, I use that value otherwise I calculate it:
$puts(keyval_v,[$replace(%truepeak_scanner_track_lufs_i%,-,, LUFS,)])
$if($get(keyval_v),
,
$puts(keyval_p,0)
$puts(keyval_g,[$if2(%truepeak_scanner_track_gain%,%replaygain_track_gain%)])
$if($and($get(keyval_p),$get(keyval_g)),
$puts(keyval_v,$num($add(1800,$replace($get(keyval_p),.,),$replace($get(keyval_g),.,)),3))
$puts(keyval_v,$insert($get(keyval_v),.,$sub($len($get(keyval_v)),2)))
)
)
$get(keyval_v)
Works fine and as far as I can see always gives the same result as the absolute value of %truepeak_scanner_track_lufs_i%.
It also means I can calculate/display LUFS-I if either Truepeak Scanner with/without write RG tags or foobar RG scanner has run.
I use the same function for PLR but in that case I change the first line to:
$puts(keyval_p,[%replaygain_track_peak_db%])
Works fine too.
The issue I'm having is don't see the truepeak equivalent for %replaygain_track_peak_db%. The tag itself is not displayed in Properties.
I know it is available when foobar RG scan has run and also when I use Truepeak scanner with writing RG values enabled. If I use Truepeak without write RG values enabled the tag is not published.
I'd like to be able to calculate PLR even as %replaygain_track_peak_db% is not available. So I would need something like %truepeak_scanner_track_peak_db% or a way to calculate this value based on the already available truepeak tags.
Is there a way to calculate this peak_db value from available truepeak tags?