junox
junox copied to clipboard
DCA - conversion from slider to gain
I used Sonic Visualiser to analyse this:
- Position +5 => 3.5 times slider position 0.
- Position 0 => 3.5 times slider position -5.
So if your slider returns [0-1] then the conversion formula will be close to:
POWER(1.2589, sliderPos*10)*0.1
We need to be careful of emitting outs that are outside of the range of -1 to +1. This is especially important when you play a 6-note power chord. I seem to remember that Web Audio's spec says that you may get distortion out side of these ranges (or blow out people's ear-drums).