A newer version of Max is available. Click here to access the latest version of the Max documentation

triangle Reference

A triangle/ramp wavetable oscillator with a phase input.

triangle

Examples

Arguments

duty [number]

Optional

The duty cycle (or peak value phase offset) value from 0 to 1.0. The default is 0.5. A value of 0 produces a ramp (down) waveform when the triangle operator is driven by a phasor~ or event rate linear ramp, and a value of 1.0 produces a sawtooth waveform.

Inlets

phase [number]

Any signal, float, or an input signal progressing from 0 to 1 is used to scan the triangle operator's wavetable, treating the contents of the wavetable as a repeating waveform.

duty [number]

The duty cycle (or peak value phase offset) value from 0 to 1.0. The default is 0.5. A value of 0 produces a ramp (down) waveform when the triangle operator is driven by a phasor~ or event rate linear ramp, and a value of 1.0 produces a sawtooth waveform.

Outlets

out [number]

A float value which corresponds to the value referenced by the triangle operator's input.

Fixed Attributes

These attributes must be set in the object box and determine the behavior of the object at runtime.

hot [bool] (default: false)

Trigger computation on all inlets.

Dynamic Attributes

These attributes can be modified in the code during execution using the set object

duty [number]

The duty cycle (or peak value phase offset) value from 0 to 1.0. The default is 0.5. A value of 0 produces a ramp (down) waveform when the triangle operator is driven by a phasor~ or event rate linear ramp, and a value of 1.0 produces a sawtooth waveform.

phase [number]

Any signal, float, or an input signal progressing from 0 to 1 is used to scan the triangle operator's wavetable, treating the contents of the wavetable as a repeating waveform.

reset [bang] (default: 0)

Banging this attribute will reset the object to its default state.

See Also

Name Description
triangle~ Triangle/ramp wavetable
tri~ Anti-aliased triangular oscillator.