Waveguide Klangmaschine — v2.0 User Guide

Generates a randomised SATB chord using digital waveguide synthesis with per‑string allpass fractional delay, stiffness dispersion, LP damping, and bridge coupling — processed through an 8‑mode soundboard resonator bank, spectral‑split stereo imaging, and a true‑stereo Poisson‑process spectral decay reverb. Each run produces a unique, playable chord with deep three‑layer randomisation.

Author: Shai Cohen Affiliation: Department of Music, Bar‑Ilan University, Israel Version: 2.0 (2025) License: MIT License Repo: GitHub
Contents:

What this does

Waveguide Klangmaschine is a physical modelling synthesis engine that generates a randomised SATB chord with rich, piano‑like timbre. Each run produces a unique chord by randomising:

Synthesis architecture (based on OpenPiano by Michele Perrone):
  • Excitation: velocity‑shaped half‑sine pulse with Chaigne‑inspired contact time scaling for high notes.
  • String loop: allpass fractional delay → allpass stiffness dispersion → one‑pole LP damping → loop gain.
  • Multi‑string unison (1–3 strings with detune + beating).
  • Stability‑derived bridge coupling (auto‑safe per note).
  • DC blocker on summed string output.
  • 8‑resonator soundboard (65–3200 Hz, randomised modes).
  • Spectral‑split stereo (LP left / HP right, overlapping).
  • Poisson‑process convolution reverb with decorrelated L/R impulse responses.

Quick start

  1. In Praat, run the script Waveguide_Klangmaschine.praat (no input selection needed).
  2. Set Duration_s (e.g., 8 seconds).
  3. Adjust Internal_rate (default 5512.5 Hz – lower = faster, less high frequencies).
  4. Choose a Randomize_depth:
    • None – standard piano waveguide (deterministic, repeatable).
    • Subtle – slight per‑voice variation (ensemble character).
    • Wild – imaginary instrument space (extreme, experimental).
  5. Select a Reverb preset (Subtle, Medium, Heavy, Extreme) or Custom.
  6. Click OK. The script generates a random SATB chord, processes it through the waveguide engine, applies reverb, and creates a stereo Sound object named Random_Klang_Stereo_spectral_preset.
Tip: Start with None randomisation to hear the core physical model, then try Subtle for ensemble variation. The Info window prints the generated MIDI notes and randomised parameters – note the seed for reproducibility (though the script does not expose a fixed seed parameter).
Important: This script is computationally intensive. The waveguide runs at a low internal rate (default 5512.5 Hz) then resamples to 44.1 kHz. For a 8‑second chord with 4 voices × 3 strings, processing takes 10–30 seconds. The reverb convolution adds additional time.

Physical model architecture

Digital waveguide string (per voice, per string):
Excitation → Delay line → Fractional delay allpass → Stiffness allpass → One‑pole LP → Loop gain → Feedback
Bridge coupling: bridge_in = coupling × bridge_prev
DC blocker: y[n] = x[n] - x[n-1] + R × y[n-1] (R = 0.995)

Key components

Three‑layer randomisation

🎲 Randomization depth control

The Randomize_depth parameter controls three independent layers of variation:

  • None (depth=0): Deterministic, repeatable – standard piano waveguide.
  • Subtle (depth≈0.3): Slight per‑voice variation – ensemble character (different “instruments” for each voice).
  • Wild (depth≈1.0): Extreme variation – imaginary instrument space, from near‑harmonic to bell‑like, bright to dark, short to long contact times.

Layer 1 – Per‑voice string character

Each of the four voices (Bass, Tenor, Alto, Soprano) gets its own:

At Subtle depth, these vary ±20–30%. At Wild depth, they can vary by factors of 0.3–3.0, creating dramatically different “instruments” per voice.

Layer 2 – Instrument body (soundboard)

The 8 soundboard resonators (65, 130, 210, 340, 560, 950, 1800, 3200 Hz) each have randomised:

At Wild depth, the soundboard becomes a completely different radiating structure each run.

