Sheetmusic4J for Java & JavaFX

Parse and render sheet music in Java(FX).
No WebView required.

Latest release: v0.0.4 · 2026-10-16 · Read more

Get Started View on GitHub

Sheetmusic4J is an open-source Java library that parses MusicXML into Java objects and renders them as native JavaFX music sheet views: no WebView, no browser engine, no JavaScript bridge.

Quick start

Sheetmusic4J requires Java 21 or higher and is available from Maven Central. Add the fxviewer dependency (it includes the core library):

​
<dependency>
    <groupId>com.sheetmusic4j</groupId>
    <artifactId>fxviewer</artifactId>
    <version>0.0.4</version>
</dependency>
implementation("com.sheetmusic4j:fxviewer:0.0.4")
implementation "com.sheetmusic4j:fxviewer:0.0.4"

Then load a file and drop the view into your scene:

Score score = ScoreFile.load(Path.of("song.musicxml"));

SheetView sheetView = new SheetView();
sheetView.setScore(score);

stage.setScene(new Scene(new ScrollPane(sheetView), 900, 600));
stage.show();

See the code examples for the full, runnable application, core-only (parse/generate) usage, and play-along cursor/highlighting.

Watch: an introduction to Sheetmusic4J — Render Interactive Sheet Music in JavaFX (MusicXML Library).

Why Sheetmusic4J

Native JavaFX rendering
Drawn straight to a JavaFX Canvas. No browser, no JS bridge. It’s just a Node.
Parse & generate
Read MusicXML into typed Java objects, and write valid files back out.
Modern, minimal Java
Built on Java 21 LTS with Records, a small, maintainable codebase.
Lightweight & offline-first
Needs only javafx.graphics. Fast startup, tiny jlink footprint, no network.

Wondering about the standards behind it? Read what inspired Sheetmusic4J: MusicXML, OpenSheetMusicDisplay, MIDI, ABC notation, Guitar Pro, SMuFL, the Bravura music font, and the MusicXML.com test files. And check the sheetmusic terminology glossary to see which class/method draws which notation element.

The sources of this project are available on github.com/sheetmusic4j/sheetmusic4j.

Used By

MelodyMatrix is a cross-platform MIDI recording and visualization app (Java, Kotlin, JavaFX) that turns live keyboard performances into real-time visual displays, including piano roll, staff notation, guitar fretboard, and chord diagrams. It uses Sheetmusic4J for its staff notation view.

MelodyMatrix staff notation view, rendered with Sheetmusic4J MelodyMatrix staff notation view, rendered with Sheetmusic4J

Building something with Sheetmusic4J? Let us know and we’ll add it here.

Current status

Sheetmusic4J v0.0.4 is on Maven Central and already powers the staff notation view in MelodyMatrix. It reads and writes MusicXML, MIDI and ABC notation through a single ScoreFile facade, imports Guitar Pro 7/8 files (experimental), and renders scores natively in JavaFX: a page view with a play-along cursor, a one-line strip view, a 3D fly-over view, and an interactive NodeSheetView with clickable, selectable notes. A toolkit-neutral render module and a headless render-awt module render the same scores to images without JavaFX. Next up: steadily better engraving fidelity across real-world scores, driven by your visual issue reports.

Like where this is going? Star the project on GitHub to follow along, and tell us what you’re building with it: your use cases decide what comes next.

Latest updates:

Follow the progress in the status posts and check the release notes for the latest changes.

Sheetmusic4J follows the same approach as Lottie4J: parse a standard file format into typed Java objects and render it natively in JavaFX, without a WebView. Lottie4J does it for Lottie animations, Sheetmusic4J for MusicXML scores, and both are built on Java 21 with the same minimal, javafx.graphics-only footprint. See also MelodyMatrix, the MIDI recording and visualization app that uses Sheetmusic4J for its staff notation view.