Contents

Distortion

Distortion effects add harmonic content by clipping, saturating, or otherwise mangling signals.

All effects in this file expose dry and wet as their last two parameters (Category B defaults dry=0, wet=1 for transform effects). See Effect Parameters Convention for the full spec.

saturate

Tanh saturation - Smooth hyperbolic tangent waveshaping with drive control.

ParamTypeDefaultDescription
insignal-Input signal
drivenumber2.0Drive amount (1-10+)
drynumber0.0Dry signal level (Category B)
wetnumber1.0Wet (processed) signal level (Category B)

Aliases: distort

Warm, tube-like saturation that adds odd harmonics while preventing harsh clipping. Higher drive values increase saturation intensity.

Note: For pure math tanh(x) (hyperbolic tangent), see Math Functions. The saturate() function wraps tanh with drive control for convenient distortion.

// Warm overdrive
saw(110) |> saturate(@, 3) |> out(@)
// Heavy saturation on bass
saw(55) |> saturate(@, 8) |> lp(@, 400) |> out(@)
// Subtle warming
sine(220) |> saturate(@, 1.5) |> out(@)

Related: softclip, fold, tanh (math)


softclip

Soft clipping - Polynomial soft clipper with adjustable threshold.

ParamTypeDefaultDescription
insignal-Input signal
threshnumber0.5Clipping threshold (0-1)
drynumber0.0Dry signal level (Category B)
wetnumber1.0Wet (processed) signal level (Category B)

Softer than hard clipping, rounds off peaks smoothly. Lower threshold values create more aggressive distortion.

// Gentle compression-like softclip
saw(220) |> softclip(@, 0.7) |> out(@)
// Aggressive softclip
sqr(110) |> softclip(@, 0.2) |> out(@)

Related: saturate


bitcrush

Bit crusher - Reduces bit depth and sample rate.

ParamTypeDefaultDescription
insignal-Input signal
bitsnumber8.0Bit depth (1-16)
ratenumber0.5Sample rate reduction (0-1)
drynumber0.0Dry signal level (Category B)
wetnumber1.0Wet (processed) signal level (Category B)

Aliases: crush

Creates lo-fi digital artifacts by quantizing amplitude and reducing sample rate. Lower values create more extreme degradation.

// Classic 8-bit sound
saw(220) |> bitcrush(@, 8, 0.5) |> out(@)
// Extreme lo-fi
saw(110) |> bitcrush(@, 4, 0.2) |> out(@)
// Subtle grit
saw(440) |> bitcrush(@, 12, 0.8) |> out(@)

Related: fold


fold

Wavefolding - Folds signal back on itself when exceeding threshold.

ParamTypeDefaultDescription
insignal-Input signal
threshnumber0.5Folding threshold (0-1)
drynumber0.0Dry signal level (Category B)
wetnumber1.0Wet (processed) signal level (Category B)

Aliases: wavefold

Classic West Coast synthesis technique. When the signal exceeds the threshold, it folds back, producing complex harmonic spectra.

// Basic wavefold
sine(110) * 2 |> fold(@, 0.5) |> out(@)
// Animated wavefolding
sine(110) * (1.5 + sine(0.2)) |> fold(@, 0.4) |> out(@)
// Aggressive folding
tri(55) * 4 |> fold(@, 0.3) |> lp(@, 2000) |> out(@)

Related: saturate, softclip


tube

Tube saturation - Asymmetric waveshaping with even harmonics.

ParamTypeDefaultDescription
insignal-Input signal
drivenumber5.0Drive amount (1-20)
biasnumber0.1Asymmetry bias (0-0.3)
drynumber0.0Dry signal level (Category B)
wetnumber1.0Wet (processed) signal level (Category B)

Aliases: valve, triode

Emulates triode tube saturation with an asymmetric transfer function. Unlike symmetric saturators like tanh which produce only odd harmonics, tube adds even harmonics (especially 2nd) for a warmer, vintage character. Uses 2x oversampling internally.

// Warm vintage drive
saw(110) |> tube(@, 5, 0.1) |> out(@)
// Aggressive tube distortion
saw(55) |> tube(@, 15, 0.2) |> lp(@, 800) |> out(@)
// Subtle 2nd harmonic enhancement
sine(220) |> tube(@, 2, 0.15) |> out(@)

Related: saturate, tape


smooth

ADAA saturation - Alias-free saturation using antiderivative antialiasing.

