Python Audio DSP

A comprehensive Python library for audio synthesis, effects processing, and algorithmic composition.

14+ Synths 28+ Effects 8+ Utils 6+ Sequencers MIDI Tools

Installation

Core: pip install audio_dsp
Full (all extras): pip install audio_dsp[full]
Synth only: pip install audio_dsp[synth]
MIDI: pip install audio_dsp[midi]

Quick Start

Basic Synthesis

from audio_dsp.synth import SubtractiveSynth
import soundfile as sf

# Create a synth instance
synth = SubtractiveSynth(sample_rate=44100)
synth.osc_wave = "saw"
synth.filter_cutoff = 800
synth.filter_resonance = 2.0

# Generate audio
audio = synth.synthesize(freq=220, duration=2.0)

# Save to file
sf.write("output.wav", audio, 44100)

Apply Effects

from audio_dsp.effects import fuzz_distortion, filter_effect

# Apply distortion
audio = fuzz_distortion(audio, gain=5.0, mix=0.8)

# Apply filter
audio = filter_effect(audio, cutoff=2000, resonance=1.5)

Drum Synthesis

from audio_dsp.synth import DrumSynth

drums = DrumSynth()
kick = drums.kick(length=0.5, max_pitch=1000, min_pitch=50)
snare = drums.snare(length=0.3, mix=0.5)

Modules Overview

~

Synthesizers

Subtractive, FM (DX7), physical modeling, drums, pluck strings, speech synthesis, and chip-tune generators.

View Synths →
fx

Effects

19 distortion types, filters, vocoders, compressors, delays, phasers, glitch effects, and spectral processors.

View Effects →
fn

Utilities

Scale generators, Arabic maqamat, spectral analysis, noise algorithms, transient extraction, and more.

View Utils →
[]

Sequencers

Raga-based generators, Game of Life sequencers, text-to-music, non-linear/chaotic sequencing.

View Sequencers →
M

MIDI Tools

Polyrhythmic MIDI generation, looping, retuning to alternative tuning systems, and exotic scales.

View MIDI →

Featured Synthesizers

~

SubtractiveSynth

Classic subtractive synthesis with oscillators (sine, saw, square, triangle, PWM), ADSR envelope, resonant filter, and LFO modulation.

Learn more →
~

DX7FMSynth

Yamaha DX7-inspired FM synthesis with 4 operators, 5 algorithms, feedback, and per-operator ADSR envelopes.

Learn more →
~

DrumSynth

Synthesize kicks, snares, cymbals, claps, rims, and toms with customizable pitch sweeps, decay, and layering.

Learn more →

Featured Effects

fx

Distortion Suite

19 distortion types including fuzz, overdrive, wavefold, bitcrush, asymmetric, Chebyshev, and fractal fold.

Learn more →
fx

Vocoder

Classic vocoder with configurable filter banks, noise/sawtooth carriers, and spectral envelope modulation.

Learn more →
fx

Glitch Machine

Segment-based glitch processor with retrigger, pitch shift, reverse, quantize, and ring modulation.

Learn more →

Dependencies

Package Required For Install Extra
numpy Core (always required) included
scipy Core (always required) included
soundfile Core (always required) included
librosa Vocoder, phaser, glitch, time-stretch [full] or [synth]
mido MIDI processing [midi]
simpleaudio Real-time playback [audio]
matplotlib Visualization [viz]
PIL/Pillow Image processing effects [full]