View Single Post
Old 01-18-2019, 01:53 PM   #32
ErBird
Human being with feelings
 
Join Date: Jan 2017
Location: Los Angeles
Posts: 1,161
Default

Quote:
Originally Posted by citizenkeith View Post
Which saturation do you prefer to use instead?
Thanks for asking. I use my own JS which is tanh-based. Nothing out of the ordinary, but after spending time with every sigmoid algorithm I could find or come up with, I find it to be the best.

Here:
Code:
desc:Tanh Saturation

slider1:0<-6,24,1>Gain (dB)
slider2:0<-18,0,1>Ceiling (dB)

in_pin:left input
in_pin:right input
out_pin:left output
out_pin:right output

@slider

  preamp = 10^(slider1/20);
  ceiling = 10^(-slider2/20);
  inv_ceiling = 10^(slider2/20);

@sample

  spl0 *= preamp;
  spl1 *= preamp;
  
  spl0 *= ceiling;
  spl1 *= ceiling;
  
  spl0 = (2/(1+exp(-2*spl0)))-1;
  spl1 = (2/(1+exp(-2*spl1)))-1;
  
  spl0 *= inv_ceiling;
  spl1 *= inv_ceiling;
ErBird is offline   Reply With Quote