home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2008 February
/
PCWorld_2008-02_cd.bin
/
audio-video
/
reaper
/
reaper2028-install.exe
/
Effects
/
SStillwell
/
delay_tempo
< prev
next >
Wrap
Text File
|
2007-12-03
|
2KB
|
82 lines
// This effect Copyright (C) 2004 and later Cockos Incorporated
// License: GPL - http://www.gnu.org/licenses/gpl.html
desc: simple delay
slider1:0<0,13000,1>delay (ms) - 0 for beatsync
slider2:-120<-120,6,1>feedback (dB)
slider3:0<-120,6,1>mix in (dB)
slider4:-6<-120,6,1>output wet (dB)
slider5:0<-120,6,1>output dry (dB)
slider6:0<0,1,1{off,on}>resample on length change
slider7:0.25<0.0625,4,0.0625>beatsync - fraction of whole note
@init
delaypos=0;
@slider
beat = 240 * slider7;
wetmix = 2 ^(slider2/6);
drymix = 2 ^(slider3/6);
wetmix2 = 2 ^(slider4/6);
drymix2 = 2 ^(slider5/6);
@block
odelay=delaylen;
slider1==0 ? (
delaylen=min((beat / tempo)*srate,500000);
):(
delaylen=min(slider1 * srate / 1000,500000);
);
odelay != delaylen ? (
slider6 && odelay > delaylen ? (
// resample down delay buffer, heh
rspos=0; rspos2=0;
drspos=odelay/delaylen;
loop(delaylen,
tpos = ((rspos)|0)*2;
rspos2[0]=tpos[0];
rspos2[1]=tpos[1];
rspos2+=2;
rspos+=drspos;
);
delaypos /= drspos;
delaypos|=0;
delaypos<0?delaypos=0;
) : (
slider6 && odelay < delaylen ? (
// resample up delay buffer, heh
drspos=odelay/delaylen;
rspos=odelay;
rspos2=delaylen*2;
loop(delaylen,
rspos-=drspos;
rspos2-=2;
tpos = ((rspos)|0)*2;
rspos2[0]=tpos[0];
rspos2[1]=tpos[1];
);
delaypos /= drspos;
delaypos|=0;
delaypos<0?delaypos=0;
) : (!slider6 && delaypos >= delaylen ? delaypos = 0);
);
freembuf(delaylen*2);
);
@sample
dpint = delaypos*2;
os1=dpint[0];
os2=dpint[1];
dpint[0]=min(max(spl0*drymix + os1*wetmix,-4),4);
dpint[1]=min(max(spl1*drymix + os2*wetmix,-4),4);
(delaypos+=1) >= delaylen ? delaypos=0;
spl0=spl0*drymix2 + os1*wetmix2;
spl1=spl1*drymix2 + os2*wetmix2;