Karplus-Strong Modulator — User Guide
Physical modeling synthesis meets audio processing: applies the classic Karplus-Strong string synthesis algorithm as a real-time modulation effect, creating plucked string textures, metallic resonances, and sci-fi soundscapes from any audio input.
What this does
This script implements Karplus-Strong modulation — an innovative audio processing technique that adapts the classic Karplus-Strong physical modeling synthesis algorithm for real-time audio effects processing. Unlike traditional Karplus-Strong which generates sound from noise bursts, this modulator processes existing audio through a tuned delay line with feedback, creating plucked string resonances, metallic textures, and evolving sci-fi effects that respond dynamically to the input signal.
Key Features:
- 4 Specialized Presets — Deep bass, sci-fi, metallic, warp drive effects
- Physical Modeling — Authentic Karplus-Strong algorithm implementation
- Real-time Pitch Modulation — Dynamic frequency control via LFO
- Precise Resonance Control — Adjustable decay and sustain characteristics
- Dry/Wet Mixing — Flexible blending with original signal
- Mathematical Precision — Sample-accurate delay line processing
Technical Implementation: (1) Signal Flow: Input audio → mixed with feedback signal → processed through tuned delay line → applied averaging filter → fed back into input. (2) Delay Line Tuning: Delay time = 1/frequency, creating resonant frequency. (3) Pitch Modulation: LFO controls delay time variation: modulated_delay = 1/(base_freq × 2^(depth×sin(2π×rate×t)/12)). (4) Averaging Filter: (self[t-delay] + self[t-delay-dt])/2 creates low-pass filtering. (5) Feedback Control: Decay parameter (0.5-0.99) controls feedback amount. (6) Mixing: Dry/wet blend preserves original signal characteristics. Key insight: The algorithm transforms any audio into resonant, string-like textures while preserving the original's rhythmic and spectral character.
Quick start
- In Praat, select exactly one Sound object.
- Run script… →
karplus_strong_modulator.praat. - Choose Preset or select "Custom" for manual control:
- Deep Bass Pluck — Low-frequency string effects
- Sci-Fi Siren — Sweeping modulated textures
- Metallic Chime — Bright, sustained resonances
- Warp Drive Engine — Intense, complex modulation
- For custom settings, adjust parameters:
- Ks_Base_Freq — Resonator frequency (Hz)
- Ks_Mod_Rate — Pitch modulation speed
- Ks_Mod_Depth — Pitch modulation intensity
- Ks_Decay — Resonance sustain length
- Ks_Mix — Dry/wet balance
- Enable Play_result for immediate preview.
- Click OK — processing applied, result named "originalname_KS_Mod".
Quick Presets
Preset 1: Custom
🎛️ Full Parameter Control
Character: Complete manual control over all Karplus-Strong parameters
Use case: Experimental sound design, specific musical requirements
Recommended for: Advanced users familiar with physical modeling synthesis
Preset 2: Deep Bass Pluck
🎸 Subharmonic String Resonance
Settings: freq=80Hz, rate=0.2Hz, depth=1.0, decay=0.85, mix=0.6
Character: Deep, punchy bass string simulations
Sonic qualities: Strong fundamental, quick decay, subtle pitch variation
Best for: Bass enhancement, kick drum processing, low-end reinforcement
Source recommendations: Kick drums, basslines, low vocal tones
Preset 3: Sci-Fi Siren
🚀 Sweeping Synthetic Textures
Settings: freq=440Hz, rate=0.3Hz, depth=12, decay=0.96, mix=0.5
Character: Slow, evolving pitch sweeps with long sustain
Sonic qualities: Prominent pitch modulation, atmospheric decay, cinematic feel
Best for: Sound design, sci-fi effects, atmospheric pads
Source recommendations: Synthetic sounds, vocal sustains, noise bursts
Preset 4: Metallic Chime
🔔 Bright Sustained Resonances
Settings: freq=880Hz, rate=6.0Hz, depth=0.5, decay=0.99, mix=0.4
Character: Bright, metallic tones with fast subtle modulation
Sonic qualities: High frequency focus, very long decay, shimmering texture
Best for: Bell-like effects, harmonic enhancement, ethereal textures
Source recommendations: Cymbals, glass sounds, high-frequency content
Preset 5: Warp Drive Engine
⚡ Intense Complex Modulation
Settings: freq=150Hz, rate=8.0Hz, depth=24, decay=0.92, mix=0.8
Character: Aggressive, complex pitch distortion effects
Sonic qualities: Extreme modulation, medium decay, transformative results
Best for: Experimental music, sound destruction, intense effects
Source recommendations: Drum loops, complex textures, noise sources
Preset Sonic Characteristics
| Preset | Frequency Focus | Modulation Style | Decay Character | Musical Use |
|---|---|---|---|---|
| Deep Bass Pluck | Sub-bass (80Hz) | Very slow, subtle | Short, punchy | Rhythmic reinforcement |
| Sci-Fi Siren | Mid-range (440Hz) | Slow, sweeping | Long, evolving | Atmospheric pads |
| Metallic Chime | High (880Hz) | Fast, subtle | Very long | Textural enhancement |
| Warp Drive Engine | Low-mid (150Hz) | Very fast, extreme | Medium | Sound destruction |
Karplus-Strong Theory
Original Algorithm Foundation
🎻 Physical String Modeling
Historical context: Developed 1983 by Karplus & Strong at Stanford
Core insight: Digital delay line + averaging filter = string simulation
Revolutionary impact: First realistic physical modeling synthesis
This adaptation: Applies same principles as audio effect rather than sound generator
Classic Karplus-Strong Synthesis
Traditional implementation for sound generation:
Modulator Adaptation
From Synthesis to Effect Processing
Key modifications for audio processing:
Mathematical Foundation
Delay Line Resonance
Fundamental frequency calculation:
Averaging Filter Analysis
Low-pass filtering effect:
Complete Algorithm Mathematics
Final Processing Formula
The complete Karplus-Strong modulator equation:
Physical Interpretation
Why It Sounds Like Strings
Acoustic correspondence:
Longer delay = lower pitch = longer string
Shorter delay = higher pitch = shorter string
Averaging Filter: Represents string stiffness
Causes high-frequency damping
Creates natural brightness decay
Mimics real string physics
Feedback: Represents energy conservation
Higher decay = less energy loss = longer sustain
Lower decay = more damping = shorter decay
Excitation: Original audio as "pluck"
Transients excite the resonator
Sustained sections create continuous excitation
Technical Implementation
Praat Formula Construction
Step-by-step formula assembly:
Parameters & Controls
Core Resonance Parameters
| Parameter | Type | Range | Default | Description |
|---|---|---|---|---|
| Ks_Base_Freq | positive | 20-2000 Hz | 220 Hz | Fundamental resonance frequency |
| Ks_Decay | real | 0.5-0.99 | 0.95 | Resonance sustain length |
| Ks_Mix | real | 0.0-1.0 | 0.5 | Dry/wet balance |
Pitch Modulation Parameters
| Parameter | Type | Range | Default | Description |
|---|---|---|---|---|
| Ks_Mod_Rate | positive | 0.1-20.0 Hz | 0.5 Hz | Pitch modulation speed |
| Ks_Mod_Depth | real | 0.0-24.0 | 12.0 | Pitch modulation intensity in semitones |
Output Parameters
| Parameter | Type | Range | Default | Description |
|---|---|---|---|---|
| Play_result | boolean | 0/1 | 1 | Auto-play after processing |
Parameter Effects Guide
20-100 Hz: Sub-bass resonance, string bass
100-300 Hz: Bass/mid resonance, guitar range
300-800 Hz: Mid-range, vocal formant area
800-2000 Hz: High resonance, metallic textures
>2000 Hz: Very high, potentially aliasing
Ks_Decay (0.5-0.99):
0.50-0.70: Very short, percussive plucks
0.70-0.85: Medium decay, typical strings
0.85-0.95: Long sustain, bowed effects
0.95-0.99: Very long, near-infinite sustain
>0.99: Risk of feedback instability
Ks_Mod_Rate (0.1-20.0 Hz):
0.1-1.0 Hz: Slow, obvious sweeps
1.0-5.0 Hz: Medium, vibrato-like
5.0-10.0 Hz: Fast, intense modulation
10.0-20.0 Hz: Very fast, potentially chaotic
Ks_Mod_Depth (0.0-24.0 semitones):
0.0-1.0: Subtle pitch variation
1.0-6.0: Moderate detuning effects
6.0-12.0: Strong pitch bends
12.0-24.0: Extreme, octave+ modulation
Parameter Interactions
How Parameters Affect Each Other
Key relationships and combinations:
Low freq + high decay = deep, rumbling bass
High freq + high decay = shimmering, metallic sustains
Low freq + low decay = punchy, short bass plucks
High freq + low decay = bright, percussive chimes
Mod_Rate × Mod_Depth:
Slow rate + high depth = dramatic pitch sweeps
Fast rate + low depth = subtle vibrato
Fast rate + high depth = intense pitch distortion
Slow rate + low depth = barely noticeable variation
Mix × All Parameters:
Low mix (0.1-0.3): Subtle enhancement
Medium mix (0.4-0.6): Balanced effect
High mix (0.7-0.9): Dominant processing
Very high mix (1.0): Complete transformation
Applications
String Instrument Emulation
Use case: Adding string-like characteristics to non-string sources
Technique: Use mid-range frequencies (100-400 Hz) with medium decay
Examples: Vocal to cello, drum hits to pizzicato, synth to string ensemble
Sound Design and Effects
Use case: Creating unique synthetic textures and sci-fi effects
Technique: Extreme modulation settings with high mix amounts
Results: Warp drives, alien communications, futuristic interfaces
Percussive Enhancement
Use case: Adding resonance and sustain to percussive sounds
Technique: Tune to fundamental frequency of drum sounds
Applications: Tom resonance, kick drum body, snare ring control
Experimental Music
Use case: Creating complex, evolving textures from simple sources
Technique: Process already-processed material multiple times
Results: Granular-like textures, spectral smearing, time-stretched effects
Practical Workflow Examples
🎻 Vocal to String Transformation
Goal: Transform vocal phrases into cello-like textures
Settings:
- Base_Freq: 220 Hz (cello A string)
- Decay: 0.88 (medium sustain)
- Mod_Rate: 0.5 Hz (subtle vibrato)
- Mod_Depth: 0.3 (very subtle)
- Mix: 0.7 (strong effect)
Result: Vocal phrases with rich string-like resonance and sustain
🥁 Drum Resonance Enhancement
Goal: Add body and resonance to drum samples
Settings:
- Base_Freq: Match drum fundamental (60-120 Hz for kicks)
- Decay: 0.82 (quick but noticeable)
- Mod_Rate: 0.1 Hz (barely moving)
- Mod_Depth: 0.1 (minimal)
- Mix: 0.3-0.4 (subtle enhancement)
Result: Drums with enhanced low-end body and natural sustain
🚀 Sci-Fi Engine Design
Goal: Create evolving spaceship engine sounds
Settings:
- Base_Freq: 180 Hz (engine rumble)
- Decay: 0.96 (long, evolving)
- Mod_Rate: 0.8 Hz (slow sweep)
- Mod_Depth: 8.0 (noticeable pitch variation)
- Mix: 0.9 (dominant effect)
Result: Complex, evolving engine textures with pitch sweeps
Advanced Techniques
- Multiple passes: Apply different frequency settings sequentially
- Frequency sweeping: Automate base frequency over time
- Extreme settings: Push parameters beyond normal ranges for experimental results
- Source manipulation: Pre-process audio before Karplus-Strong application
Layer multiple processed versions for complex, evolving textures
- Tuning: Set base frequency to musical notes for harmonic results
- Rhythm: Use rhythmic sources to create patterned resonances
- Texture: Process noise sources for complex, evolving beds
- Space: Combine with reverb for atmospheric, spatial effects
Troubleshooting Common Issues
Cause: High decay values with certain frequency combinations
Solution: Reduce decay to 0.85-0.95 range, adjust base frequency
Cause: Extreme modulation depths or very high base frequencies
Solution: Reduce modulation depth, lower base frequency below 1000 Hz
Cause: Low mix amount or inappropriate source material
Solution: Increase mix to 0.6-0.8, use more transient-rich sources
Cause: Very low base frequencies creating long delay lines
Solution: Use higher base frequencies (>80 Hz) for faster processing
Technical Reference
Algorithm Performance Characteristics
| Aspect | Characteristic | Impact |
|---|---|---|
| Computational Complexity | O(N) per sample | Linear with duration |
| Memory Usage | O(sr/min_freq) | Depends on lowest frequency |
| Processing Speed | Medium | Faster than convolution, slower than filters |
| Real-time capability | Yes (with optimization) | Suitable for real-time implementation |
| Quality Factors | Sample-rate dependent | Higher SR = better high-frequency response |
Physical Modeling Accuracy
ACCURATE:
- Harmonic series generation
- Brightness decay over time
- Pitch determination by length
- Plucked string transient character
SIMPLIFIED:
- Ideal string (no stiffness variation)
- Perfect termination (no body resonance)
- Linear decay (no complex damping)
- Single excitation model
ENHANCED IN THIS VERSION:
- Dynamic pitch control (not in original)
- Audio input processing (original used noise)
- Dry/wet mixing flexibility
Historical Context and Impact
📜 Algorithm Evolution
1983: Original Karplus-Strong paper published — revolutionizes physical modeling
1980s-90s: Widespread adoption in computer music and commercial synthesizers
2000s: Extended and refined versions developed (extended Karplus-Strong)
This work: First adaptation as real-time audio effect processor in Praat
Significance: Demonstrates classic synthesis algorithms can become powerful effects