Inspect, safely edit, compare, and render MusicXML for source-score calibration.
For PDF-to-MusicXML work, start with the transcription workflow: source review, notation checks, actual playback, and product publication form one verification loop.
The full score is laid out first. score-cli then locates the requested measure in that
rendered layout and crops its graphical bounds, so spacing and staff positions remain the
same as they were in the surrounding system. Printed measure numbers are included in both
measure and system crops.
Crop bounds include every verse below the bottom staff, even when Verovio's graphical content bounds omit lyric text.
Music text (including metronome notes and metric proportions) uses Verovio's embedded SMuFL font during PNG rasterization. No music-font installation is required, and unrelated system fallback glyphs are not used for those symbols.
- uv. The project pins the latest stable Python 3.14 release and lets uv install it when needed.
uv sync
uv run score-cli render "/path/to/score.musicxml" \
--measure 41 \
--output tmp/measure-41.pngThe score-cli entry point accepts the same arguments:
uv run score-cli render score.mxl --measure X1 --output measure-X1.pngTo capture the complete staff system containing the target measure, including its line-start notation, barlines, instrument labels, and every printed measure number:
uv run score-cli render score.mxl \
--measure X1 \
--scope system \
--output system-X1.png--scope accepts measure (the default) or system. System scope includes every
staff in the target measure's rendered system. Range and measure crops include
real ending brackets that overlap the selected bars, even when Verovio stores
them outside the measure groups (for example, above a final fermata).
The default numbers every measure for debugging. To reduce collisions with long
expression text, all render modes accept --measure-number-interval 0 (system
starts), or 2–64 (every N measures). The default is 1; the option changes
only the preview, never the source XML, selectors or playback. Range manifests
record the chosen value as renderParameters.mnumInterval.
uv run score-cli render score.mxl --from-measure 1 --to-measure 80 \
--measure-number-interval 0 --output tmp/score-systemsDense lyrics can need a second view with automatic reflow, without changing the XML:
uv run score-cli render score.mxl --from-measure 1 --to-measure 98 \
--breaks auto --lyric-word-space 2.5 --output tmp/reflow-reviewThe default remains --breaks encoded --page-width 2100 --lyric-word-space 1.2.
--page-width accepts 100–100000 Verovio units; lyric word spacing accepts finite
values from 0 to 10. These options apply to single-measure, system and range
renders. Range manifests record the exact layout parameters and input hash.
Reflow changes system grouping and crop coordinates, so keep its manifest with
review evidence. It is an additional readability view, not evidence that source
engraving, product display or playback has been accepted. Do not shrink or delete
source lyrics to make an overfull encoded system fit.
--measure matches the exact MusicXML <measure number="..."> value. It is a
string selector, so printed numbers such as 0 and X1 are supported. Inputs may be
uncompressed .musicxml / .xml files or compressed .mxl files.
List the score's parts and ordered printed measure numbers before selecting a measure:
uv run score-cli outline score.mxlThe JSON contains only schemaVersion, parts, measureNumbers, and sequence
diagnostics. It does not include file metadata or musical events.
Return normalized JSON information for one printed measure:
uv run score-cli inspect score.mxl --measure 41JSON is written to stdout, so it can be redirected or piped to another tool:
uv run score-cli inspect score.mxl --measure 41 > measure-41.jsonThe result contains only the selected logical measure. It aggregates that measure across every part, resolves effective attributes such as divisions, key, time, and clef, and normalizes notes, rests, voices, staves, offsets, durations, lyrics, directions, harmony, notation, and barlines. Input-file metadata, score headers, and neighboring measures are deliberately omitted. See the inspect JSON contract.
To inspect one exact MusicXML part ID:
uv run score-cli inspect score.mxl --measure 41 --part P3For a loss-preserving ordered representation of every MusicXML element inside the target measure, opt in explicitly:
uv run score-cli inspect score.mxl --measure 41 --include-elementsFor a concise human-readable view:
uv run score-cli inspect score.mxl --measure 41 --format textThe same printed number appearing once in each part is one logical measure and is aggregated normally. Repeating the same printed number within a single part or timewise measure sequence is ambiguous and returns an error.
See editing and evidence contracts for edit --dry-run,
validate, compare, range rendering, and version-bound calibration records.
Real excerpt inputs and replayable changesets are in tests/fixtures/calibration/;
acceptance evidence distinguishes automated checks
from source PDF review and remaining limitations.
- Input: one MusicXML or compressed MusicXML file.
- Selector: the measure's printed number.
- Output: a score outline, one measure's JSON/text information, or one measure/system PNG.
The original outline/inspect/single-measure render contracts remain unchanged. Automatic PDF correctness judgments, playback, GUI, complex lyric rewrites, and MXL repackaging remain outside the current scope.
OMR 常把多个合唱声部都命名为 Voice。用 rename-part 校正名称时,
可在 value 同时传 "abbreviation":"S"(或 A/T/B),让后续系统也显示正确短名。
省略该字段保留已有短名,显式 null 删除;更新保留原短名的样式属性,拒绝隐式覆盖显示替代内容。
changeset v2 支持事件、小节和 part 的结构编辑,显式 Audiveris 碎片合并,以及 compare/校准清单的结构映射。所有删除逐项声明,失败不发布部分文件。参见 结构编辑契约与示例 和 真实碎片合并验收。
Whole-measure rests use their encoded duration rather than the whole-note glyph. Slur continue marks are checked as formatting points, including duplicated points on start/stop notes. Measure and range crops suppress Verovio-generated footers to keep the source music unobscured. These checks do not certify correctness against the source PDF.
Slur endpoints are paired in score time, rather than XML voice order. This permits real cross-hand piano slurs whose stop is serialized before their start by a backup; unmatched endpoints remain errors.
Tie validation prefers the existing voice identity. If a tie changes voice (for
example, a divisi line rejoins a common-stem chord), it can also match the unique
same-part, same-written-pitch endpoint at the exact end time. Simultaneous unison
candidates remain ambiguous-tie / ambiguous-tied errors; XML traversal order
never selects a fallback. Parts containing zero-duration tie endpoints retain
legacy voice-bound pairing. This does not expand the v1 tie-edit locator contract
or certify the source score. See the pairing limits.
Legal partial voices can retain coverage warnings after source review. Version 0.2.6 adds an explicit input/output hash-bound, exact-warning acknowledgment contract; errors remain blocking and warnings remain visible. See the review workflow.
Validation also catches the narrow MusicXML note-order error notations-after-lyric: a same-namespace notations element must precede all lyric elements. Foreign extension elements are ignored by this rule. This does not replace full XSD validation or automatically reorder the score; see the validation contract.
Free-meter rendering uses a narrowly scoped Verovio 6.3 compatibility adapter:
only redundant later-part senza-misura declarations with identical shared scope
and preceding simple meter are omitted from the render copy. Source XML, note
values and direction offsets remain intact. Range manifests record adaptations
and unchecked independent/mixed meter scopes in renderInputCompatibility;
see the rendering contract.
Explicit MusicXML lyric placement="above" is restored in the render copy:
Verovio 6.3 drops that attribute when importing MusicXML, while its native MEI
verse place="above" layout supports it. The adapter maps a unique note ID and
positive numeric verse number, then reloads the imported MEI with the placement
restored before cropping. Source files, lyrics and music are not rewritten;
renderInputCompatibility.explicitAboveLyrics reports the mapped verse count.
Version 0.2.20 also accepts native omission of empty extend type="continue"
verses only within a proven closed above-lyric span in the same part, voice,
staff and numeric verse. Both imported endpoint verses and the start underline
must survive; no intermediate verse is synthesized. The report records
omittedContinuationElements separately from actual mapped verses.
Default/below-only scores retain the original path. Ambiguous note IDs,
non-numeric/duplicate verse numbers or missing imported targets fail rendering
rather than guess a voice. This does not reproduce arbitrary default-y /
relative-y positioning or certify source engraving or native-player display.
0.2.18 adds render-only recovery of explicit rest staves for complete single-staff voices affected by Verovio 6.3 import order. Mixed cross-staff layers and variable staff counts are reported as unchecked; source XML is unchanged. See rendering compatibility.
0.2.19 render-copy also separates a source-proven whole-measure rest from an incorrectly imported voice layer after a scoped direction (Issue #7). separatedMeasureRestVoices records these repairs; unknown/partial timelines remain on the native path. This does not change source MusicXML or certify source-score accuracy. See rendering compatibility.
0.2.21 keeps visible octave-shift lines and labels inside measure, system and range crops. Crop bounds include overlapping octave spans while horizontal selection remains local; source MusicXML is unchanged. This fixes clipped 8va labels above high piano chords and does not certify native-player display.
0.2.22 reports specific later-part key-signature compatibility risks without changing source XML.
Verovio 6.3 can omit a later key-signature declaration outside the first
MusicXML part. Render commands warn on stderr when a nonredundant later-part
source declaration is not proven covered by an identical first-part declaration
at the same measure ordinal and printed number. Range manifests also retain the
records under renderInputCompatibility.warnings, including part, measure,
staff and source fifths. This reports a specific compatibility risk; it does not
certify that the displayed signature is wrong in every such case. Check flagged
passages with the original score and an independent renderer before accepting
the preview. Keep the source key signature intact; changing source XML to match
this renderer can corrupt other parts. This warning does not repair Verovio's
MEI conversion or certify all independent/staff-specific key contexts.
0.2.23 checks octave-shift spans in score time by part, staff and number, across
voices and measures. Missing or duplicate endpoints produce warnings such as
unclosed-octave-shift, located at the source direction. These remain warnings
because an excerpt may intentionally omit an endpoint. Validation never adds a
stop or transposes pitches; inspect the original score and the following system
before deciding where an ottava ends. A paired span still does not prove its
source location, sounding pitches or rendered scope are correct.
0.2.24 warns about explicitly sloped MusicXML direction/bracket lines whose
paired endpoints have different default-y heights (including relative-y).
Verovio 6.3 loses their staff and endpoint positions: a line can appear horizontal,
move, or disappear even in the uncropped page SVG. Render commands emit
verovio-sloped-direction-bracket-risk on stderr; range manifests retain the
part, start/end printed measures and ordinals, staff and bracket number under
renderInputCompatibility.warnings. Compare the original score and an independent
renderer; keep valid source XML intact. This warning does not repair rendering,
infer a slide/glissando, or certify unflagged lines. Ordinary horizontal brackets,
repeat endings, and spans without two explicit endpoint heights are outside this
bounded warning. See the diagnosis and contract.
0.2.25 preserves clef-relative unpitched note positions in Verovio 6.3 render copies, including speaking voice in bass and octave-transposing clefs. Original MusicXML stays unchanged. The report records every normalized note and ambiguous context; this is display compatibility and does not establish spoken playback.