pow2int()

pow2int(value, max_power)

Category

Math

Description

Quantizes a normalized value to exact powers of two. The output is always 1, 2, 4, 8, and so on up to 2^max_power.

Arguments

Typical Values

pow2int(param(0), 5) returns one of 1, 2, 4, 8, 16, 32. This is useful for octave or ratio switching, rhythmic divisions, and quantized modulation choices.

Example

saw(X*pow2int(param(0), 5))

Notes

pow2int() is stepped by design, not continuously interpolated. If you modulate it at audio rate, it will intentionally switch between power-of-two values and may create clicks or digital-style edges.