2 summary:: Simple linear envelope generator.
3 categories:: UGens>Envelopes
4 related:: Classes/EnvGen
8 Simple linear envelope generator.
17 This triggers the envelope and holds it open while > 0.
19 If strong::gate:: < 0, force release with time code:: -1.0 - gate ::, see link::Classes/EnvGen#forced_release::.
23 The duration of the attack portion.
28 The level of the sustain portion.
33 The duration of the release portion.
38 An integer representing an action to be executed when the
39 envelope is finished. See
40 link::Reference/UGen-doneActions:: for
50 SynthDef("help-Linen",{ arg out = 0;
52 Linen.kr(Impulse.kr(2), 0.01, 0.6, 1.0, doneAction: 0) * SinOsc.ar(440, 0, 0.1)
57 // play once and end the synth
59 SynthDef("help-Linen",{ arg out=0;
61 Linen.kr(Impulse.kr(0), 0.01, 0.6, 1.0, doneAction: 2) * SinOsc.ar(440, 0, 0.1)
66 // play once and sustain
68 x = SynthDef("help-Linen",{ arg gate = 1, out = 0; // use gate arg for release
70 Linen.kr(gate, 0.01, 0.6, 1.0, doneAction: 2) * SinOsc.ar(440, 0, 0.1)
74 x.release(4); // change the release time
76 // longer gate, can pass in duration
78 SynthDef("help-Linen",{ arg out = 0, dur = 0.1;
80 gate = Trig.kr(1.0, dur);
82 Linen.kr(gate, 0.01, 0.6, 1.0, doneAction: 2) * SinOsc.ar(440, 0, 0.1)
84 }).play(nil, [\out, 0, \dur, 2.0]);
89 // used below in a Routine varying the releaseTime
91 SynthDef("help-Linen",{ arg out=0,freq=440,attackTime=0.01,susLevel=0.6,releaseTime=0.1;
93 Linen.kr(Impulse.kr(0), attackTime, susLevel, releaseTime, doneAction: 2)
94 * SinOsc.ar(freq, 0, 0.1)
100 // debussey sleeping through math class
101 x = Pbrown(0.01, 2.0, 0.2, inf).asStream;
104 Synth.grain("help-Linen",[\freq, (rrand(20, 50) * 2).midicps, \releaseTime, x.next]);
107 }).play(TempoClock.default)
115 SynthDef("help-Linen",{ arg out = 0;
118 Linen.kr(Impulse.kr(2),
120 // sustain level is polled at time of trigger
121 FSinOsc.kr(0.1).range(0, 1),
125 * SinOsc.ar(440, 0, 0.1)