Pitch Contour Graphic Score — Contemporary Notation

Transforms a sound's continuous pitch into a performable graphic score in the idiom of Ligeti / Crumb / Berberian / Aperghis: real 5-line staff with clefs, glissando contours, noteheads with accidentals, proportional time axis, and dynamic ribbon.

Author: Shai Cohen Affiliation: Department of Music, Bar-Ilan University, Israel Version: 3.7 (2026) License: MIT License Repo: https://github.com/ShaiCohen-ops/Praat-plugin_AudioTools
Contents:

What this does

This script transforms a sound's continuous pitch and intensity into a performable graphic score in the tradition of contemporary vocal/instrumental notation (Ligeti, Crumb, Berberian, Aperghis). The output is a high-resolution PNG (optional) or Praat Picture that can be printed or embedded in a video.

Notation principles:
  • Real 5-line staff — treble, bass, or grand staff with clefs and ledger lines; pitch height maps to true staff position.
  • Glissando contour — where pitch stabilises it becomes a notehead (with accidental); where it moves it becomes a slide line between noteheads.
  • Proportional / spatial time — seconds, not metered bars; performer reads gestures left to right in real time.
  • Dynamic ribbon — continuous hairpin envelope derived from intensity, with pp..ff reference band.
This is an interpretive transcription, not a literal one: the gesture segmentation (hold vs. glide) is parameterised via presets.

Key Features:

v3.7 improvements: Auto pitch-range (two-pass) from input — no more manual guessing. The script now measures the sound's own quartiles and sets analysis floor/ceiling accordingly, with manual fallback bounds as safety. Adjacent exports with different render windows always line up because staff layout is computed from the full file's pitch range.

Quick start

  1. In Praat, select exactly one Sound object.
  2. Run script…Pitch_Contour_Graphic_Score.praat.
  3. Choose a notation preset (Balanced, Sparse, Dense, Pure Glissando, Vocal, or Custom).
  4. Select Staff_system (Treble only / Bass only / Grand staff).
  5. Select Orientation (Portrait for printing, Landscape HD for video).
  6. Optionally set Render_from_seconds and Render_to_seconds for phrase-by-phrase export.
  7. Set Seconds_per_system (default 6.0 s per horizontal system).
  8. Enable Save_png and choose a folder for high-resolution PNG output.
  9. Click OK — script analyses pitch, segments gestures, and draws the score.
Quick tip: For vocal scores, use Vocal preset (narrow tessitura, fine wobble tolerance). For purely glissando textures (no discrete pitches), use Pure Glissando (no noteheads, only contour line). To export a long score as separate PNG pages, set Render_from/to seconds for each phrase and run multiple times — staff layout stays identical so pages align perfectly.
Important: The script performs a two-pass pitch analysis: first a wide probe (50–800 Hz) to measure the sound's quartiles, then a refined analysis using Hirst factors (0.75×q25 to 1.5×q75). This works best on monophonic pitched sounds (voice, solo instrument). For noisy or highly percussive sounds, the segmentation may produce few holds; use Pure Glissando preset. The score is drawn as a Praat Picture — use "Praat Picture" window to save as PDF/EPS/PNG manually, or enable the built-in PNG export.

6 Notation Presets

PresetSmoothingTolerance (st)Min Hold (s)NoteheadsGlissandoCharacter Balanced2 (median3)0.40.12yesyesGeneral purpose — good for most monophonic sources. Sparse 3 (median5)0.350.30yesyesOnly clearly sustained pitches become noteheads — cleaner, sparser score. Dense 1 (none)0.50.07yesyesCatch short holds, detailed microtonal gestures. Pure Glissando2 (median3)0.40.12noyesContour only, no noteheads — pure sliding line. Vocal 3 (median5)0.30.18yesyesNarrow tessitura, fine pitch wobble tolerance. Custom useruseruseruseruserFull manual control via Advanced fields (script-editable).
Smoothing options: 1 = none, 2 = median filter (3-point), 3 = median filter (5-point), 4 = moving average (3-point). Median filters preserve pitch step edges better than averaging.

Hold vs. Glide Segmentation

Gesture segmentation algorithm

Contiguous voiced frames are analysed for holds (sustained pitches) and glides (sliding movements).

A hold is a maximal span where every frame's pitch deviation from the span's running mean is ≤ hold_tolerance_semitones AND the span duration ≥ min_hold_seconds.

If a segment fails either condition, all frames are classified as glide (drawn as continuous contour line).

