mc.adsr~ Reference

ADSR envelope generator (multichannel)

mc.adsr~

Description

Use the adsr~ object when you need a sample-accurate Attack-Decay-Sustain-Release signal envelope which can be controlled by signals. In some situations, a combination of the function and line~ objects may be a useful alternative.

Discussion

Any non-zero value in the trigger inlet will trigger an envelope with that amplitude. Like an adsr~ triggered by an input float, a zero value represents "note-off" and will begin the release stage. unlike the event-trigger model, a signal-triggered adsr~ must receive a zero before it will retrigger.

The adsr~ object uses the Max time format syntax; envelope times can be specified in either fixed or tempo-relative formats.

Arguments

attack [float]

Optional

A floating-point value specifies the initial values for the attack parameter.

decay [float]

Optional

A floating-point value specifies the initial values for the decay parameter.

sustain [float]

Optional

A floating-point value specifies the initial values for the sustain parameter.

release [float]

Optional

A floating-point value specifies the initial values for the release parameter.

Attributes

attack [10 atoms]

Sets the attack of the ADSR-envelope in milliseconds.

decay [10 atoms]

Sets the decay of the ADSR-envelope in milliseconds.

legato [int]

Given as input, the word legato, followed by a 0 or a non-zero number, disables or enables legato mode. If legato mode is enabled, the envelope will not drop to zero in the event of a retrigger while the envelope is active - instead, the envelope ramps to the new amplitude over the attack period.

maxsustain [float]

Given as input, the word maxsustain, followed by a float, sets the maximum amount of time that the envelope will remain in the sustain stage. A negative number sets no maximum; the envelope will remain forever in the sustain stage until a note-off is received. To create a simple three-stage sustainless envelope (an ADR), you can use the message maxsustain 0.0.

release [10 atoms]

Sets the release of the ADSR-envelope in milliseconds.

retrigger [float]

Given as input, the word retrigger, followed by a float, sets the amount of time taken to ramp down to zero in the event of a retrigger while the envelope is active (the default is 5 milliseconds). This ramping prevents clicking.

sustain [float]

Sets the sustain of the ADSR-envelope, as a factor of the amplitude. For example, a value of 0.5 means the sustain level will be half of the amplitude height.

Common Box Attributes

Multichannel Group Attributes

Messages

int

Arguments

trigger/ADSR-parameters [int]
In left inlet: Like an adsr~ object triggered by a signal input, a floating-point value triggers an envelope with the given amplitude. The envelope will sustain until a zero is input to trigger the release stage, or until another non-zero float retriggers the envelope.

In second inlet: sets the envelope's attack time, in milliseconds.

In third inlet: sets the envelope's decay time, in milliseconds.

In fourth inlet: sets the envelope's sustain level, as a factor of the amplitude. For example, a value of 2 means the sustain level will be twice the value of the amplitude height.

In fifth inlet: sets the envelope's release time, in milliseconds.

float

Arguments

trigger/ADSR-parameters [float]
In left inlet: Like an adsr~ object triggered by a signal input, an int value triggers an envelope with the given amplitude. The envelope will sustain until a zero is input to trigger the release stage, or until another non-zero int retriggers the envelope.

In second inlet: sets the envelope's attack time, in milliseconds.

In third inlet: sets the envelope's decay time, in milliseconds.

In fourth inlet: sets the envelope's sustain level, as a factor of the amplitude. For example, a value of 2 means the sustain level will be twice the value of the amplitude height.

In fifth inlet: sets the envelope's release time, in milliseconds.

list

Arguments

attack [float]
decay [float]
sustain [float]
release [float]
In left inlet: A list of 4 floating-point numbers will assign the values for the attack, decay, sustain and release portions of the ADSR-envelope consecutively.

anything

Arguments

attack [float]
decay [float]
sustain [float]
release [float]
In left inlet: Performs the same function as list.

Any other inlet: A list may be used to specify time in one of the Max time formats.

signal

In left inlet: Any non-zero value will trigger an envelope with that value as its amplitude. Like an adsr~ triggered by an input float, a zero value represents "note-off" and will begin the release stage. Unlike the event-triggered model, a signal-triggered adsr~ must receive a zero before it will retrigger.

In second inlet: sets the envelope's attack time, in milliseconds.

In third inlet: sets the envelope's decay time, in milliseconds.

In fourth inlet: sets the envelope's sustain level, as a factor of the amplitude. For example, a value of 0.5 means the sustain level will be half of the amplitude height.

In fifth inlet: sets the envelope's release time, in milliseconds.

Multichannel Group Messages

Output

message

The right outlet sends mute messages suitable for managing internal poly~ instance muting with the thispoly~ object.

message

The fourth outlet responds to query messages for the various attributes (i.e. getattack).

signal

Left outlet: the envelope.

Middle outlet: signals the beginning of an envelope by sending 1 when in the attack, decay, or sustain stages and 0 otherwise (release, retrigger, or inactive). You can use this outlet in conjunction with the sah~ object to synchronize pitch (or other information) with the beginning of an envelope with sample accuracy.

See Also

Name Description
function
line~
techno~
transport
zigzag~