A linear ASR-type envelope generator UGen.
===Examples===
// repeated trigger
play {
val gen = Linen.kr(Impulse.kr(2), 0.01, 0.6, 1.0)
SinOsc.ar(440) * gen * 0.1
}
// play once and end the synth
play {
val gen = Linen.kr(Impulse.kr(0), 0.01, 0.6, 1.0, doneAction = freeSelf)
SinOsc.ar(440) * gen * 0.1
}
// play once and sustain
val x = play {
val gen = Linen.kr("gate".kr(1), 0.01, 0.6, 1.0, doneAction = freeSelf)
SinOsc.ar(440) * gen * 0.1
}
x.release(4) // release envelope with given duration
// longer gate to sustain for a given duration
play {
val gate = Trig.kr(1, dur = 2)
val gen = Linen.kr(gate, 0.01, 0.6, 1.0, doneAction = freeSelf)
SinOsc.ar(440) * gen * 0.1
}
- See also
- Companion
- class
Type members
Value members
Concrete methods
- Value Params
- attack
duration (seconds) of the attack segment
- doneAction
action to be performed when the envelope reaches its end point.
- gate
triggers the envelope and holds it open while greater than zero. A value of less than zero enforces a release with duration
-1.0 - gate
.- release
duration (seconds) of the release segment
- sustain
level of the sustain segment