Waveguide Klangmaschine — v2.4.2 User Guide

Generates a stochastic SATB chord with a tuned multi-string digital waveguide, an eight-mode soundboard model, overlapping spectral-split stereo, and independent left/right Poisson-convolution reverb. An optional selected Sound can act as an analysis controller for duration, pitch region, randomization depth, excitation force, and reverb behavior.

Author: Shai Cohen Affiliation: Department of Music, Bar-Ilan University, Israel Version: 2.4.2 (2026) License: MIT License Repo: Praat AudioTools
Contents:

What this does

The script creates a new four-voice SATB chord. Each voice is synthesized by one to three detuned digital-waveguide strings. The four voices are summed, processed through a global eight-resonator soundboard model, resampled to the requested output rate, split into overlapping left/right spectral bands, and finally passed through two independently generated convolution reverbs.

Signal flow:
SATB note selection → per-voice multi-string waveguides → four-voice sum → 8-mode soundboard → internal normalization / fade → resample → overlapping spectral split → independent L/R convolution reverb → wet/dry mix → joint stereo target normalization

If Use selected sound is enabled and one Sound is selected, that Sound is analyzed only. Its waveform is not mixed into the Klangmaschine output. Analysis measurements instead modify synthesis and reverb parameters.

Quick start

  1. Run the script with no selected Sound for a manually controlled stochastic SATB realization, or select one Sound and leave Use selected sound enabled to derive controller parameters from it.
  2. Choose a reverb Preset and Randomize depth.
  3. For manual operation, set Duration and Transpose.
  4. Enable Edit reverb / render details to change internal/output rates, reverb values, Output peak, or Random seed.
  5. Run the script. The final result is a stereo Sound; optional process visualization and playback follow.
The default internal waveguide rate is 12000 Hz in v2.4.2. This is intentional: the analysis path can transpose the manual soprano range upward far enough that the previous 11025 Hz default violated the model's minimum eight-samples-per-string-period requirement.

Selected-Sound analysis

When exactly one Sound is selected and Use selected sound is enabled, the analysis pipeline replaces several manual or stochastic controller values.

MeasurementMapping used by v2.4.2
DurationInput Sound duration replaces the manual Duration.
Mean pitch / rootConverted to MIDI. Its pitch class becomes the shortest signed shift from the C-reference ranges when fewer than two distinct pitch-track anchors are available.
Pitch-track anchorsPraat F0 is sampled at eight time positions. Distinct anchors separated by at least three semitones are collected, up to four. This is a monophonic pitch-track heuristic, not simultaneous polyphonic pitch detection.
HNR>15 dB → None; 5–15 dB → Subtle; <5 dB → Wild randomization depth.
Spectral centroidMapped to reverb/high stereo cutoff from 2000 to 8000 Hz.
RMSLog-mapped to excitation velocity 0.30–0.95 and inversely to wet percentage: louder input becomes more forceful and drier.
Early/late RMS decayProduces a decay exponent, then maps to Decay base and Tail duration; Impulse duration becomes 1.3 × Tail duration.
Three-zone RMS envelopeClassifies the source approximately as Percussive, Swell, ADSR, Sustained/drone, or Steady and selects the corresponding reverb preset family.

How pitch anchors affect SATB ranges

With two or more distinct anchors, the anchors are sorted low-to-high and used to construct voice ranges of approximately ±5 semitones, then clamped to broad physical SATB limits. No second transposition is added after this absolute-range placement.

With zero or one anchor, the standard manual ranges remain in place and the detected pitch class shifts them by the shortest signed interval from C. This can move the soprano range upward; the Internal-rate safety check is evaluated after that shift.

The preset selected from envelope shape does not erase all analysis-derived reverb values. After preset assignment, v2.4.2 restores the analyzed high cutoff, wet mix, decay base, tail duration, and impulse duration. The preset still supplies Poisson density, low cutoff, smoothing, fadeout, and the character label.

SATB generation

Without multi-anchor analysis, MIDI notes are drawn from these default ranges before manual or detected pitch-class transposition:

VoiceDefault MIDI range
Bass40–55
Tenor52–64
Alto53–72
Soprano60–84

Across the whole chord, the script also draws:

Each voice then receives a small ±0.05 velocity variation and an independent onset micro-delay from 0 to 30 ms.

Waveguide string model

