linenr — The linen opcode extended with a final release segment.


linenr -- same as linen except that the final segment is entered only on sensing a MIDI note release. The note is then extended by the decay time.


ares linenr xamp, irise, idec, iatdec
kres linenr kamp, irise, idec, iatdec


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.

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 negative value is illegal.


kamp, xamp -- input amplitude signal.

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.

You can use other pre-made envelopes which start a release segment upon recieving a note off message, like linsegr and expsegr, or you can construct more complex envelopes using xtratim and release. Note that you don't need to use xtratim if you are using linenr, since the time is extended automatically.

These “r” units can also be modified by MIDI noteoff velocities (see veloffs).

See Also

linsegr, expsegr, envlpxr, mxadsr, madsr, envlpx, linen, xtratim