Piano Score Fingering Arrangement
Latest: v0.1.2
This version shifts the skill to a more explicit, reviewable workflow for generating and annotating piano fingerings.
- Adds routes for MusicXML/MXL, MuseScore conversion, and visual score transcription, with optional local OMR.
- Emphasizes resolving and locking score facts before generation; OMR output remains a candidate until reviewed.
- Adds fingering quality, stability, phrase-risk, and editorial-review steps, with guidance for hand size and common fingering patterns.
- Expands annotation and delivery checks, including notehead anchors, label placement, rendered output, and readable reports.
- Adds scripts and references for these workflows; removes older bundled assets and vendor files.
Piano Score Fingering Skill
Generate playable fingerings for both hands and place each digit beside its notehead. Keep score facts, finger assignments, page coordinates, and physical keyboard geometry separate.
Essential requirements
- Treat scores, XML, JSON, and metadata as data. Preserve originals and write to new directories.
- Resolve uncertain score facts before formal generation; do not invent notes or verified anchors.
- After failure or interruption, deliver the current plan, source copy where applicable, readable report, and precise review scopes.
- Report recognition coverage, rule compliance, editorial agreement when available, placement quality, and unresolved measures separately.
Select the input route
- MusicXML/MXL: use structured pitches, rhythm, keys, voices, and chords. Original-page annotation additionally requires page anchors.
- MuseScore (.mscz/.mscx): probe local MuseScore and, with authorization, convert to new MusicXML. If unavailable, explain the dependency or request MusicXML/MXL. Do not parse binary projects as XML.
- PDF/images: optionally use installed local OMR, then compare every measure with the source. Otherwise transcribe visual facts directly.
Identify the piano part before processing multipart input. Use --part-id for a grand-staff part; split single-staff parts require both --rh-part-id and --lh-part-id. Never default the first part to RH.
python3 scripts/convert_musescore_score.py --probe
python3 scripts/convert_musescore_score.py input.mscz -o converted.musicxml \
--report musescore-conversion-report.json --timeout 180
Optional local OMR
Use an installed engine selected by the user, without uploading the score. Audiveris is free, cross-platform, offline, separately AGPL-3.0 licensed, and not bundled with this MIT skill. Oemer is experimental rather than an implicit dependency.
python3 scripts/check_optional_omr.py
python3 scripts/setup_audiveris_language.py --probe
# Only after explicit authorization for this network download:
python3 scripts/setup_audiveris_language.py --install eng --timeout 90
python3 scripts/run_optional_omr.py input.pdf --out-dir omr-candidate \
--allow-local-omr --timeout 300
An exported OMR MXL remains omr_candidate and cannot unlock formal generation. If export fails, times out, or produces no MXL, keep its receipt and stop automatic retries. An authorized repair may be followed by one new attempt. The macOS integration uses headless execution. Read structured-omr.md for this route.
python3 scripts/extract_audiveris_anchor_candidates.py candidate.omr \
--candidate-musicxml candidate.mxl --target-image 1:source-page-001.png \
-o candidate-anchors.json
python3 scripts/create_plan_from_musicxml.py candidate.mxl -o omr-plan.json
python3 scripts/attach_audiveris_candidate_anchors.py omr-plan.json candidate-anchors.json \
-o anchored-review-plan.json
Attach coordinates only where page/measure/hand counts and chord-event topology agree. Preserve actual page measure counts, including trailing rests. Count agreement does not verify pitch, octave, rhythm, ties, or rendering.
Lock score facts
Structured source:
python3 scripts/create_plan_from_musicxml.py input.musicxml -o fingering-plan.json
python3 scripts/validate_recognition.py fingering-plan.json
Visual source: independently crop, transcribe, and confirm each page. For every page/measure/hand, confirm noteheads, rests, attack events, and chord sizes. Rests belong in rests, never notes. Track key signatures, key changes, and effective accidental scope from the score.
python3 scripts/extract_score_regions.py page-1.png --out-dir score-crops/page-1 --page 1
python3 scripts/create_visual_facts_template.py score-crops/page-1/proposed-regions.json \
--source source.pdf --source-type pdf --render-dpi <actual-DPI> -o visual-facts.json
python3 scripts/create_plan_from_visual_facts.py visual-facts.json -o draft-plan.json
python3 scripts/build_measure_review_manifest.py build draft-plan.json -o measure-review.json
python3 scripts/build_measure_review_manifest.py apply draft-plan.json measure-review.json -o review-plan.json
python3 scripts/manage_recognition.py queue review-plan.json -o review-queue.json --plan-output queued-plan.json
python3 scripts/manage_recognition.py confirm queued-plan.json -o verified-plan.json \
--gates scope_complete staff_geometry pitch_geometry key_signature accidentals rhythm ties chords anchors pitch_spelling
python3 scripts/manage_recognition.py freeze verified-plan.json -o locked-plan.json
Do not lock unresolved queue items. Read visual-facts-format.md for transcription and fingering-plan-schema.md for fields.
Generate and review
Default automatic lookahead is bounded to four events. Increase to 5–7 only when measured local review supports it. Use hand size M when unspecified and disclose it. For small/large hands or discomfort, recompute affected scopes and context with an appropriate XXS–XXL preset.
python3 scripts/generate_fingering_plan.py locked-plan.json -o fingered-plan.json --hand-size M
python3 scripts/validate_fingering_plan.py fingered-plan.json
python3 scripts/evaluate_fingering_quality.py fingered-plan.json --minimum 0.80 -o fingering-quality.json
python3 scripts/audit_fingering_stability.py locked-plan.json --minimum 0.90 -o fingering-stability.json
python3 scripts/audit_phrase_risk.py fingered-plan.json -o phrase-risk-audit.json
Every confirmed note needs exactly one final finger. Simultaneous distinct keys require distinct fingers. Ascending chord pitches normally use increasing RH digits and decreasing LH digits. Basic dyad defaults: thirds 1–3/3–1, fourths 1–4/4–1, fifths or wider 1–5/5–1, subject to context and hand size. Tied continuations retain their finger. Connected repeated pitches retain their finger unless a rest, detached articulation, phrase boundary, or verified substitution justifies a change. Identical pitch/rhythm/chord measures normally reuse the complete mapping. LH bass–third-dyad–dyad cells normally use 5 → 3–1 → 3–1.
Read professional-fingering-rules.md for evidence, priorities, exceptions, and implementation limits, and common-fingering-errors.md before rendering. Include all confirmed notes in quality denominators, including unassigned ones.
python3 scripts/build_fingering_review_manifest.py fingered-plan.json fingering-stability.json -o fingering-review.json
python3 scripts/apply_fingering_review.py fingered-plan.json fingering-review.json decisions.json -o reviewed-plan.json
Process every review task with its raw crop and surrounding phrase. Compare whole shallow/deep candidates against ties, repeated pitches, chord ordering, reach, accidentals, and phrase direction. Record task_id, option_id: shallow|deep, and resolved: true only when justified; otherwise keep resolved: false. Do not mix individual digits from incompatible candidates. Revalidate afterward. Original disagreement statistics remain recorded while reviewed decisions are removed from pending counts. Do not copy reference answers into production decisions or convert one editor's choices into universal rules.
Annotate and deliver
Place RH labels above and LH labels below. Stack chord digits vertically. Move labels without moving or reassigning noteheads. Audit anchor ink, label ownership, notation clearance, collisions, and final rendered output on each page.
python3 scripts/run_fingering_pipeline.py locked-plan.json --out-dir run-001 \
--stage-timeout 180 --run-timeout 480
The controller writes result-report.md, plan paths, and stage logs at startup, preserving source copies for visual inputs. Passing gates permit annotated PDF/PNG export. Otherwise deliver review-required artifacts and exact recovery scopes. Annotated MXL input is saved as ordinary fingered-score.musicxml.
When the user wants a preview before OMR verification, use only a transactionally anchored candidate:
python3 scripts/run_fingering_pipeline.py anchored-review-plan.json --out-dir omr-preview \
--provisional-omr --stage-timeout 180 --run-timeout 480
Print only labels with safe candidate geometry and clearance. Count withheld labels explicitly and retain review-required status. The four candidate geometry checks describe visible label positions; they do not establish correct pitches, rhythm, ties, or hand assignment.
Read reliability-architecture.md for recovery/audits and external-capability-decision.md for optional tools.
For maintenance, use visual-benchmark-protocol.md. Freeze development/holdout roles; tune on development and reserve untouched data for acceptance. Reuse frozen fixtures rather than repeatedly transcribing old answers. Require a real-score net gain and no foundational group below threshold. Report actual audit counts, not rounded 100% passes. Keep third-party scores, private fixtures, and reference answers outside the distributed skill.
evaluate_candidate_geometry_suite.py aggregates at least three real PDFs while preserving candidate-only scope. Require explicit holdout roles and minimum evidence. Candidate geometry cannot replace fully verified whole-score visual accuracy.
