the unit of the mixer faders is now dB using the range -50 dB to 0 dB

This commit is contained in:
Volker Fischer 2020-04-13 21:00:26 +02:00
parent 21318f993d
commit 9cbcbb1471
2 changed files with 13 additions and 3 deletions

View file

@ -8,11 +8,11 @@
* refresh server list if the Central Server address type is changed
* the unit of the mixer faders is now dB using the range -50 dB to 0 dB
* bug fix: the server welcome message may appear twice if the server list was double clicked
TODO mixer faders linear -> log gain is better: CalcFaderGain() -> x = -50:1:0; plot(x, (10 .^ (x / 10)))
TODO offer the Jamulus ASIO settingspanel in case of an ASIO ERROR to fix, e.g., incorrect sample rate (https://sourceforge.net/p/llcon/discussion/533517/thread/777663cf94/#035f)
TODO issue with Mac audio interface: https://sourceforge.net/p/llcon/discussion/software/thread/7c443f2ed9/#eeab

View file

@ -506,7 +506,17 @@ double CChannelFader::CalcFaderGain ( const int value )
{
// convert actual slider range in gain values
// and normalize so that maximum gain is 1
return static_cast<double> ( value ) / AUD_MIX_FADER_MAX;
const double dInValueRange0_1 = static_cast<double> ( value ) / AUD_MIX_FADER_MAX;
// map range from 0..1 to range -50..0 dB and calculate linear gain
if ( value == 0 )
{
return 0; // -infinity
}
else
{
return pow ( 10, ( dInValueRange0_1 * 50 - 50 ) / 20 );
}
}