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.
| Param | Type | Default | Description |
|---|---|---|---|
| in | signal | - | Input signal |
| rate | number | 0.5 | LFO rate in Hz |
| depth | number | 0.5 | Modulation depth (0-1) |
| base_delay | number | 20.0 | Base chorus delay (ms) |
| depth_range | number | 10.0 | Modulation 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(%, %) flanger
Flanger - Comb filtering with swept delay time.
| Param | Type | Default | Description |
|---|---|---|---|
| in | signal | - | Input signal |
| rate | number | 1.0 | LFO rate in Hz |
| depth | number | 0.7 | Modulation depth (0-1) |
| min_delay | number | 0.1 | Minimum sweep delay (ms) |
| max_delay | number | 10.0 | Maximum 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(%, %) phaser
Phaser - Creates notches in frequency spectrum via allpass filters.
| Param | Type | Default | Description |
|---|---|---|---|
| in | signal | - | Input signal |
| rate | number | 0.5 | LFO rate in Hz |
| depth | number | 0.8 | Modulation depth (0-1) |
| min_freq | number | 200.0 | Sweep range low (Hz) |
| max_freq | number | 4000.0 | Sweep 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(%, %) comb
Comb Filter - Fixed delay with feedback for resonant coloring.
| Param | Type | Default | Description |
|---|---|---|---|
| in | signal | - | Input signal |
| time | signal | - | Delay time in seconds |
| fb | number | - | 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(%, %)