Holds receive:

  • A notehead (filled circle) at the mean pitch
  • A sustain bar connecting noteheads across the hold duration
  • Accidental (#) if the pitch class is sharp (C#, D#, F#, G#, A#)
  • Optional note name text (e.g., "C4")

Parameters:
  • hold_tolerance_semitones — pitch stability threshold (0.3–0.5 semitones typical). Lower = stricter hold detection.
  • min_hold_seconds — minimum duration for a hold (0.07–0.30 s). Longer = only sustained notes become noteheads.
  • smoothing — pre-filter to reduce micro-fluctuation before segmentation.
Interpretive note: This segmentation is deliberately "musical" rather than purely acoustical. A singer's vibrato (0.5–1 semitone wobble) will still be detected as a hold if the tolerance is set appropriately (e.g., Vocal preset uses 0.3 st). Wide glissandi (continuously moving pitch) produce no noteheads — only a sliding line. This matches contemporary notation practice where only sustained pitches are notated as discrete notes.

Score Layout & Aesthetics

Staff system

  • Treble only — for soprano, alto, violin, flute
  • Bass only — for bass, cello, trombone
  • Grand staff — treble + bass for piano or wide-range sources

Proportional time

  • Horizontal axis = seconds (real time)
  • Grey vertical ticks at integer seconds
  • No barlines or time signatures — spatial reading
  • Performers follow left-to-right as audio plays

Dynamic ribbon

  • Purple contour under the staff
  • Height = intensity (log-compressed for loudness perception)
  • "pp" to "ff" reference band (intensity range adjustable)
  • Continuous hairpin effect

Orientation & size

  • Portrait — 8" wide, tall stacking for print/scroll
  • Landscape HD 16:9 — 16"×9", ideal for video embedding
  • Staff size — Small/Medium/Large
Phrase-by-phrase export: Set Render_from_seconds and Render_to_seconds to export only a window of the score (e.g., 0–30 s, then 30–60 s). The staff layout (clefs, pitch range) is computed from the entire file, so adjacent windows align perfectly — their staves share the same vertical pitch mapping, and second marks are continuous across exports. This allows you to generate multi-page PDFs or frame-accurate video overlays.

Applications

Contemporary classical composition

Use case: Notate an electroacoustic piece's pitch contour for live instrumentalist + fixed media.

Settings: Grand staff, Balanced preset, Portrait orientation. Export as PDF for the performer — they follow the glissando contour and noteheads while listening to the original recording.

Vocal transcription / pedagogy

Use case: Transcribe a sung melody into a performable vocal score.

Settings: Treble staff, Vocal preset (narrow tolerance, moderate hold duration). The score shows sustained pitches as noteheads (with accidentals) and portamenti as slides — exactly what a singer needs to interpret a rubato melody.

Music analysis / research

Use case: Visualise microtonal inflections, vibrato depth, or intonation drift in a corpus.

Settings: Pure Glissando preset (no noteheads), Dense detail, export as high-res PNG. The contour line shows every pitch fluctuation without interpretive segmentation.

Video score / performance documentation

Use case: Embed a synchronised graphic score in a video performance recording.

Settings: Landscape HD 16:9, Render window = video segment, PNG export at 300 dpi. Overlay the PNG as a picture-in-picture or full-screen during the performance.

Workflow: Voice → Vocal score for singer

Source: Soprano aria recording (monophonic).
Settings: Treble staff, Vocal preset (tolerance=0.3 st, min hold=0.18 s), Portrait orientation.
Result: A clean, readable score with noteheads for sustained pitches, glissandi for portamenti, dynamic ribbon for expression, and second marks for timing.

Workflow: Cello improvisation → graphic score for video

Source: Free improvisation on cello (wide range, glissandi).
Settings: Bass staff, Pure Glissando preset (no noteheads), Landscape HD, PNG export.
Result: A continuous sliding line matching the cello's pitch, synced with the audio — perfect for a performance video overlay.

Workflow: Long field recording → multi-page score

Source: 10-minute environmental recording with changing pitch content.
Settings: Grand staff, Balanced preset. Run script multiple times with Render windows: 0–60s, 60–120s, etc.
Result: Several PNGs that tile together perfectly (staff lines continuous, second marks sequential). Print them as a booklet.

Troubleshooting:
Score shows no noteheads (only glissando line): Increase min_hold_seconds or decrease hold_tolerance_semitones. The input may have continuous vibrato or pitch movement. Try Vocal preset for finer tolerance, or Dense preset for shorter holds.
Noteheads placed at wrong pitch / wrong staff position: The script uses diatonic step mapping (C major ladder). Sharps are drawn with "#" accidental. For flat keys, edit the accidental logic in the script.
Dynamic ribbon is flat / unresponsive: Adjust intensity_min_db and intensity_max_db (script defaults 40–80 dB). Use log compression for musical loudness.
PNG export fails (file not written): Check that the folder exists and is writable. The folder chooser dialog helps avoid path errors.
Auto pitch range produces strange floor/ceiling: If the sound is highly percussive or has very low/high pitch, the quartiles may be outliers. The script clamps to probe_floor/ceiling (50–800 Hz) as safety.

Technical notes: Pitch to staff mapping

The script uses a diatonic step ladder (C major) for staff positioning:
  • Each octave = 7 diatonic steps (C,D,E,F,G,A,B).
  • Sharps share the line/space of their natural pitch, with "#" added.
  • Continuous glissando lines interpolate between diatonic steps (fractional staff-Y).
  • Staff range is autoscaled to the input's detected pitch range, with 2 semitone padding.
Performance practice: This notation is meant to be read spatially — the horizontal axis is real-time seconds, not metrical beats. Performers should listen to the original audio (or a click track with second marks) while reading the score. The dynamic ribbon indicates relative loudness; notehead size is fixed (contemporary convention).