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.

Author: Shai Cohen Affiliation: Department of Music, Bar‑Ilan University, Israel Version: 2.1 (2025) – Audio Analysis Input Pipeline License: MIT License Repo: GitHub
Contents:

What this does

Flute KlattGrid Serial Melody synthesises a dodecaphonic (12‑tone) melody using Praat’s KlattGrid physical modelling synthesis engine. The system:

  1. Generates a 12‑tone row starting from a user‑chosen pitch (frequency).
  2. Applies the selected row form (Prime, Inversion, Retrograde, Retrograde‑Inversion).
  3. 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).
  4. 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).
  5. Concatenates the 12 notes with legato crossfades to create a seamless melody.
Chiff layers (attack transients):
  • 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).
These are applied only to the first note of the melody (attack). Subsequent notes are legato (no chiff, amplitude never dips).

Quick start

  1. In Praat, run the script Flute_KlattGrid.praat (no sound selection needed – the script generates its own audio).
  2. Set Frequency_Hz – the starting pitch of the tone row (e.g., 523.25 Hz = C5).
  3. Choose a Row_form (Prime, Inversion, Retrograde, Retrograde‑Inversion).
  4. Adjust Min_IOI_s and Max_IOI_s – the range of note durations derived from intervals.
  5. Set Duration_scale – overall time scaling factor (2.5 = all notes 2.5× longer).
  6. Optionally adjust flute body parameters (Open_phase, Vibrato_rate_Hz, Vibrato_depth_st, amplitude levels).
  7. Click OK. The script generates the 12‑tone row, synthesises the melody, and creates a Sound object named flute_serial_melody (or flute_XHz if melody mode is off).
Tip: For a standalone single note, uncheck Melody_mode. For the full serial experience, leave it checked. The row and rhythm are printed in the Info window.
Important: This script uses Praat’s 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:

0, 11, 3, 4, 8, 7, 9, 6, 1, 5, 2, 10

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:

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 to duration mapping:
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:

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:

The three chiff layers are mixed with the main tone and scaled to avoid clipping.

Parameters & defaults

Mode & pitch

ParameterRangeDefaultDescription
Melody_modeyes/noyes
Frequency_Hz20–5000523.25
Base_octave3–65
Row_formPrime / Inversion / Retrograde / Retrograde‑InversionPrime

Serial rhythm

ParameterRangeDefaultDescription
Min_IOI_s0.05–0.50.15
Max_IOI_s0.5–3.01.20
Duration_scale0.5–5.02.5

Flute body

ParameterRangeDefaultDescription Open_phase0.5–1.00.90。 Vibrato_rate_Hz0–105.3。 Vibrato_depth_st0–1.00.25。 Amp_voice_dB50–10090。 Amp_asp_sustain_dB40–7054。

Chiff & output

ParameterRangeDefaultDescription Chiff_A_amp。<0–0.50.06。 Chiff_B_amp0–0.50.04。 Chiff_C_amp0–0.50.02。 Draw_visualizationyes/noyes。 Play_resultyes/noyes。

Visualization (Praat picture)

When Draw_visualization = 1, the script draws a 4‑panel figure:

Tip: The spectrogram reveals the formant structure – F1 should follow the note frequency, while F2–F5 track its harmonics. The chiff layers appear as broadband noise at the very beginning of the spectrogram.

FAQ / troubleshooting

Melody sounds choppy / has clicks between notes

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.

Chiff layers are too loud / too quiet

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.

Vibrato sounds unnatural

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.

All‑interval row

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.

Why is chiff only on the first note?

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.