mirror of
https://github.com/italicsjenga/saturator-faust.git
synced 2024-12-23 06:01:30 +11:00
soft clipping
This commit is contained in:
parent
437f3ed2be
commit
6a09623022
|
@ -3,7 +3,7 @@ import("aanl.lib");
|
|||
import("maths.lib");
|
||||
import("basics.lib");
|
||||
|
||||
process = driver : wrapper : aa.hardclip2 : trimmer;
|
||||
process = driver : wrapper : softclip : aa.hardclip2 : trimmer;
|
||||
|
||||
driver(x) = x * drive * squeeze;
|
||||
trimmer(x) = x * (1 / squeeze);
|
||||
|
@ -18,3 +18,13 @@ slider_raw = nentry("clipping", 0, 0, 1, 0.01);
|
|||
slider = (.85*slider_raw)+0.15;
|
||||
fadeamt = min(20*slider_raw, 1);
|
||||
clipamt = max(ma.EPSILON, (slider^2)*20);
|
||||
|
||||
softclip = softclipamt, _ : softclip_maths ;
|
||||
softclip_maths( a1, x ) = min( a0 , atan((a0 - a1)/a2 ) * a2 + a1 ) * a3
|
||||
with{
|
||||
a0 = abs(x);
|
||||
a2 = (1-a1) * 2/ma.PI ;
|
||||
a3 = ma.signum(x) ;
|
||||
};
|
||||
|
||||
softclipamt = db2linear(nentry("softclip", 0, 0, 1, 0.01) * -3) : si.smoo;
|
Loading…
Reference in a new issue