Pan, Delay Pro

Download

     Disclaimer...

27   desc:Pan: Delay Pro, v1.1.0
28  
29   slider1:0<-72,72,1>Buffer Length [samples]
30   slider2:0<0,10,0.1>Max Attenuation [dB]
31  
32  
33   @init
34   buf = 0; // buffer exists at offset 0
35   bufposR = 0;
36   delay = 0;
37   bufposW = delay;
38   buflength = 72; // good value for headphones
39   // may not be ideal for speakers
40   m = 1.0;
41  
42  
43   @slider
44   delay = slider1;
45   d = delay;
46   d < 0 ? d = d * -1; // absolute value
47   bufposR = bufposW - d;
48   bufposR < 0 ? bufposR = bufPosR + buflength;
49  
50   b = abs((slider1) / 72);
51   c = -b * slider2; // scale; no att. at 12:00
52   m = pow(10, (c /20));
53  
54  
55   @sample
56   delay == 0 ? (
57   spl0=spl0;
58   spl1=spl1;
59   ) : (
60   delay < 0 ? (
61   x = spl1;
62   spl1 = buf[bufposR] *= m;
63   buf[bufposW] = x;
64   bufposR = bufposR + 1 ;
65   bufposR > buflength ? bufposR = 0;
66   bufposW = bufposW + 1 ;
67   bufposW > buflength ? bufposW = 0;
68  
69   spl0 = spl0;
70  
71   ) : (
72   x = spl0;
73   spl0 = buf[bufposR] *= m;
74   buf[bufposW] = x;
75   bufposR = bufposR + 1 ;
76   bufposR > buflength ? bufposR = 0;
77   bufposW = bufposW + 1 ;
78   bufposW > buflength ? bufposW = 0;
79  
80   spl1 = spl1;
81   );
82   );
83  

Download