Each active string runs sample-by-sample at the Internal waveguide rate. The loop contains a fractional-delay allpass, a stiffness-dispersion allpass, one-pole damping, loop feedback, and a small stability-derived bridge-feedback term.

excitation → delay read
→ fractional-delay allpass
→ stiffness allpass
→ one-pole damping
→ loop gain + bridge feedback
→ delay-line write / pickup

Phase-compensated tuning

Version 2.4 no longer uses a fixed half-sample correction. For each target string frequency, the script estimates the phase delay contributed by the stiffness allpass and loop low-pass at that F0. It then solves the remaining fractional delay with a first-order allpass so that the total loop phase delay predicts the requested frequency.

The visualization and QC retain the predicted tuning error in cents for each voice.

Excitation and string geometry

The excitation is a short half-sine pulse whose amplitude and spectral shape depend on voice velocity. Contact time shortens for high notes. Strike position, pickup position, damping, stiffness, and excitation parameters can be perturbed by Randomize depth.

For two or three strings, frequency offsets are distributed around the voice fundamental. The outer three-string voices use f-detune, f, and f+detune.

Randomization depth

Randomize depth controls the additional character variation, not whether the whole patch is stochastic.

ModeDepthEffect
None0.0Uses the base per-note formulas for strike position, damping, stiffness, excitation and body-mode parameters.
Subtle0.3Applies moderate stochastic perturbation to string character, excitation, bridge-coupling safety factor, and the eight soundboard modes.
Wild1.0Uses the full perturbation ranges, producing much larger variation among strings and body responses.
None is not deterministic. MIDI notes, strings-per-note, detune, body-resonance amount, voice onset delays, and several other patch-level choices are still randomized. For repeatable complete realizations, set Random seed to a positive integer.

Eight-mode soundboard model

After the four waveguide voices are averaged, the mono master is processed through eight parallel second-order resonators.

Base modeFrequencyBandwidthGain
165 Hz7 Hz.42
2130 Hz13 Hz.34
3210 Hz22 Hz.26
4340 Hz36 Hz.19
5560 Hz60 Hz.13
6950 Hz100 Hz.08
71800 Hz175 Hz.05
83200 Hz320 Hz.025

Subtle/Wild modes randomize each mode's frequency, bandwidth, and gain. The actual randomized body is then validated: its highest mode must remain below 45% of the Internal waveguide rate. The script rejects an unsafe body rather than silently moving a resonant frequency.

The soundboard output is the direct string sum at gain .25 plus the eight resonator outputs scaled by the chord's randomized Body resonance amount.

Spectral-split stereo stage

After the internal mono model is normalized and resampled to Final output rate, two overlapping filtered copies are created:

Left = Hann pass band 20 ... 3000 Hz
Right = Hann pass band 150 ... HighCutoff Hz
transition smoothing = 100 Hz

The two filtered copies are combined as left and right channels. This is spectral separation, not position panning; the large overlap intentionally preserves shared mid-band energy.

When audio analysis is active, spectral centroid controls High cutoff between 2000 and 8000 Hz. Otherwise the Details/preset value is used.

Independent-L/R Poisson convolution reverb

The reverb is stereo because the left and right channels receive different independently generated impulse responses. It is not four-IR true-stereo convolution.

Left IR

A Poisson point process is converted to a pulse-train Sound, multiplied by an exponential decay and a mild sinusoidal/chirp modulation, convolved with the left dry channel, then Hann-band filtered.

Right IR

The right process is deliberately decorrelated: IR duration is 0.93×, density 0.95×, decay base 0.95×, and the pulse-train and modulation/filter constants differ slightly from the left side.

Wet scaling and mix

The two wet channels are scaled jointly using the larger of their peaks, so their relative left/right level is preserved. They are then mixed with the corresponding extended dry channels according to Wet mix. A final cosine fade is applied over the requested Fadeout duration.

Preset values

PresetTailIRDensityDecay baseWet
Subtle1.5 s2.0 s1200/s15035%
Medium2.0 s3.0 s2000/s11050%
Heavy3.0 s4.5 s3000/s8065%
Extreme4.5 s6.5 s4500/s5080%

Custom uses the Details-page values. With selected-Sound analysis, the chosen preset still sets density, low cutoff, smoothing and fadeout, but the analyzed high cutoff, wet mix, decay base, tail and IR duration are restored afterward.

Controls

Main page

