accum()

accum(increment, reset)

Category

Envelope / Control

Description

Phase accumulator. It adds the increment every sample and keeps its own phase state, which makes it useful for custom oscillators, pitch curves, melody envelopes, and controlled detune paths.

Arguments

Typical Values

The increment is usually a phase step such as 2*pi()*fq/44100 or a pitch path derived from tone(), env_file(), or another modulation source. Factory presets often use accum() when the pitch itself needs to follow an envelope or sequence.

Example

sin(accum(2*pi()*440/44100, 0))

Notes

A common preset pattern is to drive accum() from an envelope-based pitch path, for example accum(tone()*env_file(2,"melody.env"),0). Use X when you want normal played pitch; use accum() when you need a custom pitch trajectory.