cfe43c63a46e86ac8fb0ac17ecd2055a1edf7044
[Faustine.git] / interpretor / faust-0.9.47mr3 / tools / faust2pd / examples / seqdemo / organ.dsp
1
2 declare name "organ -- a simple additive synth";
3 declare author "Albert Graef";
4 declare version "1.0";
5
6 import("music.lib");
7
8 // control variables
9
10 vol = hslider("vol", 0.3, 0, 10, 0.01); // %
11 pan = hslider("pan", 0.5, 0, 1, 0.01); // %
12 attack = hslider("attack", 0.01, 0, 1, 0.001); // sec
13 decay = hslider("decay", 0.3, 0, 1, 0.001); // sec
14 sustain = hslider("sustain", 0.5, 0, 1, 0.01); // %
15 release = hslider("release", 0.2, 0, 1, 0.001); // sec
16 freq = nentry("freq", 440, 20, 20000, 1); // Hz
17 gain = nentry("gain", 0.3, 0, 10, 0.01); // %
18 gate = button("gate"); // 0/1
19
20 // additive synth: 3 sine oscillators with adsr envelop
21
22 process = (osc(freq)+0.5*osc(2*freq)+0.25*osc(3*freq))
23 * (gate : vgroup("1-adsr", adsr(attack, decay, sustain, release)))
24 * gain : vgroup("2-master", *(vol) : panner(pan));