X-Git-Url: https://scm.cri.ensmp.fr/git/Faustine.git/blobdiff_plain/c7f552fd8888da2f0d8cfb228fe0f28d3df3a12c..b4b6f2ea75b9f0f3ca918f5b84016610bf7a4d4f:/interpretor/preprocessor/faust-0.9.47mr3/tools/faust2pd/examples/synth/chorus.dsp diff --git a/interpretor/preprocessor/faust-0.9.47mr3/tools/faust2pd/examples/synth/chorus.dsp b/interpretor/preprocessor/faust-0.9.47mr3/tools/faust2pd/examples/synth/chorus.dsp new file mode 100644 index 0000000..8235ff4 --- /dev/null +++ b/interpretor/preprocessor/faust-0.9.47mr3/tools/faust2pd/examples/synth/chorus.dsp @@ -0,0 +1,35 @@ + +/* Stereo chorus. */ + +declare name "chorus -- stereo chorus effect"; +declare author "Albert Graef"; +declare version "1.0"; + +import("music.lib"); + +level = hslider("level", 0.5, 0, 1, 0.01); +freq = hslider("freq", 3, 0, 10, 0.01); +dtime = hslider("delay", 0.025, 0, 0.2, 0.001); +depth = hslider("depth", 0.02, 0, 1, 0.001); + +tblosc(n,f,freq,mod) = (1-d)*rdtable(n,waveform,i&(n-1)) + + d*rdtable(n,waveform,(i+1)&(n-1)) +with { + waveform = time*(2.0*PI)/n : f; + phase = freq/SR : (+ : decimal) ~ _; + modphase = decimal(phase+mod/(2*PI))*n; + i = int(floor(modphase)); + d = decimal(modphase); +}; + +chorus(dtime,freq,depth,phase,x) + = x+level*fdelay(1<<16, t, x) +with { + t = SR*dtime/2*(1+depth*tblosc(1<<16, sin, freq, phase)); +}; + +process = vgroup("chorus", (left, right)) +with { + left = chorus(dtime,freq,depth,0); + right = chorus(dtime,freq,depth,PI/2); +};