Modulation Effects
Modulation effects use time-varying delays to add movement and spatial width to sounds.
All effects in this file expose dry and wet as their last two parameters (Category A defaults dry=1, wet=0.5 for additive effects). See Effect Parameters Convention for the full spec.
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) |
| lfo_phase | number | 0.25 | R-channel LFO offset, in turns (0.0–1.0). 0 = mono-equivalent; 0.25 = 90° (default stereo widening); 0.5 = anti-phase. |
| dry | number | 1.0 | Dry signal level (Category A) |
| wet | number | 0.5 | Wet (processed) signal level (Category A) |
Mixes the input with delayed copies that are slightly pitch-shifted by an LFO, producing a thicker, wider sound.
The base_delay parameter sets the center delay time, while depth_range controls how far the modulation sweeps from the base. Larger values produce more pronounced detuning.
Chorus is stereo-native: mono input widens to a true stereo image with the right channel reading the LFO at the lfo_phase offset; stereo input gets independent per-channel processing.
// Classic chorus
saw(220) |> chorus(@, 0.5, 0.5) |> out(@) // Slow deep chorus
tri(110) |> chorus(@, 0.2, 0.8) |> out(@) // Fast shimmer
sine(440) |> chorus(@, 2, 0.3) |> out(@) // Wide chorus with longer delay
saw(220) |> chorus(@, 0.3, 0.6, 30, 15) |> out(@) // Anti-phase R LFO for maximum stereo width
saw(220) |> chorus(@, 0.5, 0.6, lfo_phase: 0.5) |> out(@) // lfo_phase: 0 = mono-equivalent (L=R)
saw(220) |> chorus(@, 0.5, 0.6, lfo_phase: 0) |> 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) |
| feedback | number | -0.99 | Delay-line feedback (-0.99 to 0.99) — sharpens resonance |
| lfo_phase | number | 0.25 | R-channel LFO offset, in turns (0.0–1.0). 0 = mono-equivalent; 0.25 = 90° (default); 0.5 = anti-phase. |
| dry | number | 1.0 | Dry signal level (Category A) |
| wet | number | 0.5 | Wet (processed) signal level (Category A) |
Similar to chorus but with shorter delay times and feedback, creating the characteristic “jet plane” sweep effect. Flanger is stereo-native: mono input widens via the lfo_phase offset on the right channel.
feedback is a named argument: higher magnitudes (toward ±0.99) sharpen and intensify the comb resonances for a more pronounced 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
saw(110) |> flanger(@, 0.5, 0.7) |> out(@) // Slow metallic sweep
sqr(220) |> flanger(@, 0.1, 0.9) |> out(@) // Fast subtle movement
tri(440) |> flanger(@, 3, 0.3) |> out(@) // Tight metallic flanger
saw(110) |> flanger(@, 0.5, 0.8, 0.05, 2.0) |> out(@) // Resonant flanger with strong feedback
saw(110) |> flanger(@, 0.3, 0.8, feedback: 0.85) |> 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) |
| feedback | number | 0.5 | Feedback amount (0–0.99). Higher = sharper resonance. |
| stages | number | 4 | Number of allpass stages (2–12). Each pair of stages = one notch. |
| lfo_phase | number | 0.25 | R-channel LFO offset, in turns (0.0–1.0). 0 = mono-equivalent; 0.25 = 90° (default stereo notch sweep); 0.5 = anti-phase. |
| dry | number | 1.0 | Dry signal level (Category A) |
| wet | number | 0.5 | Wet (processed) signal level (Category A) |
Sweeps a chain of allpass-derived notches through the spectrum, producing a swirling effect distinct from chorus or flanger.
More stages give more notches; higher feedback sharpens the resonance. Both parameters are full runtime params — you can wire a signal to either one.
The phaser output is the canonical Bode/MXR sum (dry + allpass cascade), so expect up to +6 dB peak gain at constructive interference points.
// Classic phaser
saw(110) |> phaser(@, 0.3, 0.8) |> out(@) // Fast space phaser
sqr(220) |> phaser(@, 2, 0.5) |> out(@) // Slow deep sweep
noise() |> lp(@, 2000) |> phaser(@, 0.1, 0.9) |> out(@) // Extended high-frequency sweep
saw(110) |> phaser(@, 0.2, 0.8, 100, 8000) |> out(@) // Deep, resonant 6-stage phaser with strong feedback
saw(110)
|> phaser(@, 0.5, 0.9, 100, 5000, feedback: 0.7, stages: 6)
|> out(@) // Wide stereo phaser — anti-phase R LFO
saw(110) |> phaser(@, 0.3, 0.8, lfo_phase: 0.5) |> 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) |
| dry | number | 1.0 | Dry signal level (Category A) |
| wet | number | 0.5 | Wet (processed) signal level (Category A) |
| damping | number | 0.0 | Tail high-frequency damping (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.
damping is a named argument — a one-pole lowpass in the feedback path that rolls off high frequencies in the resonant tail for a darker, less metallic color.
// Tuned resonator at ~220 Hz
noise() |> comb(@, 1/220, 0.95) |> out(@) // Metallic coloring
saw(110) |> comb(@, 0.01, 0.7) |> out(@) // Karplus-Strong style pluck
noise() * ar(trigger(4), 0.001, 0.01)
|> comb(@, 1/440, 0.99)
|> out(@) // Damped comb — darker, less metallic tail
noise() * ar(trigger(4), 0.001, 0.01)
|> comb(@, 1/440, 0.97, damping: 0.6)
|> out(@)