trapezoid~

Trapezoidal control signals

The trapezoid~ object outputs a trapezoidal shape, rising linearly from 0 to 1 in a certain fraction of its time, then staying at 1, then falling linearly back to 0 in a fraction of its time. Its timing is driven by a control signal at its input, one that goes in a straight line from 0 to 1; so a phasor~ or a line~ is the obvious choice for input to trapezoid~. As the input goes from 0 to 1, the output draws the designated trapezoidal shape.

Trapezoidal envelope

The trapezoid~ object allows you to make a control signal that rises to a certain level, stays there, then falls back to its initial level. That shape can be ueseful as an amplitude envelope or a filter envelope, for example. At its input trapezoid~ needs to be driven by a signal, usually a control signal that progresses from 0 to 1 in a straight line, such as phasor~ or line~.

Repeatedly reading a function with phasor~

The real value of phasor~ is that it provides a very accurate way to read through (or mathematically calculate) some nonlinear shape to use as a control signal (or even as an audio signal). Among other things, it might be used to create a "window" shape that can serve as an amplitude envelope for a sound. This patch demonstrates five different ways to create window or waveform shapes with phasor~. We'll discuss them (in good Max fashion) from right to left.

Windowing an audio signal

In signal processing, a "window" is a function (shape) that is nonzero for some period of time, and zero before and after that period. When multiplied by another signal, it produces an output of 0 except during the nonzero portion of the window, when it exposes the other signal. The simplest example is a rectangular window, which is 0, then briefly is 1, then reverts to 0. The windowed signal will be audible only when it is being multiplied by 1––i.e., during the time when the rectangular windowing occurs.