home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2007 January
/
PCWorld_2007-01_cd.bin
/
temacd
/
reaper
/
reaper147-install.exe
/
Effects
/
SStillwell
/
chorus
< prev
next >
Wrap
Text File
|
2006-08-17
|
1KB
|
65 lines
// This effect Copyright (C) 2004 and later Cockos Incorporated
// License: GPL - http://www.gnu.org/licenses/gpl.html
desc:chorus
slider1:15<1,250>chorus length (ms)
slider2:1<1,8,1>number of voices
slider3:0.5<0.1,16>rate (hz)
slider4:0.7<0,1>pitch fudge factor
slider5:-6<-100,12,1>wet mix (dB)
slider6:-6<-100,12,1>dry mix (dB)
@init
bpos=0;
@slider
numvoices=min(16,max(slider2,1));
choruslen=slider1*srate*0.001;
i=0;
loop(numvoices,
i[0]=(i+1)/numvoices*$pi;
i+=1;
);
bufofs=16384;
csize=choruslen/numvoices * slider4;
rateadj=slider3*2*$pi/srate;
wetmix = 2 ^ (slider5/6);
drymix = 2 ^ (slider6/6);
@sample
bpos >= choruslen ? (
bpos=0;
);
os0=spl0;
// calculate new sample based on numvoices
spl0=spl0*drymix;
vol=wetmix/numvoices;
i=0;
loop(numvoices,
tpos = bpos - (0.5+0.49*(sin( $pi*(i[0] += rateadj))/($pi*i[0]))) * (i+1) * csize;
tpos < 0 ? tpos += choruslen;
tpos > choruslen ? tpos -= choruslen;
spl0 += bufofs[tpos] * vol;
i+=1;
);
bufofs[bpos]=os0;
bpos+=1;
spl1=spl0;