Rename interpretor to interpreter.
[Faustine.git] / interpreter / preprocessor / faust-0.9.47mr3 / tools / faust2pd / examples / synth / chorus.dsp
1
2 /* Stereo chorus. */
3
4 declare name "chorus -- stereo chorus effect";
5 declare author "Albert Graef";
6 declare version "1.0";
7
8 import("music.lib");
9
10 level = hslider("level", 0.5, 0, 1, 0.01);
11 freq = hslider("freq", 3, 0, 10, 0.01);
12 dtime = hslider("delay", 0.025, 0, 0.2, 0.001);
13 depth = hslider("depth", 0.02, 0, 1, 0.001);
14
15 tblosc(n,f,freq,mod) = (1-d)*rdtable(n,waveform,i&(n-1)) +
16 d*rdtable(n,waveform,(i+1)&(n-1))
17 with {
18 waveform = time*(2.0*PI)/n : f;
19 phase = freq/SR : (+ : decimal) ~ _;
20 modphase = decimal(phase+mod/(2*PI))*n;
21 i = int(floor(modphase));
22 d = decimal(modphase);
23 };
24
25 chorus(dtime,freq,depth,phase,x)
26 = x+level*fdelay(1<<16, t, x)
27 with {
28 t = SR*dtime/2*(1+depth*tblosc(1<<16, sin, freq, phase));
29 };
30
31 process = vgroup("chorus", (left, right))
32 with {
33 left = chorus(dtime,freq,depth,0);
34 right = chorus(dtime,freq,depth,PI/2);
35 };