Distortion, Bit Crusher

Download

     Disclaimer...

23   desc:Distortion, Bit Crusher, v1.0.0
24  
25   slider1:8<3,16,1>Bits [#]
26  
27   @init
28   bits = 8;
29   scale = 128;
30  
31   @slider
32   bits = slider1;
33   scale = pow(2, bits-1) * 1.0;
34   scale -= 1;
35  
36   @sample
37   x = spl0 * scale; // -127 < x < 127
38   y = floor(x) * 1.0;
39   spl0 = y / scale;
40  
41   x = spl1 * scale;
42   y = floor(x) * 1.0;

Download

Distortion, Crossover

Download

     Disclaimer...

23   desc:Distortion, Crossover, v1.0.0
24  
25   slider1:0.05<0,0.1,0.001>Threshold
26   slider2:1<1,10,0.01>Linear Gain
27  
28   @init
29   thresh = 0.05;
30   gain = 0;
31  
32   @slider
33   thresh = slider1;
34   gain = slider2;
35  
36   @sample
37   spl0 = spl0;
38   spl0 > 0 ? (
39   input -= th;
40   ) : (
41   input += th;
42   );
43  
44   spl0 < thresh ? (
45   spl0 > -thresh ? (
46   spl0 = spl0 * gain;
47   );
48   );
49  

Download

Distortion, Non-Linear, µLaw

Download

     Disclaimer...

23   desc:Distortion: Non-Linearity, µLaw, v1.0.0
24  
25   slider1:0<0,1.0,0.01>µ
26   slider2:0<0,1.0,0.01>gain
27  
28   @init
29   mu = 0;
30   gain = 1.0;
31  
32   @slider
33   mu = slider1 * 4; // 255
34   gain = slider2;
35  
36   @sample
37   mu > 0 ? (
38   spl0 < 0 ? (
39   spla = -(log(1 + (mu * -spl0)) / log(1 + mu));
40   ) : (
41   spla = (log(1 + (mu * spl0)) / log(1 + mu));
42   );
43   ) : ( spla = spl0; );
44   spl0 = spla * gain;
45  

Download

Distortion, Rectifier, Full-Wave

Download

     Disclaimer...

23   desc:Distortion: Rectifier, Full-Wave, v1.0.0
24  
25   slider1:0.5<0,2.0,0.01>Linear Gain
26  
27   @init
28   gain = 1.0;
29  
30   @slider
31   gain = slider1;
32  
33   @sample
34   spl0 < 0 ? ( spla = -spl0; ) : ( spla = spl0; );
35   spl0 = spla * gain;
36  

Download