one()

one(startSample, endSample)

Category

Envelope / Control

Description

Time window function. It returns 1 inside a selected sample range and 0 outside it, useful for triggering short sections of a formula.

Arguments

Typical Values

Use moderate values first, then increase modulation depth while listening for clipping, aliasing, or excessive filter resonance.

Example

one(0, 4410)*white()

Notes

For pitched oscillator functions, X already contains the current MIDI note pitch and transpose information. Prefer saw(X), sin(X), or pwm(X, 0.4) unless you intentionally want an octave or ratio shift such as 0.5*X or 2*X.