X-Git-Url: https://scm.cri.ensmp.fr/git/Faustine.git/blobdiff_plain/1059e1cc0c2ecfa237406949aa26155b6a5b9154..66f23d4fabf89ad09adbd4dfc15ac6b5b2b7da83:/interpreter/preprocessor/faust-0.9.47mr3/tools/faust2pd/examples/seqdemo/chorus.dsp diff --git a/interpreter/preprocessor/faust-0.9.47mr3/tools/faust2pd/examples/seqdemo/chorus.dsp b/interpreter/preprocessor/faust-0.9.47mr3/tools/faust2pd/examples/seqdemo/chorus.dsp new file mode 100644 index 0000000..96873bd --- /dev/null +++ b/interpreter/preprocessor/faust-0.9.47mr3/tools/faust2pd/examples/seqdemo/chorus.dsp @@ -0,0 +1,29 @@ + +/* A simple chorus effect. */ + +declare name "chorus -- a simple 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", 2, 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(d,freq,depth) = fdelay(1<<16, t) +with { t = SR*d/2*(1+depth*tblosc(1<<16, sin, freq, 0)); }; + +process = vgroup("chorus", (c, c)) +with { c(x) = x+level*chorus(dtime,freq,depth,x); };