input is x * gr[-1]
slope is 1 - ratio (feedback compressor)
Code: Select all
// this code works, but the attack time is scaled by the slope
xdb = toDb (rectifier (hp (input)))
hr = halfRectifier (xdb - thresholdb)
gr = toAmp (peakDetector(hr) * slope)