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.
| Param | Type | Default | Description |
|---|---|---|---|
| - | - | - | 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(%, %) lfo
LFO - Low Frequency Oscillator with optional duty cycle.
| Param | Type | Default | Description |
|---|---|---|---|
| rate | signal | - | Rate in Hz |
| duty | number | 0.5 | Duty 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(%, %) trigger
Trigger - Generates trigger pulses at division of the beat.
| Param | Type | Default | Description |
|---|---|---|---|
| div | number | - | 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(%, %) euclid
Euclidean Rhythm - Generates Euclidean rhythm patterns.
| Param | Type | Default | Description |
|---|---|---|---|
| hits | number | - | Number of hits in pattern |
| steps | number | - | Total steps in pattern |
| rot | number | 0 | Rotation 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(%, %) timeline
Timeline - Breakpoint automation envelope.
| Param | Type | Default | Description |
|---|---|---|---|
| - | - | - | 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(%, %)