float2tune()

float2tune(value, retrigger_samples)

Category

Math / Pitch quantization

Description

Converts a control value to an equal-tempered pitch multiplier, quantized to whole semitones. The function reads a new value only at the interval set by retrigger_samples and holds the previous multiplier between updates. Internally it uses the semitone index int(value*12) and returns 2^(semitone/12).

Arguments

Example

0.55*release(30000)*saw(X*float2tune(2*rnd()-1,11025))

Notes

Use float2tune() to turn a changing or random control signal into stable musical note ratios without recalculating pitch every sample. Each occurrence in a formula has independent held state; up to 16 occurrences are supported per voice. Abrupt semitone changes can still click when used directly at audio rate, so use a musical update interval or place the result in a suitably enveloped sound.

Available since Syntropy version 2.4.