Layer 3 – Excitation physics

Global excitation parameters (hammer amplitude, brightness exponent, contact time) are randomised per run, with the same depth scaling as Layer 1.

Parameters & defaults

Basic synthesis

ParameterRangeDefaultDescription
Duration_sany positive8.0
Internal_rate100–220505512.5
Final_rateany positive44100
Transpose_semitones-36–360

Randomisation

ParameterOptionsDefaultDescription Randomize_depthNone / Subtle / WildSubtle。

Reverb (Spectral Decay)

The reverb section uses the same engine as Spectral_Decay_Reverb.praat – see separate guide for details.

ParameterRangeDefaultDescription
PresetCustom / Subtle / Medium / Heavy / ExtremeMedium
Tail_duration_spositive2.0
Impulse_duration_spositive3.0
Poisson_densitypositive2000
Decay_basepositive110
Low_cutoff_Hz / High_cutoff_Hzpositive100 / 4000
Wet_dry_percent0–10050

Spectral decay reverb (true stereo)

🔊 True‑stereo convolution reverb

The reverb engine generates two decorrelated impulse responses (Poisson process, exponential decay, chirp modulation) – one for the left channel, one for the right. This creates a natural, wide stereo image even with mono input. The reverb is applied after the waveguide synthesis and spectral‑split stereo processing.

Key IR parameters:

  • Poisson point process – sparse impulses simulating reflections.
  • Exponential decay envelope (decay_base^(-t/impulse_dur)).
  • Chirp modulation (1 + 0.7·sin(2π·t·150 + t·20)) for evolving texture.
  • Hann bandpass filter to focus reverb on 100–4000 Hz.

The reverb is applied to the final stereo signal after all waveguide processing. The right channel uses slightly different parameters (duration ×0.93, density ×0.95, decay ×0.95, etc.) for decorrelation.

Visualization (Mondrian‑style + reverb panel)

The script draws a two‑panel visualisation:

Tip: The Mondrian panel is a visual fingerprint of the chord – each run produces a different geometric arrangement. The note labels are placed inside the coloured blocks.

FAQ / troubleshooting

Processing is very slow (30–60 seconds)

The waveguide model runs a sample‑by‑sample loop at internal_rate (default 5512.5 Hz). For 8 seconds, that’s about 44,000 iterations × 4 voices × up to 3 strings = ~500,000 loop passes. Each pass includes allpass filters, LP filters, and delay line management. This is normal. Reduce Duration_s or increase Internal_rate (lower internal rate = faster but lower high‑frequency content).

Output sounds distorted / clipping

The output is normalised to 0.88 peak (dry) and 0.95 after reverb. If clipping occurs, reduce Velocity (not directly adjustable; re‑run to get a lower random velocity) or lower Resonance (body resonance). The script prints the generated velocity in the Info window.

Reverb sounds metallic / ringy

The spectral decay reverb uses a Poisson‑based IR with chirp modulation. If it sounds too ringy, increase Poisson_density (smoother), reduce Decay_base (shorter decay), or lower Wet_dry_percent. For a more natural reverb, try the Subtle preset.

MIDI ranges

The script randomises notes within fixed ranges:

  • Bass: 40–55 (E2–G#3)
  • Tenor: 52–64 (E3–E4)
  • Alto: 53–72 (F3–C5)
  • Soprano: 60–84 (C4–C6)

These can be edited in the script (lines near the top of the voice loop).

Reproducibility

The script uses Praat’s randomUniform and randomInteger without a fixed seed. To reproduce a specific chord, note the printed parameters (MIDI notes, velocity, strings, detune, resonance) and manually set them by editing the script (or re‑run until you get the same combination – not guaranteed). Future versions may add a seed parameter.

Based on OpenPiano

The waveguide core is adapted from Michele Perrone’s OpenPiano (AGPL‑3.0). The Praat implementation uses the same delay‑line + allpass + LP structure, with additional randomisation layers, soundboard resonators, and spectral‑split stereo.