Delay, Haas

Download

     Disclaimer...

23   desc:Delay [Haas], v1.0.0
24  
25   slider1:67<-250,250,1>Delay [samples]
26   slider2:0<0,1,1>Mono/Stereo
27  
28   @init
29   buf = 0;
30   bufposR = 0;
31   delay = 67;
32   bufposW = delay;
33   buflength = 250;
34   stereo = 0;
35  
36   @slider
37   delay = slider1;
38   bufposR = bufposW - delay;
39   bufposR < 0 ? bufposR = bufPosR + buflength;
40   stereo = slider2;
41  
42   @sample
43   stereo < 1 ? (
44   mono = ( spl0 + spl1 ) / 2.0;
45   spl0 = mono;
46   spl1 = mono;
47   );
48  
49   delay == 0 ? (
50   spl0 = spl0;
51   spl1 = spl1;
52   ) :
53   (
54   delay > 0 ? (
55   x = spl0;
56   spl0 = buf[bufposR];
57   buf[bufposW] = x;
58   spl1 = spl1;
59   ) :
60   (
61   x = spl1;
62   spl1 = buf[bufposR];
63   buf[bufposW] = x;
64   spl0 = spl0;
65   );
66  
67   bufposR = bufposR + 1 ;
68   bufposR > buflength ? bufposR = 0;
69   bufposW = bufposW + 1 ;
70   bufposW > buflength ? bufposW = 0;

Download