2 // desc: typing-based instrument, quantized, multi-channel
3 // author: Ge Wang + Perry Cook
5 // computer keyboard input via terminal
12 Impulse i => BiQuad f => Envelope e => JCRev r => dac;
14 // set the filter's pole radius
16 // set equal gain zeros
18 // envelope rise/fall time
24 [ 1.0, 0.2, 0.3, 0.2, 0.4, 0.1, 0.2, 0.1,
25 0.5, 0.1, 0.3, 0.2, 0.4, 0.1, 0.2, 0.1,
26 0.8, 0.1, 0.3, 0.2, 0.5, 0.1, 0.2, 0.1,
27 0.4, 0.1, 0.3, 0.2, 0.3, 0.1, 0.2, 0.1 ] @=> float mygains[];
30 mygains.cap() => int N;
43 // loop through 1 or more keys
47 kb.getchar() => int c;
52 <<< "skipping...", "" >>>;
58 (now % period / period * N) $ int => int index;
60 mygains[index] => i.next;
62 c => Std.mtof => f.pfreq;
64 <<< "ascii:", c, "velocity:", mygains[index] >>>;