Flute-like KlattGrid Serial Melody — User Guide

A twelve-tone melody generator coupled to a flute-like KlattGrid voice. A fixed 12-pitch-class seed is transformed, placed into a bounded tessitura, mapped to a five-value rhythmic palette, and rendered with a pitch-tracking source/filter model, vibrato, breath noise, first-note chiff, and true onset-preserving legato overlap.

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

What this does

Flute-like KlattGrid Serial Melody combines two mechanisms: a twelve-tone pitch/rhythm generator and a synthetic flute-like voice. In Melody mode it creates a 12-note phrase; with Melody mode off it renders one 2.5-second note at the exact Seed frequency.

Important: this is not a physical waveguide model of a flute. Praat's KlattGrid is a time-varying source/filter synthesizer. This script repurposes its phonation, aspiration, breathiness, flutter, pitch, and oral-resonance controls to create a family of flute-like synthetic timbres.
twelve-tone pitch row + interval-derived IOI palette ↓ KlattGrid pitch / phonation / noise ↓ five pitch-tracking oral resonances ↓ first-note chiff ↓ raised-cosine note overlap ↓ mono phrase

Twelve-tone pitch process

The fixed seed row is:

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

These are pitch classes relative to C. The row contains all 12 pitch classes exactly once, but it is not an all-interval row. The older guide's “Webern Op.24 style / all-interval” description was incorrect.

What Seed frequency means in Melody mode

Seed frequency is a pitch-class anchor, not necessarily the first sounding frequency. The script converts the entered frequency to the nearest equal-tempered MIDI note and uses that note's pitch class to transpose the seed row. Base octave then controls the register used for the first transformed row member.

For Prime and Inversion, the transformed row begins on the anchor pitch class. Retrograde and Retrograde-Inversion begin with the final member of the corresponding forward row, so their first sounding pitch class is not the seed pitch class.

Row forms

FormOperation
PrimeThe transposed seed row.
InversionEach transposed pitch class is reflected around the seed pitch-class anchor.
RetrogradeThe transposed Prime row in reverse order.
Retrograde-InversionThe transposed Inversion row in reverse order.

Register placement

The 12 pitch classes are converted to equal-tempered MIDI pitches. After the first pitch is placed from Base octave, each following pitch class is placed in the nearest octave to the preceding note; if the direct placement is more than six semitones away, the script shifts it by an octave. The final tessitura is constrained to MIDI 48–96 (C3–C7).

In single-note mode, no row pitch is used for the sound itself: the exact entered Seed frequency becomes F0. The row is relevant to Melody mode.

Interval-derived rhythm

The rhythm is serially related to the transformed pitch row, but it is not a direct proportional mapping from semitone size to duration. The script first creates five evenly spaced rhythmic values between Min IOI and Max IOI:

palette = [Min,
           Min + 1/4 range,
           Min + 2/4 range,
           Min + 3/4 range,
           Max] × Duration scale

The directed pitch-class interval to the next row member then chooses one of those five values:

Directed intervalRhythm palette value
1–2 semitones1st / shortest
3–42nd
5–73rd
8–94th
10–115th / longest

For notes 1–11, the selected value is the true onset-to-onset interval (IOI). Note 12 uses the directed cyclic interval back to row member 1 to select the final duration of the phrase.

Legato overlap does not alter those onset times. The sounding duration of notes 1–11 is IOI + crossfade, while the next note still begins exactly one IOI after the previous onset.

Flute-like KlattGrid voice

Each note receives its own KlattGrid. Pitch is placed in the KlattGrid pitch tier, with a small first-note approach to the target and sampled sinusoidal vibrato. Voicing, aspiration, breathiness, and flutter are controlled by their corresponding KlattGrid tiers.

Pitch-tracking resonance ladder

The oral resonances are intentionally tied to F0 rather than representing measured fixed flute resonances:

ResonanceCenterBandwidth
11.0 × F00.25 × F0
22.0 × F00.35 × F0
33.5 × F0350 Hz
45.5 × F0500 Hz
58.0 × F0700 Hz

The script works at a fixed 44.1 kHz sample rate and reserves practical headroom at 0.45 × Fs. A single note, or any generated melody, is rejected if the 8×F0 resonance would exceed that limit.

After KlattGrid synthesis the main tone is Hann-band filtered from 40 Hz to an adaptive upper frequency: the larger of 8 kHz or approximately 1.12× the fifth resonance, capped at the practical headroom frequency.

Vibrato and note envelopes

Pitch vibrato is specified in semitones and converted multiplicatively to frequency. The amplitude vibrato is correctly applied as an additive dB deviation around Voicing level rather than multiplying the absolute dB value.

The first note has a short pitch approach, voicing/aspiration/breathiness attack, sustain, and release inside its KlattGrid. Later legato notes begin at their sustain levels immediately; their inter-note fade is supplied by the external overlap window. The final note is ended by the script's short phrase-edge protection fade.

First-note chiff

Chiff is added only when do_attack is true — the first note of a melody, or the standalone note in single-note mode. Later legato notes contain no new chiff.

LayerCurrent implementation
Chiff AGaussian turbulence filtered from approximately 0.7×F0 to 4×F0. Its duration is short-note-safe: up to 20 ms, then exponentially decayed and peak-calibrated to Chiff A peak.
Chiff BA second two-resonance KlattGrid that sweeps from 0.60×F0 to F0 over up to 60 ms, with a brief voicing envelope. It is peak-calibrated to Chiff B peak.
Chiff CHigh-frequency Gaussian frication, filtered up to 9 kHz/practical headroom, lasting up to 15 ms and exponentially decayed before peak calibration.

