builtins

Dynamics

Dynamics processors control the volume envelope of signals, reducing dynamic range or removing unwanted quiet sections.

Dynamics processors control the volume envelope of signals, reducing dynamic range or removing unwanted quiet sections.

comp

Compressor - Reduces dynamic range above threshold.

ParamTypeDefaultDescription
insignal-Input signal
threshnumber-12.0Threshold in dB
rationumber4.0Compression ratio

Aliases: compress, compressor

Reduces the level of signals that exceed the threshold. Higher ratios create more aggressive compression. A ratio of 4:1 means 4dB of input above threshold becomes 1dB of output.

// Basic compression
osc("saw", 110) * ar(trigger(2)) |> comp(%, -12, 4) |> out(%, %)
// Heavy compression (limiting-like)
osc("saw", 55) * ar(trigger(4)) |> comp(%, -20, 10) |> out(%, %)
// Gentle leveling
osc("noise") * ar(trigger(1)) |> comp(%, -6, 2) |> out(%, %)

Related: limiter, gate


limiter

Limiter - Brickwall limiter preventing signal from exceeding ceiling.

ParamTypeDefaultDescription
insignal-Input signal
ceilingnumber-0.1Maximum output level in dB
releasenumber0.1Release time in seconds

Aliases: limit

A limiter is an extreme compressor (infinite ratio) that prevents the signal from ever exceeding the ceiling. Essential for preventing digital clipping.

// Master limiter
osc("saw", 110) * 2 |> limiter(%, -0.1, 0.1) |> out(%, %)
// Aggressive limiting for loudness
osc("saw", 55) * ar(trigger(4)) * 3 |> limiter(%, -1, 0.05) |> out(%, %)

Related: comp


gate

Noise Gate - Silences signal below threshold.

ParamTypeDefaultDescription
insignal-Input signal
threshnumber-40.0Threshold in dB
hystnumber6.0Hysteresis in dB (open/close difference)
close_timenumber5.0Fade-out time (ms)

Aliases: noisegate

Cuts the signal when it falls below the threshold, useful for removing noise during quiet passages. Hysteresis prevents chattering at the threshold by requiring the signal to drop further below the threshold before the gate closes.

The close_time parameter controls how quickly the gate fades out when closing, preventing abrupt cuts.

// Basic noise gate
(osc("saw", 110) + osc("noise") * 0.1) * ar(trigger(2)) |> gate(%, -30, 6) |> out(%, %)
// Tight gate for percussive sounds
osc("noise") * ar(trigger(8), 0.001, 0.05) |> gate(%, -20, 10) |> out(%, %)
// Slow fade-out gate
osc("saw", 110) * ar(trigger(2)) |> gate(%, -30, 6, 20) |> out(%, %)

Related: comp