An InterplEnv is a specification for a segmented envelope. InterplEnvs can be used both server-side, by an IEnvGen within a SynthDef, and clientside, with methods such as at. An InterplEnv can have any number of segments. An InterplEnv can have several shapes for its segments.
InterplEnvs do not have release or loop nodes. They are of a fixed duration. Mostly, it is meant to be used with IEnvGen, where 'times' are actually an index into the envelope shape.
Create a new envelope specification.
| levels |
an array of levels. The first level is the initial value of the envelope. | |||||||||||||||||||||||||||
| times |
an array of durations of segments in seconds. There should be one fewer duration than there are levels. | |||||||||||||||||||||||||||
| curve |
a Symbol, Float, or an Array of those. Determines the shape of the envelope segments. The possible values are:
| |||||||||||||||||||||||||||
| offset |
used to offset an envelope into negative starttimes. |
Creates a new envelope specification with numSegments and numChannels for filling in later.
This can be useful when passing Env parameters as args to a Synth. Note that the maximum number of segments is fixed and cannot be changed once embedded in a SynthDef. Trying to set an Env with more segments than then this may result in other args being unexpectedly set.
(
SynthDef(\help_Env_newClear, { |out = 0, gate = 1|
var env, envctl;
// make an empty 4 segment envelope
env = Env.newClear(4);
// create a control argument array
envctl = \env.kr(env.asArray);
Out.ar(out, SinOsc.ar(EnvGen.kr(envctl, gate), 0) * -12.dbamp);
}).add;
)
Synth(\help_Env_newClear, [\env, Env([700,900,900,800], [1,1,1], \exp)]); // 3 segments
// reset then play again:
Synth(\help_Env_newClear, [ \env, Env({ rrand(60, 70).midicps } ! 4, [1,1,1], \exp)]);
// the same written as an event:
(instrument: \help_Env_newClear, env: Env({ rrand(60, 70).midicps } ! 4, [1,1,1], \exp)).play;
Plot this envelope's shape in a window.
| size |
The size of the plot. |
| bounds |
The window bounds (a Rect). |
| minval | |
| maxval | |
| parent |
Converts the InterplEnv to an Array in a specially ordered format. This allows for InterplEnv parameters to be settable arguments in a SynthDef.
Returns the value of the InterplEnv at time.
InterplEnv([0, 1, 0.707], [0.2, 1.3], [\lin, \sin]).at(0.5);