The three layers are summed directly into the mono main tone by sample index. There is no temporary multichannel combine/downmix trick in the current version.

Random seed controls all stochastic breath/chiff synthesis. Zero uses an unpredictable state; a positive seed makes the stochastic components reproducible, after which Praat's unpredictable random initialization is restored.

Legato overlap and phrase timing

The crossfade is:

min(50 ms, 20% of the minimum scaled IOI)

For every note except the last, that overlap is added to the note's sounding duration. The next note is nevertheless shifted to its true serial onset, so the two sounds overlap for the crossfade interval.

The amplitude windows are complementary raised-cosine curves:

fade in  = 0.5 - 0.5*cos(pi*t/X)
fade out = 0.5 + 0.5*cos(pi*t/X)

They sum to 1 at corresponding positions. This is a smooth complementary amplitude crossfade; it should not be confused with the sin/cos equal-power panning law used in some other AudioTools processors.

Presets

Presets set the seed/register, IOI range, Duration scale, KlattGrid voice controls, and chiff balances. They do not change Melody mode, Row form, Normalize output, Draw visualization, or Play result.

PresetSeed / octaveIOI rangeOpen phaseVibrato rate / depthVoice / aspiration sustainChiff A/B/C
Balanced Flute-like523.25 Hz / 50.20–0.80 s0.905.3 Hz / 0.25 st90 / 54 dB0.060 / 0.040 / 0.020
Soft Historical Tone440 Hz / 40.22–0.75 s0.855.0 / 0.1488 / 490.035 / 0.055 / 0.010
Bright Folk Tone587.33 Hz / 50.15–0.50 s0.926.5 / 0.3892 / 560.095 / 0.045 / 0.030
Breathy Low Tone392 Hz / 40.30–1.20 s0.954.5 / 0.2082 / 620.025 / 0.018 / 0.045
High Bright Tone1046.50 Hz / 60.10–0.40 s0.887.2 / 0.3094 / 480.075 / 0.060 / 0.040
Mellow Low Tone261.63 Hz / 40.35–1.40 s0.964.0 / 0.1585 / 580.018 / 0.018 / 0.010
Glassy Air Tone523.25 Hz / 50.25–1.00 s0.983.0 / 0.0879 / 650.010 / 0.010 / 0.055

All current presets use Duration scale = 1.0. They also set amplitude-vibrato depth, aspiration attack peak, and breathiness level; those values remain editable on the advanced page.

Controls

Compact launcher

ControlDefaultMeaning
PresetCustomLoads a voice/tessitura/rhythm configuration.
Melody modeyes12-note serial phrase when on; exact-frequency 2.5 s standalone note when off.
Seed frequency523.25 HzMelody: nearest-MIDI pitch-class transposition anchor. Single note: exact F0.
Base octave5Register reference for the first transformed row member.
Row formPrimePrime, Inversion, Retrograde, or Retrograde-Inversion.
Min / Max IOI0.20 / 0.80 sEndpoints of the five-value rhythmic palette.
Duration scale1.0Multiplies every palette value and therefore the phrase timing.
Edit voice and chiffoffOpens the advanced page after preset application.
Normalize outputyesOptional final phrase/single-note target peak normalization to 0.92.
Draw visualizationyesDraw mechanism and measurement panels.
Play resultyesPlay final Sound.

Advanced voice/chiff page

The advanced page exposes Open phase, pitch-vibrato rate/depth, amplitude-vibrato depth in dB, voicing level, aspiration sustain and attack peak, breathiness level, three chiff peak values, and Random seed. It opens after the selected preset is loaded, so it fine-tunes that preset rather than replacing it with generic defaults.

Level, channels, and output

Each synthesized note is intentionally peak-calibrated to 0.72 before overlap. This is a per-note calibration step, not the final phrase normalization. Chiff A, B, and C are also individually peak-calibrated to their requested peak values before they are mixed with the main first-note tone.

After the phrase is assembled, a short outer linear fade of at most 8 ms protects the beginning and end. If Normalize output is enabled, the complete result then receives Scale peak: 0.92, i.e. target peak normalization. With normalization disabled, the post-overlap raw phrase level is retained.

PropertyBehavior
ChannelsMono.
Sample rateFixed 44,100 Hz.
Melody durationSum of the 12 serial rhythmic cells; overlap does not extend the nominal phrase beyond the 12th cell.
Single-note durationFixed 2.5 s.
Melody nameflute_serial_melody.
Single-note nameflute_like_<nearest MIDI note name>; synthesis F0 still uses the exact entered frequency.

Visualization and QC

PanelWhat it shows
A — Pitch + RhythmActual note onset timing on a log-F0 axis. Each horizontal bar spans the serial rhythmic cell (IOI); note names are shown in Melody mode.
B — Source–Filter ModelThe five actual pitch-tracking oral-resonance targets: 1×, 2×, 3.5×, 5.5×, and 8× F0.
C — Model → MeasurementMeasured final-output spectrogram with actual nominal F0 guides overlaid.
D — Measured OutputWaveform after note overlap, edge protection, and the final level stage.

The QC strip reports the KlattGrid mechanism, row form and 12/12 pitch-class uniqueness, phrase duration and overlap, vibrato, aspiration, seed state, and pre/post-normalization levels.

The F0 guides and resonance panel show the nominal note targets. The actual KlattGrid pitch tier also contains the first-note approach and sampled vibrato, so the measured spectrogram can deviate slightly around those nominal lines.

Further Reading