I’ve created a volume slider using the new lambda feature in NormalisableRange. However, when I set the endpoint to 12.0f, the slider only displays 0 and volume doesn’t go beyond 0 dB in host (Ableton/Reaper).
#define MIN_INFINITY_DB -96.0f
<--->
NormalisableRange<float> decibelRange = NormalisableRange<float>(MIN_INFINITY_DB, 12.0f,
[](float min, float end, float gain) { return gain > 0.0f ? 20.0f * log10(gain) : min; },
[](float min, float end, float dB) { return dB > min ? std::pow(10.0f, dB * 0.05f) : 0.0; }
) ;
addParameter (gainParam = new AudioParameterFloat("volume", "Volume" , decibelRange, -6.0f));
I use the exact same conversion from decibels to float before calling buffer.applyGain(…).
Where does it go wrong?
