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.
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.
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
- 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.
- Choose a reverb Preset and Randomize depth.
- For manual operation, set Duration and Transpose.
- Enable Edit reverb / render details to change internal/output rates, reverb values, Output peak, or Random seed.
- Run the script. The final result is a stereo Sound; optional process visualization and playback follow.
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.
| Measurement | Mapping used by v2.4.2 |
|---|---|
| Duration | Input Sound duration replaces the manual Duration. |
| Mean pitch / root | Converted 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 anchors | Praat 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 centroid | Mapped to reverb/high stereo cutoff from 2000 to 8000 Hz. |
| RMS | Log-mapped to excitation velocity 0.30–0.95 and inversely to wet percentage: louder input becomes more forceful and drier. |
| Early/late RMS decay | Produces a decay exponent, then maps to Decay base and Tail duration; Impulse duration becomes 1.3 × Tail duration. |
| Three-zone RMS envelope | Classifies 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.
SATB generation
Without multi-anchor analysis, MIDI notes are drawn from these default ranges before manual or detected pitch-class transposition:
| Voice | Default MIDI range |
|---|---|
| Bass | 40–55 |
| Tenor | 52–64 |
| Alto | 53–72 |
| Soprano | 60–84 |
Across the whole chord, the script also draws:
- Strings per note: 1–3.
- Detune: 0.1–2.5 Hz.
- Body resonance amount: 0.2–0.95.
- Velocity: random 0.4–0.95 in manual mode, or analysis-derived when a Sound controls the patch.
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.
→ 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.
| Mode | Depth | Effect |
|---|---|---|
| None | 0.0 | Uses the base per-note formulas for strike position, damping, stiffness, excitation and body-mode parameters. |
| Subtle | 0.3 | Applies moderate stochastic perturbation to string character, excitation, bridge-coupling safety factor, and the eight soundboard modes. |
| Wild | 1.0 | Uses the full perturbation ranges, producing much larger variation among strings and body responses. |
Eight-mode soundboard model
After the four waveguide voices are averaged, the mono master is processed through eight parallel second-order resonators.
| Base mode | Frequency | Bandwidth | Gain |
|---|---|---|---|
| 1 | 65 Hz | 7 Hz | .42 |
| 2 | 130 Hz | 13 Hz | .34 |
| 3 | 210 Hz | 22 Hz | .26 |
| 4 | 340 Hz | 36 Hz | .19 |
| 5 | 560 Hz | 60 Hz | .13 |
| 6 | 950 Hz | 100 Hz | .08 |
| 7 | 1800 Hz | 175 Hz | .05 |
| 8 | 3200 Hz | 320 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:
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
| Preset | Tail | IR | Density | Decay base | Wet |
|---|---|---|---|---|---|
| Subtle | 1.5 s | 2.0 s | 1200/s | 150 | 35% |
| Medium | 2.0 s | 3.0 s | 2000/s | 110 | 50% |
| Heavy | 3.0 s | 4.5 s | 3000/s | 80 | 65% |
| Extreme | 4.5 s | 6.5 s | 4500/s | 50 | 80% |
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
| Control | Default | Meaning |
|---|---|---|
| Use selected sound | on | If one Sound is selected, use its analyses as synthesis/reverb controllers. If no Sound is selected, continue with manual settings. |
| Duration | 8.0 s | Manual chord duration. Replaced by selected-Sound duration when analysis succeeds. |
| Transpose | 0 semitones | Manual range shift, or analysis-derived pitch-class shift when fewer than two anchors are found. |
| Preset | Medium Decay | Custom, Subtle, Medium, Heavy, or Extreme reverb family. |
| Randomize depth | Subtle | None / Subtle / Wild additional model-character variation. May be overridden by HNR analysis. |
| Edit reverb / render details | off | Opens technical rate, reverb, level and seed controls. |
| Draw visualization | on | Draws the process/QC view. |
| Play result | on | Plays the final stereo result. |
Reverb / Render Details
| Control | Default | Meaning |
|---|---|---|
| Internal waveguide rate | 12000 Hz | Sample rate of the waveguide and soundboard engine. |
| Final output rate | 44100 Hz | Rate after resampling and for stereo/reverb processing. |
| Tail duration | 2.0 s | Silence appended to the dry stereo signal before convolution/mixing. |
| Impulse duration | 3.0 s | Nominal left Poisson IR duration; right uses 0.93×. |
| Poisson density | 2000 events/s | Nominal left event density; right uses 0.95×. |
| Decay base | 110 | Controls exponential IR decay. |
| Low / High cutoff | 100 / 4000 Hz | Wet-channel Hann-band filter region; right uses slightly modified values. |
| Filter smoothing | 100 Hz | Wet reverb band-filter transition width. |
| Wet mix | 50% | Wet percentage; dry percentage is 100 minus Wet. |
| Fadeout duration | 1.2 s | Cosine fade applied to the end of the final wet+dry channels. |
| Output peak | .98 | Final stereo target peak normalization. |
| Random seed | 0 | 0 = unpredictable; positive integer = repeatable random sequence for the complete stochastic realization. |
Validation and runtime guards
Core parameter ranges
- Duration: >0 to 120 s.
- Internal rate: 8000–96000 Hz.
- Final rate: 8000–192000 Hz.
- Transpose: −12 to +12 semitones.
- Poisson density: >0 to 20000 events/s before preset/analysis overrides.
- Wet mix: 0–100%.
- Output peak: >0 to 1.
- Random seed: 0 or positive.
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:
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:
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 stereo normalization
After left/right wet+dry mixing and fadeout, the two channels are combined to stereo and one final:
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.