1 declare name "karplus32";
3 declare author "Grame";
5 declare copyright "(c)GRAME 2006";
7 //-----------------------------------------------
9 // with 32 resonators in parallel
10 //-----------------------------------------------
18 upfront(x) = (x-x') > 0.0;
19 decay(n,x) = x - (x>0)/n;
20 release(n) = + ~ decay(n);
21 trigger(n) = upfront : release(n) : >(0.0) : +(leak);
24 size = hslider("excitation (samples)", 128, 2, 512, 1);
32 dur = hslider("duration (samples)", 128, 2, 512, 1);
33 att = hslider("attenuation", 0.1, 0, 1, 0.01);
34 average(x) = (x+x')/2;
36 resonator(d, a) = (+ : delay(4096, d-1.5)) ~ (average : *(1.0-a)) ;
42 detune = hslider("detune", 32, 0, 512, 1);
43 polyphony = hslider("polyphony", 1, 0, 32, 1);
47 output = hslider("output volume", 0.5, 0, 1, 0.1);
50 process = vgroup("karplus32",
51 vgroup("noise generator", noise * hslider("level", 0.5, 0, 1, 0.1))
52 : vgroup("excitator", *(button("play"): trigger(size)))
53 <: vgroup("resonator x32", par(i,32, resonator(dur+i*detune, att) * (polyphony > i)))
54 :> *(output),*(output)