Effects
Audio processing effects including distortion, filters, vocoders, delays, and spectral processors.
Distortion Suite
19 Distortion Types
effects.distortionComprehensive distortion library from subtle saturation to extreme wavefolds.
Common Parameters (All Distortions)
| Parameter | Type | Default | Description |
|---|---|---|---|
| signal | np.array | required | Input audio signal |
| gain | float | varies | Drive/gain amount |
| mix | float | 1.0 | Dry/wet mix (0=dry, 1=wet) |
Classic Distortions
Extreme fuzz with hard clipping. High gain, low threshold for aggressive sound.
Soft tube-style overdrive. Moderate gain for warm crunch.
Subtle tape-style saturation. Low gain for gentle warmth.
Digital hard clipping at threshold level.
Wavefold Distortions
Classic wavefolder. Folds signal back on itself for harmonic richness.
Triangle wave shaping fold.
Sawtooth wave shaping fold.
Parabolic curve folding for smooth harmonics.
Exponential curve folding.
Self-similar fractal folding pattern.
Symmetric mirror folding.
Envelope-following triangle fold.
Mathematical Distortions
Cubic polynomial waveshaping. k controls curve shape.
Logistic function (S-curve) waveshaping.
Polynomial waveshaping with k1, k2 coefficients.
Chebyshev polynomial of order n for precise harmonic generation.
Frequency-locked distortion effect.
Digital/Lo-Fi Distortions
Reduce bit depth. bits=8 for 8-bit sound, lower for more crunch.
Different clipping for positive/negative peaks. Creates even harmonics.
Example Usage
from audio_dsp.effects import (
fuzz_distortion,
wavefold_distortion,
bitcrush_distortion,
chebyshev_fold_distortion
)
import soundfile as sf
# Load audio
audio, sr = sf.read("input.wav")
# Heavy fuzz
fuzzed = fuzz_distortion(audio, gain=15.0, threshold=0.2, mix=0.9)
# Wavefold for synth-like harmonics
folded = wavefold_distortion(audio, gain=8.0, mix=0.7)
# 8-bit retro
crushed = bitcrush_distortion(audio, bits=6, mix=1.0)
# Precise 3rd harmonic
chebyshev = chebyshev_fold_distortion(audio, gain=2.0, n=3, mix=0.5)
sf.write("distorted.wav", fuzzed, sr)
Resonant Filter
filter_effect
effects.LP_BP_filter4-pole resonant ladder filter with tanh saturation for analog-style filtering.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| input_signal | np.array | required | Input audio signal |
| sample_rate | int | 44100 | Sample rate in Hz |
| cutoff | float | 1500 | Cutoff frequency in Hz (50-5000) |
| resonance | float | 0.7 | Resonance/feedback amount (0-5) |
| q | float | 1.0 | Q factor / bandwidth (0.1-10) |
| filter_type | str | "lowpass" | "lowpass" or "bandpass" |
Example Usage
from audio_dsp.effects import filter_effect
import soundfile as sf
audio, sr = sf.read("input.wav")
# Low-pass with resonance
filtered = filter_effect(
audio,
sample_rate=sr,
cutoff=800,
resonance=2.5,
filter_type="lowpass"
)
# Bandpass for wah-style
bandpass = filter_effect(
audio,
sample_rate=sr,
cutoff=1200,
resonance=4.0,
q=5.0,
filter_type="bandpass"
)
sf.write("filtered.wav", filtered, sr)
Vocoder
vocoder
effects.vocoder requires librosaClassic vocoder with spectral envelope modulation and configurable filter banks.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| modulator_file | str | required | Path to voice/control WAV file |
| carrier_file | str | None | Path to carrier WAV (optional) |
| output_file | str | "vocoded.wav" | Output file path |
| n_filters | int | 32 | Number of filter bands |
| freq_range | tuple | (20, 20000) | Frequency range (low_hz, high_hz) |
| carrier_type | str | "noise" | "noise" or "sawtooth" |
| carrier_freq | float | 100 | Sawtooth frequency if no carrier file |
Example Usage
from audio_dsp.effects.vocoder import vocoder
# Voice through synth carrier
vocoder(
modulator_file="voice.wav",
carrier_file="synth_pad.wav",
output_file="robot_voice.wav",
n_filters=64
)
# Classic Daft Punk style (sawtooth carrier)
vocoder(
modulator_file="speech.wav",
carrier_type="sawtooth",
carrier_freq=110,
n_filters=48,
freq_range=(80, 8000)
)
# Whisper effect (noise carrier)
vocoder(
modulator_file="speech.wav",
carrier_type="noise",
n_filters=32
)
Phaser/Flanger
phaser_flanger_effect
effects.phaser requires librosaCombined phaser and flanger effect with independent controls.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| input_signal | np.array | required | Input audio signal |
| sample_rate | int | 44100 | Sample rate in Hz |
| phaser_rate | float | 0.5 | Phaser LFO rate in Hz |
| phaser_depth | float | 0.8 | Phaser notch depth (0-1) |
| phaser_stages | int | 4 | Number of all-pass stages |
| flanger_delay_base | float | 0.005 | Base delay time in seconds |
| flanger_delay_depth | float | 0.005 | Delay modulation depth |
| flanger_rate | float | 0.25 | Flanger LFO rate in Hz |
| phaser_mix | float | 0.7 | Phaser wet/dry (0-1) |
| flanger_mix | float | 0.7 | Flanger wet/dry (0-1) |
| wet_mix | float | 0.7 | Overall wet/dry (0-1) |
Example Usage
from audio_dsp.effects.phaser import phaser_flanger_effect
import soundfile as sf
audio, sr = sf.read("guitar.wav")
# Classic phaser
phased = phaser_flanger_effect(
audio,
sample_rate=sr,
phaser_rate=0.8,
phaser_depth=0.9,
phaser_stages=6,
phaser_mix=0.8,
flanger_mix=0.0 # Disable flanger
)
# Jet flanger
flanged = phaser_flanger_effect(
audio,
sample_rate=sr,
phaser_mix=0.0, # Disable phaser
flanger_delay_base=0.003,
flanger_delay_depth=0.007,
flanger_rate=0.1,
flanger_mix=0.9
)
sf.write("phased.wav", phased, sr)
Super Delay
SuperDelay
effects.super_delay requires librosaFeature-rich delay with pitch drift, flutter, saturation, and compression.
delay() Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| input_file | str | required | Input WAV path |
| output_file | str | required | Output WAV path |
| delay_time | float | 0.25 | Delay time in seconds |
| feedback | float | 0.7 | Feedback amount (0-1) |
| mix | float | 0.5 | Wet/dry mix (0-1) |
| lp_cutoff | float | 3000 | Low-pass filter cutoff Hz |
| flutter_base_rate | float | 5.0 | Flutter LFO rate Hz |
| flutter_depth | float | 0.005 | Flutter modulation depth |
| pitch_drift_depth | float | 0.1 | Pitch drift amount |
| drive | float | 2.0 | Saturation drive |
| threshold | float | 0.7 | Compressor threshold |
| ratio | float | 4.0 | Compression ratio |
Example Usage
from audio_dsp.effects.super_delay import SuperDelay
delay = SuperDelay()
# Tape-style delay with wow/flutter
delay.delay(
input_file="vocals.wav",
output_file="tape_delay.wav",
delay_time=0.375, # dotted eighth
feedback=0.6,
lp_cutoff=2500,
flutter_depth=0.01,
pitch_drift_depth=0.15,
drive=3.0
)
# Clean digital delay
delay.delay(
input_file="guitar.wav",
output_file="clean_delay.wav",
delay_time=0.5,
feedback=0.5,
flutter_depth=0.0,
pitch_drift_depth=0.0,
drive=1.0
)
Glitch Machine
glitch_machine
effects.glitch requires librosaSegment-based glitch processor with multiple random effects.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| input_file | str | required | Input WAV path |
| output_file | str | required | Output WAV path |
| n_segments | int | 32 | Number of slices (16, 32, 64, 128) |
| intensity | float | 0.5 | Fraction of segments to glitch (0-1) |
| loop_length | float | 2.0 | Output duration in seconds |
Applied Effects (Randomized)
Segment repetition / stutter
Random pitch transposition
Play segment backwards
Bit depth reduction
Downsample for aliasing
Short metallic delay
Speed up / slow down
Metallic frequency multiplication
Example Usage
from audio_dsp.effects.glitch import glitch_machine
# Subtle glitching
glitch_machine(
input_file="drums.wav",
output_file="glitched_subtle.wav",
n_segments=32,
intensity=0.3,
loop_length=4.0
)
# Extreme destruction
glitch_machine(
input_file="vocals.wav",
output_file="destroyed.wav",
n_segments=128,
intensity=0.9,
loop_length=2.0
)
Multi-Band Saturation
process_multi_band
effects.multi_band_saturationSplit signal into frequency bands with independent saturation drive per band.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| input_signal | np.array | required | Input audio signal |
| fs | int | required | Sample rate in Hz |
| crossovers | list[float] | required | Crossover frequencies in Hz |
| drives | list[float] | required | Drive amount per band (len = crossovers + 1) |
Example Usage
from audio_dsp.effects.multi_band_saturation import process_multi_band
import soundfile as sf
audio, sr = sf.read("master.wav")
# 3-band saturation: warm lows, crunchy mids, clean highs
saturated = process_multi_band(
audio,
fs=sr,
crossovers=[200, 2000], # Split at 200Hz and 2kHz
drives=[2.0, 5.0, 1.0] # Low, Mid, High drive
)
# 4-band with surgical control
saturated = process_multi_band(
audio,
fs=sr,
crossovers=[100, 500, 4000],
drives=[1.5, 3.0, 4.0, 1.0]
)
sf.write("multiband_sat.wav", saturated, sr)
Negative Audio / Sidechain
Negative Audio
effects.negative_audioWaveform inversion and sidechain compression for pumping effects.
create_negative_waveform()
| Parameter | Type | Description |
|---|---|---|
| input_signal | np.array | Input audio signal |
Returns: 1 - x(t) mapped waveform
sidechain_compressor()
| Parameter | Type | Default | Description |
|---|---|---|---|
| input_signal | np.array | required | Signal to compress |
| control_signal | np.array | required | Sidechain trigger (e.g., kick) |
| fs | int | required | Sample rate |
| threshold | float | 0.2 | Threshold (0-1) |
| ratio | float | 10.0 | Compression ratio |
| attack_ms | float | 5 | Attack time in ms |
| release_ms | float | 50 | Release time in ms |
Example Usage
from audio_dsp.effects.negative_audio import (
create_negative_waveform,
sidechain_compressor
)
import soundfile as sf
# Invert waveform
audio, sr = sf.read("input.wav")
negative = create_negative_waveform(audio)
# EDM-style pumping sidechain
bass, sr = sf.read("bass.wav")
kick, _ = sf.read("kick.wav")
pumped = sidechain_compressor(
bass,
kick,
fs=sr,
threshold=0.1,
ratio=20.0,
attack_ms=1,
release_ms=100
)
sf.write("pumping_bass.wav", pumped, sr)
Advanced Compressors
Specialized Compressors
effectsAdvanced compression algorithms for creative dynamics processing.
Spectral domain compression operating on frequency bins.
Advanced adaptive compression with topological analysis.
Transparent dynamics control for mastering.
Fractional-order compression for unique dynamics curves.