linen

linen — Applies a straight line rise and decay pattern to an input amp signal.

Description

linen -- apply a straight line rise and decay pattern to an input amp signal.

Syntax

ares linen xamp, irise, idur, idec
kres linen kamp, irise, idur, idec

Initialization

irise -- rise time in seconds. A zero or negative value signifies no rise modification.

idur -- overall duration in seconds. A zero or negative value will cause initialization to be skipped.

idec -- decay time in seconds. Zero means no decay. An idec > idur will cause a truncated decay.

Performance

kamp, xamp -- input amplitude signal.

Rise modifications are applied for the first irise seconds, and decay from time idur - idec. If these periods are separated in time there will be a steady state during which amp will be unmodified. If linen rise and decay periods overlap then both modifications will be in effect for that time. If the overall duration idur is exceeded in performance, the final decay will continue on in the same direction, going negative.

[Envelope generated by the linen opcode]

Envelope generated by the linen opcode

[Note] Note

A common error with this opcode is to assume that the value of 0 is the held after the envelope has finished at idur. linen does not automatically end or stop at the end of the duration given. If your note length is longer than idur seconds, kres (or ares) will not come to rest at 0, but will instead continue to fall with the same rate. If a decay and then hold is required then the linseg opcode should be considered instead.

See Also

envlpx, envlpxr, linenr