Open Source Music Synthesis

Create Music
with Python

A professional library that transforms code into sound. Build synthesizers, compose melodies, and design audio with unprecedented control.

Installation
pip install sprechstimme
17+
Synthesis Methods
33+
Presets
Possibilities

What is Sprechstimme?

Sprechstimme is a professional-grade Python library that bridges the gap between code and music. Whether you're a musician exploring algorithmic composition or a developer building audio applications, Sprechstimme provides the tools you need.

From simple sine waves to complex FM synthesis, from single notes to multi-track compositions, Sprechstimme handles it all with an elegant, Pythonic API.

Real-time Playback
WAV Export
MIDI Support
Multi-track
Effects Chain
Audio Analysis
Custom DSP
Beat Precision

Comprehensive Capabilities

Advanced Synthesis

17+ waveform types including classic oscillators, FM synthesis, wavetable morphing, and physical modeling.

  • Sine, square, sawtooth, triangle
  • FM & PM synthesis
  • Wavetable with morphing
  • Karplus-Strong algorithm
  • Noise generators (white, pink, brown)

Professional Effects

Studio-quality filters and effects for shaping your sound.

  • Moog ladder filter
  • Reverb & delay
  • Chorus & flanger
  • Compression

Multi-track Composition

Build complex arrangements with precise timing control.

  • Beat-precise positioning
  • Unlimited tracks
  • Chord notation
  • BPM control

Audio Analysis

Understand your audio with professional analysis tools.

  • FFT spectrum analysis
  • Pitch detection
  • Onset detection
  • Tempo estimation

33+ Ready Presets

Pre-configured instruments ready to use: piano, strings, brass, bass, leads, pads, and experimental sounds.

See it in Action

Getting Started

import sprechstimme as sp

# Create a synthesizer
sp.new('synth')

# Play a note
sp.play('synth', 'A4', duration=1.0)

# Play a chord
sp.play('synth', ['C4', 'E4', 'G4'], duration=2.0)

Advanced Synthesis

import sprechstimme as sp
from functools import partial

# Create custom synthesizer
sp.new('lead')
sp.create(
    'lead',
    wavetype=sp.waves.fm,
    filters=[
        partial(sp.filters.moog_ladder, cutoff=2000, resonance=0.7),
        partial(sp.filters.reverb, room_size=0.8)
    ],
    envelope={
        'attack': 0.01,
        'decay': 0.2,
        'sustain': 0.6,
        'release': 0.5
    }
)

sp.play('lead', 'C5', duration=3.0)

Multi-track Composition

import sprechstimme as sp

# Load presets
sp.presets.load('piano')
sp.presets.load('bass')

# Create song
song = sp.Song(bpm=120)

# Add piano chords
song.add_chord('piano_track', 'piano', 'C4', beat_position=0, duration=4)
song.add_chord('piano_track', 'piano', 'F4', beat_position=4, duration=4)
song.add_chord('piano_track', 'piano', 'G4', beat_position=8, duration=4)

# Add bass line
for i, note in enumerate(['C2', 'C2', 'F2', 'F2', 'G2', 'G2']):
    song.add('bass_track', 'bass', note, beat_position=i*2, duration=1.5)

# Export
song.export('my_song.wav')

Audio Analysis

import sprechstimme as sp
import numpy as np

# Generate audio
sp.new('synth')
audio = sp.generate('synth', 'A4', duration=2.0)

# Analyze pitch
pitch, confidence = sp.analysis.detect_pitch(audio)
print(f'Pitch: {pitch:.2f} Hz ({confidence:.1%} confidence)')

# Get spectrum
spectrum = sp.analysis.fft(audio)
freqs, mags = sp.analysis.get_spectrum(spectrum)

# Find peaks
peaks = sp.analysis.find_peaks(mags, threshold=0.5)
print(f'Spectral peaks at: {freqs[peaks][:5]} Hz')

# Detect tempo
bpm = sp.analysis.detect_tempo(audio)
print(f'Tempo: {bpm:.1f} BPM')

Try It Online

Experiment with Sprechstimme directly in your browser

Interactive Web Playground

Full-featured code editor with real-time audio synthesis running directly in your browser. No installation required!

Live Audio No Setup Instant Playback
Launch Playground

Full Python Library

Install the complete Sprechstimme library locally for advanced features, file export, and integration with your projects.

Full Features WAV Export Production Ready
View Installation

Quick Start Code

Copy this into any Python environment to get started:

# Install and import
import os
os.system('pip install sprechstimme')

import sprechstimme as sp

# Create your first sound
sp.new('synth')
sp.play('synth', ['C4', 'E4', 'G4'], duration=2.0)

Interactive Demos

Explore the power of Sprechstimme with live examples

Waveform Visualizer

See different synthesis methods in action. Select a waveform to visualize its shape:

Waveform: Sine
Frequency: 440 Hz (A4)
Use Case: Pure tones, smooth pads, sub bass

Chord Progression

Composition

Create harmonic progressions with automatic voice leading.

sp.presets.load('piano')
song = sp.Song(bpm=90)
for chord in ['Cmaj7', 'Am7', 'Fmaj7', 'G7']:
    song.add_chord('piano', chord, duration=4)
Output: Jazz chord progression in C major

FM Bell Sound

Synthesis

Frequency modulation creates metallic, bell-like timbres.

sp.new('bell')
sp.create('bell',
    wavetype=sp.waves.fm,
    mod_ratio=3.5,
    mod_index=12,
    envelope={'decay': 2.0}
)
Output: Bright, metallic bell tone

Moog Filter Sweep

Effects

Classic analog-style filter with resonance control.

sp.new('bass')
sp.apply_filter('bass',
    sp.filters.moog_ladder,
    cutoff=500,
    resonance=0.9
)
Output: Warm, squelchy filtered sound

Karplus-Strong Pluck

Physical Modeling

Physical modeling algorithm for plucked string instruments.

sp.new('guitar')
sp.create('guitar',
    wavetype=sp.waves.karplus_strong,
    damping=0.998
)
sp.play('guitar', 'E2', duration=3.0)
Output: Realistic guitar/bass pluck

Reverb & Delay

Spatial FX

Add depth and space to any sound with reverb and delay.

sp.apply_filter('synth',
    sp.filters.reverb,
    room_size=0.9,
    damping=0.5
)
sp.apply_filter('synth', sp.filters.delay)
Output: Spacious, ambient atmosphere

Spectrum Analysis

Analysis

Analyze frequency content and detect musical features.

audio = sp.generate('synth', 'A4')
spectrum = sp.analysis.fft(audio)
pitch = sp.analysis.detect_pitch(audio)
print(f"Detected: {pitch} Hz")
Output: Detected: 440.0 Hz (A4)

Wavetable Morphing

Advanced

Smoothly morph between different waveforms over time.

sp.new('morph')
sp.create('morph',
    wavetype=sp.waves.wavetable,
    tables=[sp.waves.sine, sp.waves.square],
    morph_position=0.5
)
Output: Evolving, dynamic timbre

Multi-track Export

Production

Export complete songs with multiple instruments to WAV.

song = sp.Song(bpm=128)
song.add_track('drums', 'kick', ...)
song.add_track('bass', 'bass', ...)
song.export('output.wav', quality='high')
Output: Professional 24-bit WAV file

Documentation