View Single Post
Old 05-23-2017, 02:41 AM   #5
Aesis
Human being with feelings
 
Join Date: Jan 2011
Posts: 445
Default

Quote:
Originally Posted by jrengmusic View Post
Code:
desc:Single Tap Inverted Delay
//tags: Inverted Delay
//author: JRENG!
/*
JRENG! (C) MMXVII
License: WTFPL - http://www.wtfpl.net
*/

slider1:d=300<0,1000,1>Delay [ms]
slider2:f=0<0,100,1>Feedback [%]
slider3:m=100<0,100,1>Mix [%]
slider4:i=1<0,1,1{NORMAL,INVERTED}>Polarity

@slider
length = d * 0.001 * srate;
feedback = f * 0.01;
mix = m * 0.01;

@sample
in0 = spl0;
in1 = spl1;

bpos[0] = in0 + delay0 * feedback;
bpos[1] = in1 + delay1 * feedback;

bpos += 2 ;
bpos > length ? bpos = 0;

delay0 = bpos[0] * mix; 
delay1 = bpos[1] * mix;

i ? (
  delay0 *= -1;
  delay1 *= -1;
);


spl0 += delay0;
spl1 += delay1;
Thank you! Great work...

But it doesn't quite work, the feedback loop is too long by one sample. Besides that the timing is half what it claims.
Aesis is offline   Reply With Quote