Contents

PHASEEnvelope

A collection of segments that connect to graph a complex curve over a linear input.

Declaration

class PHASEEnvelope

Overview

In traditional audio uses, an envelope defines a complex graph that determines the volume of audio data over an input duration. PHASE uses envelopes in a similar way. Given a value on the envelope’s input axis, the evaluate(x:) function plots and returns the result on the output axis. The following are possible uses of this class:

At runtime, PHASE determines whether a particular member of the segments array slopes up or down along the domain depending on the envelope’s particular use case.

Create an Envelope and Shape its Curve

To use an envelope in your app, define its shape by defining a series of segments. Each segment specifies a curve that collectively connect to form a graph. The following code creates an envelope with a single segment that’s shaped like the lettter s:

The graph flexes at runtime depending on the source content on which the envelope operates. A PHASEEnvelope doesn’t constrain the evaluate(x:) function’s output to predertermined values. Instead, PHASE applies the envelope’s curves to the source content as a rate of change.

Topics

Creating an Envelope

Inspecting the Envelope

Bounding the Input

See Also

Dynamic Sound Control