Flute KlattGrid Serial Melody — User Guide
KlattGrid flute synthesis with dodecaphonic melody and serial rhythm derived from the tone row. Generates a 12‑tone row, applies the chosen row form (Prime, Inversion, Retrograde, Retrograde‑Inversion), derives note durations from pitch‑class intervals, and synthesises a realistic flute note for each row element using layered chiff attacks and formant tracking.
What this does
Flute KlattGrid Serial Melody synthesises a dodecaphonic (12‑tone) melody using Praat’s KlattGrid physical modelling synthesis engine. The system:
- Generates a 12‑tone row starting from a user‑chosen pitch (frequency).
- Applies the selected row form (Prime, Inversion, Retrograde, Retrograde‑Inversion).
- Derives a serial rhythm – each note’s duration is proportional to the pitch‑class interval between successive row notes (small interval = short note, large = long).
- Synthesises each note using a KlattGrid model with formants tracking the note frequency, vibrato, and layered chiff attacks (broadband turbulence, sub‑tone sweep, high‑frequency frication).
- Concatenates the 12 notes with legato crossfades to create a seamless melody.
- Chiff A – broadband turbulence burst (~40 ms, filtered noise).
- Chiff B – sub‑tone pitch sweep (60% → 100% of note frequency over ~130 ms).
- Chiff C – high‑frequency frication edge (~30 ms, filtered noise).
Quick start
- In Praat, run the script
Flute_KlattGrid.praat(no sound selection needed – the script generates its own audio). - Set Frequency_Hz – the starting pitch of the tone row (e.g., 523.25 Hz = C5).
- Choose a Row_form (Prime, Inversion, Retrograde, Retrograde‑Inversion).
- Adjust Min_IOI_s and Max_IOI_s – the range of note durations derived from intervals.
- Set Duration_scale – overall time scaling factor (2.5 = all notes 2.5× longer).
- Optionally adjust flute body parameters (Open_phase, Vibrato_rate_Hz, Vibrato_depth_st, amplitude levels).
- Click OK. The script generates the 12‑tone row, synthesises the melody, and creates a Sound object named
flute_serial_melody(orflute_XHzif melody mode is off).
KlattGrid synthesis, which is computationally intensive. Generating a 12‑note melody takes 5–10 seconds. The synthesis is entirely in Praat – no Python required.
12‑tone row generation
🎼 All‑interval row (Webern Op.24 style)
The base row (pitch classes, 0=C) is:
This is an all‑interval row – each adjacent interval (in semitones) appears exactly once. It is then transposed so that the first pitch class matches the user’s starting pitch (from Frequency_Hz).
Row forms:
- Prime (P0) – the transposed row as is.
- Inversion (I0) – each pitch class reflected around the root pitch.
- Retrograde (R0) – the row played backward.
- Retrograde‑Inversion (RI0) – inversion then retrograde.
After the row form is applied, each pitch class is assigned to a MIDI note in a playable flute range (C4–F#6, MIDI 60–90). Voice‑leading rules are applied: each note is placed within one octave of the previous note, minimising leaps.
Serial rhythm derivation
interval = (pitch_class[i+1] - pitch_class[i] + 12) mod 12(interval 0 is treated as 6 – tritone)
IOI = min_IOI_s + (interval - 1) / 10 × (max_IOI_s - min_IOI_s)Then all durations are multiplied by
duration_scale.
This creates a natural relationship between melodic motion and rhythm: small intervals (e.g., semitone, whole tone) produce short notes; large intervals (e.g., fifth, seventh) produce long notes. The rhythm row is printed in the Info window alongside the pitch row.
Flute synthesis (KlattGrid)
Each note is synthesised using a KlattGrid object with parameters adapted to the note’s frequency:
- Formants – F1 tracks the note frequency, F2 = 2× frequency, F3 = 3.5×, F4 = 5.5×, F5 = 8×. Bandwidths scale proportionally.
- Pitch envelope – first note: gentle sag (97% → 99% → 100%) over attack/stabilise; legato notes: on‑pitch immediately.
- Vibrato – sinusoidal pitch modulation (rate:
vibrato_rate_Hz, depth:vibrato_depth_stsemitones). Amplitude modulation (3% depth) is also applied. - Voicing amplitude – first note: ramp up from silence over attack/stabilise; legato notes: full sustain from start (crossfade handles blending).
- Aspiration / breathiness – controlled by separate amplitude envelopes.
After synthesis, each note is filtered with a Hann bandpass (80–7000 Hz) to remove low‑frequency noise.
Chiff layers (attack transients)
Only the first note of the melody includes chiff layers – legato notes start at full sustain with no chiff (the crossfade blends them smoothly). The three chiff layers are:
- Chiff A – broadband turbulence burst
Gaussian noise, filtered to [0.7×freq, 4×freq], amplitude envelope: exponential decay over 20 ms.
amp = 0.06(adjustable). - Chiff B – sub‑tone pitch sweep
A second KlattGrid tone that sweeps from 60% to 100% of the note frequency over 60 ms, then decays.
amp = 0.04(adjustable). - Chiff C – high‑frequency frication edge
Gaussian noise, filtered to [2000 Hz, 9000 Hz], exponential decay over 15 ms.
amp = 0.02(adjustable).
The three chiff layers are mixed with the main tone and scaled to avoid clipping.
Parameters & defaults
Mode & pitch
| Parameter | Range | Default | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Melody_mode | yes/no | yes | 。|||||||||
| Frequency_Hz | 20–5000 | 523.25 | 。|||||||||
| Base_octave | 3–6 | 5 | 。|||||||||
| Row_form | Prime / Inversion / Retrograde / Retrograde‑Inversion | Prime | 。
Serial rhythm
| Parameter | Range | Default | Description | |||||
|---|---|---|---|---|---|---|---|---|
| Min_IOI_s | 0.05–0.5 | 0.15 | 。||||||
| Max_IOI_s | 0.5–3.0 | 1.20 | 。||||||
| Duration_scale | 0.5–5.0 | 2.5 | 。
Flute body
Chiff & output
Visualization (Praat picture)
When Draw_visualization = 1, the script draws a 4‑panel figure:
- Waveform – the complete melody (or single note).
- Spectrum – average power spectrum (0–5000 Hz), showing the harmonic structure of the synthesized flute.
- Spectrogram – time‑frequency representation (up to 6000 Hz or 14× the root frequency).
- Row summary – the pitch class sequence and IOI values (melody mode only).
FAQ / troubleshooting
The script applies legato crossfades (cosine fades, 50 ms overlap). If clicks persist, increase xfade_s (hardcoded to 0.05 s) in the script. Legato notes start at full amplitude (no attack), so the crossfade should be smooth.
Adjust Chiff_A_amp, Chiff_B_amp, Chiff_C_amp. The defaults (0.06, 0.04, 0.02) are calibrated for a realistic flute attack, but you may prefer different balances. Set to 0 to disable a layer.
Reduce Vibrato_depth_st (e.g., to 0.1 st) or Vibrato_rate_Hz (e.g., to 4 Hz). The amplitude modulation (3% depth) can also be reduced by editing the script’s vibrato_amp_mod variable.
The base row (0, 11, 3, 4, 8, 7, 9, 6, 1, 5, 2, 10) is a classic “all‑interval” row used by Webern. Each adjacent interval (mod 12) appears exactly once: 11, 4, 1, 4, 11, 2, 3, 7, 4, 9, 8. This ensures maximum rhythmic diversity when mapped to durations.
In a real flute performance, the attack transient (chiff) occurs only at the beginning of a phrase. Legato notes (slurred) have no new attack – the air column is already vibrating. This script models that behaviour: the first note has full chiff, subsequent notes are legato.