Merge pull request #506 from andrewcsmith/patch-2
[supercollider.git] / HelpSource / Classes / EnvGate.schelp
bloba489ea0ea9cc7c2268f28e81426257b9bea48c99
1 class:: EnvGate
2 summary:: singleton fade envelope
3 categories:: Libraries>JITLib>NodeProxy
4 related:: Classes/EnvGen
6 description::
7 Convenience class for an envelope generator combining fadeTime and gate arguments.
9 ClassMethods::
11 method::new
12 Returns an link::Classes/EnvGen::.
14 argument::i_level
15 initial level of envelope (if set to 1, it starts open)
17 argument::gate
18 a gate input. if nil, EnvGate creates a link::Classes/NamedControl:: named 'gate'
20 argument::fadeTime
21 an input for both attack and decay time. if nil, EnvGate creates a link::Classes/NamedControl:: named 'fadeTime' (default time: 0.02)
23 argument::doneAction
24 doneAction of the link::Classes/EnvGen::
26 argument::curve
27 envelope curve
29 Examples::
31 code::
32 a = { LPF.ar(Saw.ar(200), 600) * EnvGate.new }.play;
33 a.set(\fadeTime, 2);
34 a.release;
36 // the same as:
37 a.set(\gate, 0);
39 // several env gates can coexist in one synth def.
41 a = {
42         var sound1 = LPF.ar(Saw.ar(80), 600) * EnvGate.new;
43         var sound2 = RLPF.ar(Saw.ar(200) * 0.5, 6000 * EnvGate.new + 60, 0.1) * EnvGate.new;
44         sound1 + sound2
45 }.play;
47 a.set(\fadeTime, 5);
48 a.release;