Skip to main content

Sheet-Music-Recognition — Optical Music Recognition

Convert sheet-music images and scanned PDFs to MusicXML, MIDI, JSON, MP3 and engraved PDF with offline optical music recognition (OMR). Sheet-Music-Recognition includes downloadable model weights, a Java decoder and a Python API and command-line tool, available as score-reader (PyPI package and command) and score_reader (Python import).

Build and test License: Apache-2.0

Quick start · Review demo · Benchmark · Documentation · Python / Java API · Downloads

Code and weights are Apache-2.0 licensed, including commercial and closed-source use. You do not need to publish your own code. Follow the license and notice requirements.

Install & Use

📱 Android Demo

Import a PDF or image, then generate a play-along track. Download on Google Play

🐍 Python/Java Usage

Requires Python 3.10 or 3.11 and Java 17+ on your PATH (or via JAVA_HOME).

python -m pip install "score-reader[pdf,audio]"
Input image Recognized score
Original two-measure scale Engraved MusicXML from the conversion

Listen to the preview · Inspect detected notes · Download MusicXML

Read a score

# Image to MusicXML and MIDI
score-reader score.png -o score.json --musicxml score.musicxml --midi score.mid

# PDF to an audio preview
score-reader score.pdf -o score.json --mp3 score.mp3

Processing runs locally. Recognition writes JSON when you supply --output. Add --musicxml, --midi, or --mp3 for the exports you need. MP3 uses a synthesized tone and requires FFmpeg, which the audio extra supplies.

Option What it sets
--pages 1,3 PDF pages to read
--meter 3/4 Initial meter (default 4/4)
--bpm 90 Initial quarter-note tempo (default 120 BPM)
--key-fifths 2 Fallback key signature with two sharps when the starting key is missing or unreadable
--instrument violin Resolve printed open-string harmonics using standard violin tuning

Run score-reader --help for all options. API and output details · Standalone JAR and model downloads

What it supports

  • Notation. Notes, chords, rests, clefs, accidentals, ties, slurs, grace notes, and dynamics. Reads repeats and endings, plus changes in key, meter, and tempo.
  • Scores. Printed staff notation for piano, violin, and ensembles, including independently barred staves.
  • Playback. MIDI and synthesized MP3 previews can follow recognized ritardandos, fermatas, tremolos, and piano pedal brackets. Playback details
  • Guitar tab. Six- and seven-string tab with tuning headers, written rhythms including triplets, and effects such as hammer-ons, pull-offs, slides, bends, and vibrato. When rhythm is missing, the reader estimates it. Tab details · Guitar effects
  • Exports. MusicXML reconstructs an editable concert-pitch score and leaves out the original page layout and tab placement. JSON includes note events and page geometry. Export formats

Optional engraved PDF

The [sheet] extra uses bundled LilyPond to engrave an image, scanned PDF, or existing MusicXML as a PDF. The first export runs offline after installation. This feature is available in source builds with a matching runtime wheel. See the runtime wheel build instructions.

python -m pip install --find-links wheelhouse ".[audio,pdf,sheet]"
score-reader sheet.png --sheet-pdf sheet.pdf --layout single-staff
score-reader score.musicxml --sheet-pdf score.pdf --layout guitar
Layout What it does
original (default) Preserves the MusicXML parts, staves, and voices. LilyPond engraves new spacing and page breaks.
guitar Engraves pitched music in standard six-string guitar tab.
single-staff Combines parts with matching measure numbers, divisions, key, meter, and transposition while retaining separate voices.

Layout changes apply only to the engraved PDF. The separate [pdf] extra enables scanned PDF input. Runtime wheels target Windows x86-64, Linux x86-64 with glibc 2.28 or newer, and macOS on Intel and Apple Silicon. LilyPond and its bundled components retain their own licenses.

Integration and model

Use Interpreter and write_musicxml from Python, or SheetInterpreter.analyze() from Java. See API examples and output format. An optional native Java decoding service supports bounded, source-matched geometry and analysis requests from local workers. The Python reader runs bundled-model OCR automatically on images and scanned PDFs. The separate shared Java OCR pipeline and optional ONNX binding remain available for cross-platform evaluation. The optional desktop ONNX segmentation adapter uses the pinned v3 conversion without changing the default Python model.

The bundled v4 model comes from our own synthetic training lineage, without pretrained weights or commercial score scans. See the model card, evaluation, training guide and source origins.

See the contributor guide for source builds, tests, and bug reports.

Metadata

Release files for score-reader 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for score-reader 0.1.9
File Interpreter ABI Platform Actions
score_reader-0.1.9-py3-none-any.whl Python 3 none any Details for score_reader-0.1.9-py3-none-any.whl

Release files / score_reader-0.1.9-py3-none-any.whl

Download URL score_reader-0.1.9-py3-none-any.whl
Size 11.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
684ba2f72adee63094144ecbe245c3bc4c662bb231f843be5044e0c8ece8e556
BLAKE2b-256 checksum
How to use checksums
f0223670e7e2ead105ff734310e3afca03c34f985ecb882ed000dc18a9c4e2ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Security for score-reader 0.1.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

1 file in this release has been uploaded with provenance metadata.

Attestation for score_reader-0.1.9-py3-none-any.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.9 This release

1 release file Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page