builtins

Sequencing & Timing

Timing and sequencing functions create rhythmic patterns, triggers, and automation curves synchronized to the global clock.

Timing and sequencing functions create rhythmic patterns, triggers, and automation curves synchronized to the global clock.

clock

Clock - Returns the current clock position.

ParamTypeDefaultDescription
---No parameters

Returns the current position in the clock cycle. Use with other timing functions or for sync.

// Use clock for tempo-synced effects
osc("saw", 110) |> delay(%, clock() / 4, 0.4) |> out(%, %)

Related: trigger, lfo


lfo

LFO - Low Frequency Oscillator with optional duty cycle.

ParamTypeDefaultDescription
ratesignal-Rate in Hz
dutynumber0.5Duty cycle for pulse (0-1)

A low-frequency oscillator for modulation. The duty parameter controls the pulse width.

// Vibrato
osc("sin", 220 + lfo(5) * 10) |> out(%, %)
// Tremolo
osc("saw", 220) * (0.5 + lfo(4) * 0.5) |> out(%, %)
// Filter sweep
osc("saw", 110) |> lp(%, 500 + lfo(0.2) * 1500) |> out(%, %)

Related: clock, trigger


trigger

Trigger - Generates trigger pulses at division of the beat.

ParamTypeDefaultDescription
divnumber-Triggers per beat

Generates short impulses at regular intervals. A div of 4 means 4 triggers per beat (16th notes at 4/4).

// Kick drum on quarter notes
osc("sin", 55) * ar(trigger(1), 0.01, 0.2) |> out(%, %)
// Hi-hat on 8th notes
osc("noise") |> hp(%, 8000) * ar(trigger(2), 0.001, 0.05) |> out(%, %)
// Fast arpeggio triggers
pat("c4 e4 g4 c5") |> ((f) -> osc("saw", f) * ar(trigger(8))) |> out(%, %)

Related: euclid, lfo


euclid

Euclidean Rhythm - Generates Euclidean rhythm patterns.

ParamTypeDefaultDescription
hitsnumber-Number of hits in pattern
stepsnumber-Total steps in pattern
rotnumber0Rotation offset

Creates rhythms by distributing hits as evenly as possible across steps. Classic patterns: (3,8) = Cuban tresillo, (5,8) = West African bell.

// Tresillo pattern
osc("sin", 55) * ar(euclid(3, 8), 0.01, 0.15) |> out(%, %)
// West African bell
osc("noise") |> hp(%, 6000) * ar(euclid(5, 8), 0.001, 0.03) |> out(%, %)
// Rotated pattern
osc("saw", 110) * ar(euclid(5, 16, 2)) |> lp(%, 800) |> out(%, %)

Related: trigger, timeline


timeline

Timeline - Breakpoint automation envelope.

ParamTypeDefaultDescription
---Configured via pattern syntax

Creates smooth automation curves between breakpoints. Used for complex parameter automation synced to the clock.

// Volume automation
osc("saw", 220) * timeline() |> out(%, %)

Related: lfo, trigger