[Request] fb2k additional arithmetic functions
2013-12-20 23:53:17
Hello Peter, I would love to have some additional arithmetic functions in fb2k to calculate more "audiophile" values for the standard replaygain values. What is the reason behind my wish? While current popular music is getting compressed to death by the mastering studios to sound as "loudly" as possible and thus leading to big negative replaygain values, in other genres like classical music or acoustic jazz etc. this is usually not the case (thank God ). Here the replaygain process mostly calculates positive replaygain values which, after application to the musical signal often results in digital levels >1 - meaning distortion. To attenuate this behaviour there is a foobar player function "apply gain and prevent clipping according to peak" - but this function introduces an other nonlinear behaviour to the transfer function which is not compatible with "audiophile law" (to say the least). So, my idea to circumvent the problems of "old school" replaygain without completely relinquishing its merits for automatic mixes in the environment of big musical collections would be to calculate "audiophile-compatible" replaygain values for RG_TG and RG_AG. These replaygain values avoid digital levels >1 in any case. These values should be calculated as follows: (TG - %REPLAYGAIN_TRACK_GAIN%, TP - %REPLAYGAIN_TRACK_PEAK%, AG - %REPLAYGAIN_ALBUM_GAIN%, AP - %REPLAYGAIN_ALBUM_PEAK%) I. For TG if TG>0 [blockquote]TG = min(TG, 20*abs(log(TP)))[/blockquote] II. For AG if AG>0 [blockquote]AG = min(AG, 20*abs(log(AP)))[/blockquote] To build these formulas with fb2k's built-in formatting language three additional arithmetic functions would be required. In contrast to fb2k's already built-in math functions these would have to perform arithmetic on real numbers (thus prefixed with "r_"):$r_abs(a) - positive value of a $r_log(a) - natural logarithm of a $r_min(a,b) - minimum of a and b Needless to say that a smarter alternative to realize the desired "audiophile replaygain" values would be to implement the formulas into the core code of fb2k - and I would greatly appreciate this approach. During my research in the field of replaygain I found uncounted examples of questionable implementations in software players but also in extremely expensive streamer devices even of sophisticated audiophile brands. Why not make fb2k a real forerunner in the audiophile replaygain world? /audiogene