ControlDefaultMeaning
Use selected soundonIf one Sound is selected, use its analyses as synthesis/reverb controllers. If no Sound is selected, continue with manual settings.
Duration8.0 sManual chord duration. Replaced by selected-Sound duration when analysis succeeds.
Transpose0 semitonesManual range shift, or analysis-derived pitch-class shift when fewer than two anchors are found.
PresetMedium DecayCustom, Subtle, Medium, Heavy, or Extreme reverb family.
Randomize depthSubtleNone / Subtle / Wild additional model-character variation. May be overridden by HNR analysis.
Edit reverb / render detailsoffOpens technical rate, reverb, level and seed controls.
Draw visualizationonDraws the process/QC view.
Play resultonPlays the final stereo result.

Reverb / Render Details

ControlDefaultMeaning
Internal waveguide rate12000 HzSample rate of the waveguide and soundboard engine.
Final output rate44100 HzRate after resampling and for stereo/reverb processing.
Tail duration2.0 sSilence appended to the dry stereo signal before convolution/mixing.
Impulse duration3.0 sNominal left Poisson IR duration; right uses 0.93×.
Poisson density2000 events/sNominal left event density; right uses 0.95×.
Decay base110Controls exponential IR decay.
Low / High cutoff100 / 4000 HzWet-channel Hann-band filter region; right uses slightly modified values.
Filter smoothing100 HzWet reverb band-filter transition width.
Wet mix50%Wet percentage; dry percentage is 100 minus Wet.
Fadeout duration1.2 sCosine fade applied to the end of the final wet+dry channels.
Output peak.98Final stereo target peak normalization.
Random seed00 = unpredictable; positive integer = repeatable random sequence for the complete stochastic realization.

Validation and runtime guards

Core parameter ranges

Waveguide temporal-resolution guard

The highest possible string in the active SATB ranges is checked before rendering. The check includes the maximum +2.5 Hz outer-string detune and requires at least eight Internal-rate samples per string period:

InternalRate / HighestPossibleStringFrequency ≥ 8

If the condition fails, the script prints the minimum required Internal rate and exits. The v2.4.2 default of 12000 Hz was chosen specifically to cover the legitimate single-anchor analysis path that can shift the soprano range as high as MIDI 90.

Soundboard-rate guard

After Randomize depth has produced the actual eight body-mode frequencies, the highest mode must remain below 45% of Internal rate.

Final reverb workload guards

Version 2.4.1 added workload checks after all preset and analysis overrides, but before allocating the tail or IR Sounds:

extended output ≤ 30,000,000 samples per channel
each IR ≤ 12,000,000 samples
expected Poisson events ≤ 250,000 per channel

If a Custom configuration exceeds a limit, the script exits with an approximate maximum Tail duration, Impulse duration, or Density appropriate to the current render rate.

Duration and normalization

Internal dry stage

After the soundboard model, the internal mono signal is peak-scaled to .88, then receives an approximately 60 ms linear fade-out before Sound creation and resampling.

Final duration

The dry stereo chord is extended by Tail duration before convolution. The final result is trimmed to:

final duration = chord duration + Tail duration

Final stereo normalization

After left/right wet+dry mixing and fadeout, the two channels are combined to stereo and one final:

Scale peak: OutputPeak

This is joint stereo target normalization. It does not normalize left and right independently, so the spectral split and reverb balance are preserved. It is also not a down-only ceiling: a non-silent output can be raised or lowered to reach the requested peak.

Visualization and QC

Version 2.4 replaces the old decorative two-panel display with a process-oriented visualization.

A — SATB string realization

Shows the four realized voices and their string geometry, including hammer/strike position, pickup position, strings-per-note and detune.

B — Representative waveguide loop

Uses the realized Tenor as a representative loop and displays target period, phase-compensated core delay, damping, stiffness and feedback.

C — Exact soundboard transfer model

Plots the normalized frequency response of the actual eight randomized resonators and marks their realized mode frequencies.

D — Realized Poisson reverb

Shows the left IR decay reference together with a decimated display of actual generated Poisson event times. The text reports actual L/R event counts, target density, Decay base and Wet percentage.

E — Measured stereo output

Draws the final left and right waveforms on the same −1…1 amplitude scale and reports measured peak, RMS and Final output rate.

QC strip

The bottom strip summarizes the realized chord, Internal rate and maximum predicted tuning error, eight-mode body amount, reverb preset/wet percentage, stereo architecture, Random seed and measured final peak.