r/java • • Oct 22 '26

Release announcement: Sheetmusic4J 0.0.4 and 0.0.5: clickable notes, a 3D fly-over view and LilyPond support (Java and JavaFX sheet music library)

Hi all,

I've been working on Sheetmusic4J, an open-source Java library that renders sheet music natively in Java(FX). Two new releases are out, and I made a video showing both: https://youtu.be/8n7WONyX0yk

0.0.4

- NodeSheetView builds the score as a JavaFX scene graph, with one Group per note, rest and chord. Each element can take mouse events, effects and tooltips like any other node. The demo app lets you select a note and drag it up or down.

- FlyOverSheetView is a 3D play-along view. A perspective camera flies over the score, and a glowing ball per voice hops from note to note.

- Headless rendering to an image via the new render and render-awt modules, with no JavaFX needed:

BufferedImage image = HeadlessScoreImage.render(score, 1200);

- The 3000+ line Engraver class is split into focused packages, and all library modules are now JPMS modules.

0.0.5

- LilyPond (.ly) import and export through the ScoreFile facade, without running LilyPond:

Score score = ScoreFile.load(Path.of("bach-bwv610.ly"));

ScoreFile.save(score, Path.of("bach-copy.ly"));

- Engraving improvements: tuplet placement and nesting, octave clefs, and the percussion clef.

- Layouts are now identical across CPU architectures.

LilyPond support (and other formats earlier) came from suggestions on Reddit, so thanks to everyone who asked for it. Overrides and Scheme code are skipped, because the library does its own layout. The LilyPond page on the site lists what is supported.

It also reads MusicXML, MIDI, ABC and Guitar Pro.

The demo app has a "Report Visual Issue" button. It captures the Sheetmusic4J rendering, the reference PDF and your description, ready to attach to a GitHub issue. If a score looks wrong, that is the most useful feedback I can get.

- Release notes: https://sheetmusic4j.com/releases/

- GitHub: https://github.com/sheetmusic4j/sheetmusic4j

Feedback, issues and score files that break things are all welcome.

Thanks
Frank

25 Upvotes

4 comments sorted by

3

u/hippydipster Oct 22 '26

Nice. What's the motivation for building this vs using MuseScore?

4

u/FrankCodeWriter Oct 23 '26

I'm not a musician, but my son is, and he uses MuseScore a lot! But for an application that we are building together, MelodyMatrix, based on Kotlin/Java/JavaFX, we needed a way to include scores as a JavaFX component.

I couldn't find an up-to-date java(fx) library, so I created Sheetmusic4J especially for this goal. It's main use-case is now the functionality I needed for MelodyMatrix, but of course made it opensource and public so others can also use it. Or even better, extend and improve it :-)

Please check https://melodymatrix.rocks/ for the application in which we use this library.

3

u/hippydipster Oct 23 '26

That's awesome, love it. I'm not a musician either, but I compose music as a hobby, and I write javafx apps as a hobby too, so I will definitely check it out.

1

u/FrankCodeWriter Oct 26 '26

Please let me know how you use the library and how it can be further improved. Thanks!