QUICK-REF - CsoundManual - Top of this section - Previous - Contents - Index - Next 

linen, linenr, envlpx, envlpxr

     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] 
     kr   envlpxr   kamp, irise, idec, ifn, iatss, iatdec[,ixmod][, irind]
     ar   envlpxr   xamp, irise, idec, ifn, iatss, iatdec[, ixmod][, irind]

DESCRIPTION

linen - apply a straight line rise and decay pattern to an input amp signal.  envlpx applies an envelope consisting of 3 segments: 1) stored function rise shape, 2) modified exponential pseudo steady state, 3) exponential decay. linenr and envlpxr are as above, except that the final segment is entered only on sensing a note release, and the note is then extended by the decay time

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.

irind (optional) - independence flag. If left zero, the release time (idec) will influence the extended life of the current note following a note-off. If non-zero, the idec time is quite independent of the note extension (see below). The default value is 0.

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.

linenr, envlpxr are examples of the special Csound "r" units that contain a note-off sensor and release time extender. Unless made independent by irind, when each senses a score event termination or a MIDI noteoff, it will immediately extend the performance time of the current instrument by idec seconds, then begin a decay (as described above) from wherever it was at the time. These "r" units can also be modified by MIDI noteoff velocities (see veloffs). If the irind flag is on (non-zero), the overall performance time is unaffected by note-off and veloff data.

Mulitple "r" units. When two or more "r" units occur in the same instrument it is usual to have only one of them influence the overall note duration. This is normally the master amplitude unit. Other units controlling, say, filter motion can still be sensitive to note-off commands while not affecting the duration by making them independent (irind non-zero). Depending on their own idec (release time) values, independent "r" units may or may not reach their final destinations before the instrument terminates. If they do, they will simply hold their target values until termination. If two or more "r" units are simultaneously master, note extension is by the greatest idec. 


QUICK-REF - CsoundManual - Top of this section - Previous - Contents - Index - Next 
HTML Csound Manual - © Jean Piché & Peter J. Nix, 1994-97