SuperCollider CLASSES

# InterplEnv

envelope specification
Source: /Applications/SuperCollider/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Audio/InterplEnv.sc
Inherits from: AbstractEnv : Object

## Description

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.

### Differences between InterplEnv and Env

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.

## Class Methods

### *new (levels = [ 0, 1, 0 ], times = [ 1, 1 ], curve = 'lin', offset = 0)

Create a new envelope specification.

#### Arguments:

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:
 \step flat segments \linear \lin linear segments, the default \exponential \exp natural exponential growth and decay. In this case, the levels must all be nonzero and the have the same sign. \sine \sin sinusoidal S shaped segments. \welch \wel sinusoidal segments shaped like the sides of a Welch window. \squared \sqr squared segment \cubed \cub cubed segment a Float a curvature value for all segments. 0 means linear, positive and negative numbers curve the segment up and down. an Array of symbols or floats curvature values for each segment.

offset

used to offset an envelope into negative starttimes.

### *newClear (numSegments = 8)

From superclass: AbstractEnv

Creates a new envelope specification with numSegments for filling in later.

#### Discussion:

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. See newClear example below.

## Instance Methods

### -plot (size = 400, bounds, minval, maxval, parent)

Plot this envelope's shape in a window.

#### Arguments:

 size The size of the plot.

### -asArray

From superclass: AbstractEnv

Converts the InterplEnv to an Array in a specially ordered format. This allows for InterplEnv parameters to be settable arguments in a SynthDef.

### -at (time)

Returns the value of the InterplEnv at time.

InterplEnv([0, 1, 0.707], [0.2, 1.3], [\lin, \sin]).at(0.5);