ParamTypeDefaultDescription
insignal-Input signal
drivenumber5.0Drive amount (1-20)
drynumber0.0Dry signal level (Category B)
wetnumber1.0Wet (processed) signal level (Category B)

Aliases: adaa

Tanh saturation with built-in antialiasing. Uses the ADAA (Antiderivative Antialiasing) algorithm to eliminate aliasing artifacts without oversampling. Suited for saturation on full mixes or high-frequency content.

// Clean master bus saturation
saw(220) |> smooth(@, 3) |> out(@)
// Heavy saturation without harshness
sqr(440) |> smooth(@, 10) |> out(@)
// High-frequency content stays clean
saw(880) |> smooth(@, 8) |> out(@)

Related: saturate, tube


tape

Tape saturation - Soft compression with high-frequency warmth.

ParamTypeDefaultDescription
insignal-Input signal
drivenumber3.0Drive amount (1-10)
warmthnumber0.3HF rolloff (0-1)
soft_threshnumber0.5Saturation onset threshold
warmth_scalenumber0.7HF rolloff amount
drynumber0.0Dry signal level (Category B)
wetnumber1.0Wet (processed) signal level (Category B)

Emulates magnetic tape characteristics: a wide linear region, soft compression at extremes, and subtle high-frequency rolloff. The warmth parameter controls how much the high frequencies are smoothed. Uses 2x oversampling internally.

The advanced soft_thresh parameter controls where saturation begins (lower = earlier saturation). The warmth_scale parameter controls the intensity of the high-frequency rolloff effect.

// Tape-style glue
saw(110) |> tape(@, 4, 0.4) |> out(@)
// Lo-fi tape warmth
sqr(220) |> tape(@, 6, 0.8) |> out(@)
// Subtle tape coloration
sine(440) |> tape(@, 2, 0.2) |> out(@)
// More aggressive saturation with stronger HF rolloff
saw(110) |> tape(@, 5, 0.5, 0.3, 0.9) |> out(@)

Related: tube, saturate


xfmr

Transformer saturation - Bass-heavy saturation.

ParamTypeDefaultDescription
insignal-Input signal
drivenumber3.0Drive amount (1-10)
bassnumber5.0Bass saturation (1-10)
bass_freqnumber60.0Bass extraction cutoff (Hz)
drynumber0.0Dry signal level (Category B)
wetnumber1.0Wet (processed) signal level (Category B)

Aliases: transformer, console

Emulates transformer/console saturation where bass frequencies saturate more heavily than highs (magnetic core saturation). Produces thick, punchy low-end while keeping highs relatively clean. Suited for drums and bass. Uses 2x oversampling internally.

The bass_freq parameter controls the cutoff frequency for bass extraction. Higher values include more of the signal in the bass saturation path.

// Punchy bass
saw(55) |> xfmr(@, 4, 8) |> out(@)
// Console warmth on synths
saw(220) |> xfmr(@, 3, 4) |> out(@)
// Thick transformer saturation
sqr(110) |> xfmr(@, 5, 6) |> lp(@, 2000) |> out(@)
// Extended bass range saturation
saw(110) |> xfmr(@, 4, 6, 120) |> out(@)

Related: tube, tape


excite

Harmonic exciter - Adds controlled harmonics to high frequencies.

ParamTypeDefaultDescription
insignal-Input signal
amountnumber0.5Exciter intensity (0-1)
freqnumber3000Corner frequency (1000-10000 Hz)
harm_oddnumber0.4Odd harmonic mix (0-1)
harm_evennumber0.6Even harmonic mix (0-1)
drynumber0.0Dry signal level (Category B)
wetnumber1.0Wet (processed) signal level (Category B)

Aliases: exciter, aural

Adds harmonic content to frequencies above the corner frequency only, similar to an Aphex Aural Exciter. Adds presence without low-frequency mud. Uses 2x oversampling internally.

The harm_odd and harm_even parameters control the mix of odd and even harmonics. Even harmonics sound warmer; odd harmonics add edge and presence.

// Add presence to synths
saw(220) |> excite(@, 0.5, 3000) |> out(@)
// Brighten with higher corner
tri(440) |> excite(@, 0.7, 5000) |> out(@)
// Subtle air and sparkle
sine(110) |> excite(@, 0.3, 4000) |> out(@)
// Warmer excitation (more even harmonics)
saw(220) |> excite(@, 0.5, 3000, 0.2, 0.8) |> out(@)

Related: tube, saturate