View Single Post
Old 01-11-2017, 10:00 PM   #19
SaulT
Human being with feelings
 
Join Date: Oct 2013
Location: Seattle, WA
Posts: 774
Default

I wrote something like this a little while ago. Tweaked with suggestions from ashcat and Tale. Set the smoothing value very high to get a more exaggerated effect. This follows an exponential curve.

Code:
desc:volume adjustment smooth gain utility function (SaulT wBabaGvaluemods + Tale)

slider1:0<-150,60,0.1>Adjustment (dB) (-150 = -inf)
slider3:200<1,2000,1>Smoothing (ms)

@slider
  adj1=slider1 > -150 ? 10 ^ (slider1/20) : 0; 
  coeff = exp(-5/(slider3/1000*srate));

@sample

adj1_s = adj1_s*coeff + adj1*(1-coeff);

spl0 *= adj1_s;
spl1 *= adj1_s;
SaulT is offline   Reply With Quote