image imagewidth (px) 780 8.64k |
|---|
YouTube Piano Score
This repository contains piano score samples extracted from YouTube videos. Each sample lives under scores/<video_id>/ and may include:
meta.yaml: metadata for video segmentation, score layout, and staff grouping.score.webp: the generated score image grid.audio.*: the original audio extracted from video.transkun.mid: the MIDI transcription result.transkun-segmentation.yaml: measure and segment alignment metadata generated for the Transkun transcription, used to relate MIDI events back to the source video/score timeline.spartito.lyl: a Lilylet source file exported from the annotated Starry score file. It provides a compact, text-based representation of the recognized score for inspection, diffing, and downstream Lilylet rendering.
Example meta.yaml
video_id: "-PdVMDxofWM" # YouTube video ID.
duration: "00:05:26.801" # Human-readable source video duration.
duration_seconds: 326.801 # Source video duration in seconds.
shot_detection: # Scene-change segmentation metadata.
method: "ffmpeg_scene_score" # Detector used to find score-page changes.
changes: # Segment boundary timestamps.
- "time: \"00:00:05.379\""
staff_n: 2 # Number of staves in one repeated system.
staffLayout: "{-}" # Global staff grouping inferred from brackets. {-}, {--} stand for a pure piano score.
layout: # Score layout and generated image metadata.
frame_size: # Size of one cell in score.webp.
width: 1440
height: 1080
score_grid_rows: 14 # Row count of the column-major score.webp grid.
frames: # One entry for each sampled score frame.
- segment_index: 1 # 1-based source segment index.
start_seconds: 5.379 # Segment start time in seconds.
start_time: "00:00:05.379" # Segment start time as text.
snapshot_seconds: 15.205 # Timestamp of the extracted representative frame.
sourceSize: # Image size submitted to layout detection.
width: 1440
height: 1080
theta: -0.0002685302 # Detected rotation angle in radians.
interval: 11.4 # Estimated staff-line spacing in pixels.
systems: 2 # Number of musical systems on this frame.
stavesPerSystem: [2, 2] # Staff count for each detected system.
totalStaves: 4 # Total detected staves on this frame.
areas: # Detected systems and their staff details.
- x: 48.8 # System bounding box x coordinate.
y: 107.6 # System bounding box y coordinate.
width: 1305.6 # System bounding box width.
height: 500.4 # System bounding box height.
staves: 2 # Number of staves in this system.
staff_detection: # Low-level staff-line detection details.
interval: 11.4 # Staff-line spacing for this system.
phi1: 61.0 # Estimated left horizontal staff extent.
phi2: 1289.0 # Estimated right horizontal staff extent.
middleRhos: # Vertical center positions of detected staves.
- 257.25
- 367.5
bracketsAppearance: "{,}" # Bracket/brace recognition result.
staffMask: 3 # Bitmask of active global staves; 3 means both piano staves.
About the staffLayout code grammar, refer to blog.
Score annotation demo
The annotation workflow has two stages. First, the MIDI generated from piano audio AMT is segmented measure by measure. Second, with the performed MIDI as a reference, the measure-level OMR result is revised so the recognized score events match the performed timing, voices, rests, and note durations.
First, the source score frame is sampled from the video and arranged into score.webp:
The MIDI annotator then compares the transcribed MIDI timing with the detected score measures. The following crop shows the first five measures from the alignment SVG:
For measure-level review, the Starry playground shows the recognized score events over the original staff image together with the voice timeline below it. The timeline makes it easier to verify ticks, voices, rests, and note durations against the visual score:
The OMR result for this score (in Lilylet): spartito.lyl, and the live demo.
- Downloads last month
- 976

