Sheetmusic4J 0.0.5
2026-10-21 by Frank Delporte
LilyPond Joins the Family
Sheetmusic4J 0.0.5 adds support for an extra format to the ScoreFile facade: LilyPond. LilyPond is the free, text-based engraving program that many musicians and publishers use for beautiful printed scores, and a lot of classical repertoire is available as .ly source. Now you can load such a file and render it natively in JavaFX, without running LilyPond. The work was tracked in issue #8:
Score score = ScoreFile.load(Path.of("bach-bwv610.ly"));
// ...and write any score back out as LilyPond
ScoreFile.save(score, Path.of("bach-copy.ly"));Thanks to Dani_E2e on Reddit and Jurgen Lambrecht for suggesting LilyPond support!
Reading the Language Like LilyPond Does
LilyPond’s input is closer to a programming language than to a data format, so the reader works like LilyPond itself: a parser resolves the note-name language, default durations and variables, an interpreter runs the music through time into staff groups, staves, voices, lyrics and chord names, and an assembler cuts the result into measures and derives what LilyPond leaves implicit, like ties across bar lines, accidentals and beams.
That covers \relative, \fixed and \transpose, chords, ties, slurs, tuplets, grace notes, repeats with alternatives, multiple staves and voices, piano staves, lyrics, chord names, dynamics, tempo and rehearsal marks, \tag filtering and \include of files next to the score. Engraving tweaks like \override and Scheme code are skipped, because Sheetmusic4J does its own layout. The LilyPond page has the full list.
The demo app opens .ly files too, and shows the reference PNG next to the score when one exists. The test fixtures include a set of real-world snippets from the LilyPond documentation (a Bach organ chorale, an orchestral score, tablature, a Stockhausen piece…), which is a nice way to discover what still needs work.
Engraving Improvements
Real LilyPond scores exercised the engraver in new ways, which led to a few improvements that benefit every format:
- Tuplets now go on the stem side like beams do, or where the score says (
placementis read from MusicXML too), clear the noteheads and beams, and support nested tuplets. - Octave clefs such as the guitar’s treble clef with an 8 below, and the percussion clef.
- Layouts are now identical across CPU architectures, by avoiding
Math.powdifferences in note spacing.
Under the Hood
ABC and LilyPond now share the exact Fraction arithmetic from core, KeySignature can tell you the alteration it implies for a step, and NoteType knows its exact length in quarter notes. LilyPond is registered as a ScoreFormat service like the other formats.
The full list is in the release notes, the difference is on GitHub > compare/v0.0.4…v0.0.5, and the code examples show how to get started. If a LilyPond file doesn’t load or render correctly, please let us know on GitHub, ideally with the file attached.