Skip to content

FX

Each FX function wraps a Machine and returns a new Machine with the effect in the signal path.

Usage

Direct form

Pass the machine as the first argument:

const synth = reverb(comp(vasynth({ wave: 'sawtooth' }), { threshold: -20 }), { mix: 0.3 })

chain() helper

Use chain() to apply multiple FX without deep nesting. Call each FX with options only (curried form) to get a (Machine) => Machine transformer:

const synth = chain(
vasynth({ wave: 'sawtooth' }),
comp({ threshold: -20, ratio: 4 }),
reverb({ mix: 0.3 }),
)
chain(machine, ...fxChain) → Machine
ArgumentTypeDescription
machineMachineSource machine
...fxChain((m: Machine) => Machine)[]FX functions in curried form

Both forms are interchangeable and fully backward-compatible.


Available effects

eq — Parametric EQ

Filters and shapes individual frequency bands.

chain(vasynth(), eq({ type: 'highpass', freq: 80 }))
ParameterDefaultDescription
type'peaking'lowpass / highpass / bandpass / notch / peaking / lowshelf / highshelf
freq1000Center / cutoff frequency (Hz)
gain0Band gain in dB (peaking / shelf only)
q1Bandwidth / resonance
mix1.0Wet/dry mix
envEnvelope sequencer for mix modulation

comp — Compressor

Reduces dynamic range for punch and consistency.

chain(vasynth(), comp({ threshold: -24, ratio: 4, makeup: 6 }))
ParameterDefaultDescription
threshold-24Compression threshold (dB)
ratio4Compression ratio
attack0.003Attack time (s)
release0.25Release time (s)
knee6Knee width (dB)
makeup0Makeup gain (dB)
mix1.0Wet/dry mix
envEnvelope sequencer for mix modulation

limit — Hard Limiter

Prevents output from exceeding a ceiling.

chain(vasynth(), limit({ threshold: -3 }))
ParameterDefaultDescription
threshold-3Limiter ceiling (dB)
release0.05Release time (s)

saturate — Tape Saturation

Adds warmth and harmonic density via tanh soft-clipping.

chain(vasynth(), saturate({ drive: 3, mix: 0.8 }))
ParameterDefaultDescription
drive2Saturation amount (1 = linear, 10 = heavy)
output0.8Output makeup gain
mix1.0Wet/dry mix
envEnvelope sequencer for mix modulation

distort — Waveshaper Distortion

Hard-clip waveshaper with tone control.

chain(vasynth(), distort({ drive: 10, tone: 3000 }))
ParameterDefaultDescription
drive10Pre-clip gain
tone5000Post-clip low-pass cutoff (Hz)
output0.5Output makeup gain
mix1.0Wet/dry mix
envEnvelope sequencer for mix modulation

reverb — Reverb

Convolution reverb using a synthetically generated impulse response.

chain(vasynth(), reverb({ size: 0.7, mix: 0.3 }))
ParameterDefaultDescription
size0.7IR length scale (0.1–2)
decay2.0Decay speed — higher = shorter tail (0.5–10)
damping0.5High-frequency damping (0 = dark, 1 = bright)
mix0.3Wet/dry mix
envEnvelope sequencer for mix modulation

pingpong — Ping-Pong Delay

Stereo ping-pong delay that alternates L → R → L.

chain(vasynth(), pingpong({ time: 0.375, feedback: 0.4, mix: 0.4 }))
ParameterDefaultDescription
time0.375Delay time per tap (s)
feedback0.4Feedback amount (0–0.9)
mix0.4Wet/dry mix
envEnvelope sequencer for mix modulation

chorus — Chorus

LFO-modulated short delay that thickens the sound.

chain(vasynth(), chorus({ rate: 0.5, depth: 0.5, mix: 0.5 }))
ParameterDefaultDescription
rate0.5LFO rate (Hz)
depth0.5Modulation depth (0–1)
delay25Center delay time (ms)
feedback0.2Feedback amount (0–0.5)
mix0.5Wet/dry mix
envEnvelope sequencer for mix modulation

flanger — Flanger

Jet-sweep effect using a very short LFO-modulated delay (1–5 ms).

chain(vasynth(), flanger({ rate: 0.3, depth: 0.7, feedback: 0.5 }))
ParameterDefaultDescription
rate0.3LFO rate (Hz)
depth0.7Modulation depth (0–1)
delay3Center delay time (ms)
feedback0.5Feedback amount (0–0.95)
mix0.5Wet/dry mix
envEnvelope sequencer for mix modulation

phaser — Phaser

Cascaded allpass filters swept by an LFO, creating phase-interference notches.

chain(vasynth(), phaser({ stages: 4, rate: 0.5, centerFreq: 800 }))
ParameterDefaultDescription
rate0.5LFO rate (Hz)
depth0.7Modulation depth (0–1)
stages4Number of allpass stages (2 / 4 / 6 / 8)
feedback0.4Feedback amount (0–0.9)
centerFreq800Allpass center frequency (Hz)
mix0.5Wet/dry mix
envEnvelope sequencer for mix modulation

stutter — Rhythmic Gate

Rapidly gates the wet signal to create stuttering repetitions. The gate pattern is scheduled once per cycle via scheduleAutomation.

chain(vasynth(), stutter({ rate: 8, duty: 0.5, mix: 0.8 }))
ParameterDefaultDescription
rate8Gate subdivisions per beat (e.g. 8 = 1/8-beat gate)
duty0.5Gate open fraction 0–1 (0.5 = 50% on, 50% off)
mix0.8Wet/dry mix — dry signal passes through unaffected
// 1/16-note stutter with tight gate
chain(lead, stutter({ rate: 16, duty: 0.3, mix: 0.9 }))
// Slow gate on a pad, every half-beat
chain(pad, stutter({ rate: 2, duty: 0.6, mix: 0.7 }))

freeze — Feedback Freeze

High-feedback delay loop that sustains the signal, approximating a freeze/hold effect. Useful for ambient drones and glitchy sustain tails.

chain(pad, freeze({ feedback: 0.92, loopTime: 0.4, mix: 0.7 }))
ParameterDefaultDescription
feedback0.92Feedback amount 0–0.999 (higher = longer sustain)
loopTime0.4Feedback loop length in seconds
mix0.7Wet/dry mix
// Long ambient drone tail
chain(strings({ attack: 1.2, gain: 0.3 }), freeze({ feedback: 0.97, loopTime: 0.6 }))
// Short glitchy freeze burst
chain(vasynth(), freeze({ feedback: 0.85, loopTime: 0.1, mix: 0.5 }))