builtins

Modulation Effects

Modulation effects use time-varying delays to create movement and spatial interest in sounds.

Modulation effects use time-varying delays to create movement and spatial interest in sounds.

Note: All modulation effects output 100% wet signal. For dry/wet mixing, blend manually:

// 30% dry, 70% wet chorus
dry = osc("saw", 220)
dry * 0.3 + chorus(dry, 0.5, 0.5) * 0.7 |> out(%, %)

chorus

Chorus - Creates copies with slight pitch/time variations.

ParamTypeDefaultDescription
insignal-Input signal
ratenumber0.5LFO rate in Hz
depthnumber0.5Modulation depth (0-1)
base_delaynumber20.0Base chorus delay (ms)
depth_rangenumber10.0Modulation depth range (ms)

Creates a thicker, wider sound by mixing the input with delayed copies that are slightly pitch-shifted by an LFO.

The base_delay parameter sets the center delay time, while depth_range controls how far the modulation sweeps from the base. Larger values create more dramatic detuning effects.

// Classic chorus
osc("saw", 220) |> chorus(%, 0.5, 0.5) |> out(%, %)
// Slow deep chorus
osc("tri", 110) |> chorus(%, 0.2, 0.8) |> out(%, %)
// Fast shimmer
osc("sin", 440) |> chorus(%, 2, 0.3) |> out(%, %)
// Wide chorus with longer delay
osc("saw", 220) |> chorus(%, 0.3, 0.6, 30, 15) |> out(%, %)

Related: flanger, phaser


flanger

Flanger - Comb filtering with swept delay time.

ParamTypeDefaultDescription
insignal-Input signal
ratenumber1.0LFO rate in Hz
depthnumber0.7Modulation depth (0-1)
min_delaynumber0.1Minimum sweep delay (ms)
max_delaynumber10.0Maximum sweep delay (ms)

Similar to chorus but with shorter delay times and feedback, creating the characteristic “jet plane” sweep effect.

The min_delay and max_delay parameters define the sweep range. Shorter delays create more metallic tones, longer delays sound more like chorus.

// Classic flanger
osc("saw", 110) |> flanger(%, 0.5, 0.7) |> out(%, %)
// Slow metallic sweep
osc("sqr", 220) |> flanger(%, 0.1, 0.9) |> out(%, %)
// Fast subtle movement
osc("tri", 440) |> flanger(%, 3, 0.3) |> out(%, %)
// Tight metallic flanger
osc("saw", 110) |> flanger(%, 0.5, 0.8, 0.05, 2.0) |> out(%, %)

Related: chorus, phaser, comb


phaser

Phaser - Creates notches in frequency spectrum via allpass filters.

ParamTypeDefaultDescription
insignal-Input signal
ratenumber0.5LFO rate in Hz
depthnumber0.8Modulation depth (0-1)
min_freqnumber200.0Sweep range low (Hz)
max_freqnumber4000.0Sweep range high (Hz)

Sweeps a series of notch filters through the spectrum, creating a distinctive swirling effect different from chorus or flanger.

The min_freq and max_freq parameters define the frequency range of the sweep. Wider ranges create more dramatic effects.

// Classic phaser
osc("saw", 110) |> phaser(%, 0.3, 0.8) |> out(%, %)
// Fast space phaser
osc("sqr", 220) |> phaser(%, 2, 0.5) |> out(%, %)
// Slow deep sweep
osc("noise") |> lp(%, 2000) |> phaser(%, 0.1, 0.9) |> out(%, %)
// Extended high-frequency sweep
osc("saw", 110) |> phaser(%, 0.2, 0.8, 100, 8000) |> out(%, %)

Related: flanger, chorus


comb

Comb Filter - Fixed delay with feedback for resonant coloring.

ParamTypeDefaultDescription
insignal-Input signal
timesignal-Delay time in seconds
fbnumber-Feedback amount (0-1)

A comb filter creates a series of peaks and notches at harmonics of the delay frequency. The fundamental frequency is approximately 1/time Hz.

// Tuned resonator at ~220 Hz
osc("noise") |> comb(%, 1/220, 0.95) |> out(%, %)
// Metallic coloring
osc("saw", 110) |> comb(%, 0.01, 0.7) |> out(%, %)
// Karplus-Strong style pluck
osc("noise") * ar(trigger(4), 0.001, 0.01) |> comb(%, 1/440, 0.99) |> out(%, %)

Related: flanger, delay