2 /* A simple waveshaping effect. */
4 declare name "fuzz -- a simple distortion effect";
5 declare author "Bram de Jong (from musicdsp.org)";
10 dist = hslider("distortion", 12, 0, 100, 0.1); // distortion parameter
11 gain = hslider("gain", 3, -96, 96, 0.1); // output gain (dB)
13 // the waveshaping function
14 f(a,x) = x*(abs(x) + a)/(x*x + (a-1)*abs(x) + 1);
16 // gain correction factor to compensate for distortion
19 process = vgroup("dist", (out, out))
20 with { out(x) = db2linear(gain)*g(dist)*f(db2linear(dist),x); };