mxadsr
Prev | Orchestra Opcodes and Operators | Next

## mxadsr

mxadsr — Calculates the classical ADSR envelope using the expsegr mechanism.

## Description

Calculates the classical ADSR envelope using the expsegr mechanism.

## Syntax

    ares mxadsr iatt, idec, islev, irel [, idel] [, ireltim]

    kres mxadsr iatt, idec, islev, irel [, idel] [, ireltim]

## Initialization

iatt -- duration of attack phase

idec -- duration of decay

islev -- level for sustain phase

irel -- duration of release phase

idel (optional, default=0) -- period of zero before the envelope starts

ireltim (optional, default=-1) -- Control release time after receiving a MIDI noteoff event. If less than zero, the longest release time given in the current instrument is used. If zero or more, the given value will be used for release time. Its default value is -1. (New in Csound 3.59 - not yet properly tested)

## Performance

The envelope is in the range 0 to 1 and may need to be scaled further. The envelope may be described as:

Picture of an ADSR envelope.

The length of the sustain is calculated from the length of the note. This means adsr is not suitable for use with MIDI events. The opcode madsr uses the linsegr mechanism, and so can be used in MIDI applications. The opcode mxadsr is identical to madsr except it uses exponential, rather than linear, line segments.

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 mxadsr, since the time is extended automatically.

mxadsr is new in Csound version 3.51.

## See Also

linsegr, expsegr, envlpxr, mxadsr, madsr, adsr, expon, expseg, expsega line, linseg, xtratim

## Credits

Author: John ffitch

November 2002. Thanks to Rasmus Ekman, added documentation for the ireltim parameter.

November 2003. Thanks to Kanata Motohashi, fixed the link to the linsegr opcode.

Prev | Up | Next
mute | Home | nchnls