Skip to content

Add full melody ingestion, dual-staff companion scores, and embedded MusicXML standards - #17

Merged
johnksterling merged 2 commits into
mainfrom
feature/melody-and-musicxml-standards
Sep 19, 2026
Merged

johnksterling merged 2 commits into
mainfrom
feature/melody-and-musicxml-standards

Conversation

@johnksterling

Copy link
Copy Markdown
Owner

Summary

This PR addresses the request to support melodies in addition to chord progressions. It extends jazz-tools to ingest, parse, analyze, and render full lead sheet melodies alongside Berklee voice-led guide tone (3rds & 7ths) companion scores.

Key Additions & Enhancements

  1. Melody Data Model:

    • Added MelodyNote model (Pitch, Octave, DurationBeats, BeatOffset, IsRest, Tie, Lyric) in internal/jazz/model.go.
    • Attached Melody []MelodyNote to each TimedMeasure, with HasMelody() and MelodyNotesCount() helpers on *Tune.
  2. MusicXML Parser Multi-Part Melody Extraction:

    • Enhanced internal/jazz/musicxml_read.go to automatically inspect multi-part and single-part MusicXML files.
    • Synchronizes melody lines across parts by measure number, correctly handling pickups, note divisions, rests, ties, and chords.
  3. Dual-Staff Companion Score Generation (MusicXML & LilyPond PDF):

    • MusicXML (musicxml_write.go): When melody notes are present, generates a braced 2-part companion score:
      • Part 1 (Melody): Melody staves with chord symbols, lyrics, and notes.
      • Part 2 (Guide Tones): Treble staff with voice-led 3rds and 7ths for Berklee accompaniment practice.
    • LilyPond (lilypond.go): When melody notes are present, engraves a dual-staff system (\new Staff with { instrumentName = "Melody" } + \new Staff with { instrumentName = "Guide Tones" }) with real-time harmonic device brackets and key center annotations.
  4. Curated & Embedded MusicXML Jazz Standards:

    • Embedded 23 authentic jazz standards with full melodies directly into the binary via //go:embed standards_xml/*.musicxml in internal/jazz/standards.go:
      • Autumn Leaves, Blue in Green, Giant Steps, Waltz for Debby, Donna Lee, A Night in Tunisia, Take Five, Jordu, All Blues, Blue Monk, Blues for Alice, Cantaloupe Island, Desafinado, Dolphin Dance, Freddie Freeloader, Lady Bird, Lullaby of Birdland, 'Round Midnight, Satin Doll, So What, Spain, Tenor Madness, and Tune Up.
    • Unified search rankings in SearchStandards to prioritize standards with full melodies.
  5. Web Interface & API:

    • Updated AnalyzeResponse to include melody metadata and note collections.
    • Updated OpenSheetMusicDisplay (OSMD) score viewer in web/src/components/ScoreViewer.tsx to display instrument part names and dual-staff lead sheets.
    • Added 🎵 Melody badges across standard search results and header metadata.

All unit and integration tests are passing.

@johnksterling
johnksterling merged commit d9193aa into main Sep 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant