<- C I ->

linen, linenr, envlpx

     kr   linen     kamp, irise, idur, idec
     ar   linen     xamp, irise, idur, idec
     kr   linenr    kamp, irise, idec, iatdec
     ar   linenr    xamp, irise, idec, iatdec
     kr   envlpx    kamp, irise, idur, idec, ifn, iatss, iatdec[,ixmod]
     ar   envlpx    xamp, irise, idur, idec, ifn, iatss, iatdec[,ixmod] 
linen - apply a straight line rise and decay pattern to an input amp signal.

linenr - apply a straight line rise, then an exponential decay while the note is extended in time.

envlpx - apply an envelope consisting of 3 segments: 1) stored function rise shape, 2) modified exponential "pseudo steady state", 3) exponential decay

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.

ifn - function table number of stored rise shape with extended guard point.

iatss - attenuation factor, by which the last value of the envlpx rise is modified during the note's pseudo "steady state." A factor > l causes an exponential growth, and < l an exponential decay. A 1 will maintain a true steady state at the last rise value. Note that this attenuation is not by fixed rate (as in a piano), but is sensitive to a note's duration. However, if iatss is negative (or if "steady state" < 4 k-periods) a fixed attenuation rate of abs(iatss) per second will be used. 0 is illegal.

iatdec - attenuation factor by which the closing "steady state" value is reduced exponentially over the decay period. This value must be positive and is normally of the order of .01. A large or excessively small value is apt to produce a cutoff which is audible. A zero or neg value is illegal.

ixmod (optional, between +- .9 or so) - exponential curve modifier, influencing the "steepness" of the exponential trajectory during the "steady state." Values less than zero will cause an accelerated growth or decay towards the target (e.g. subito piano). Values greater than zero will cause a retarded growth or decay. The default value is zero (unmodified exponential).

PERFORMANCE

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 (linen) or modified by the first exponential pattern (envlpx). If linen rise and decay periods overlap then both modifications will be in effect for that time; in envlpx that will cause a truncated decay. If the overall duration idur is exceeded in performance, the final decay will continue on in the same direction, going negative for linen but tending asymptotically to zero in envlpx.

linenr is unique within Csound in containing a note-off sensor and release time extender. When it senses either a score event termination or a MIDI noteoff, it will immediately extend the performance time of the current instrument by idec seconds, then execute an exponential decay towards the factor iatdec. For two or more units in an instrument, extension is by the greatest idec.

<- C I ->
Prepared from the MIT Media Lab Csound Manual, PJN, Nov 1994.