arXiv:2610.28899cs.CVOct 2026

Manuscript Offprint

arXiv:2610.28899

Data-Driven Glyph Positioning for Handwritten Music Synthesis

Elona Shatri, Jiří Mayer, Jan Hajič

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Elona Shatri 1^{1}[0000-0002-1651-5848], Jiří Mayer 1^{1}[0000-0001-6503-3442], and Jan Hajič jr. 1^{1}[0000-0002-9207-567X]

Charles University, Prague, Czech Republic

{shatri,mayer,hajic}@ufal.mff.cuni.cz

Abstract. Synthesised data is a common strategy to address the lack of annotated handwritten music scores in Optical Music Recognition (OMR). Smashcima is a recent synthesis framework that assembles pages of handwritten scores by sampling glyph images from MUSCIMA++ and positioning them with hard-coded rules. In this work we ask whether these rules are grounded empirically, and whether a learned model for context-dependent positioning can further improve synthesis quality. We extract inter-glyph distributions from ~285 thousand annotated relationships across MUSCIMA++ and OmniOMR, finding that several key parameters deviate systematically from real handwriting. Replacing these constants with empirical means reduces positioning RMSE by up to 60%. We then train a Graph Neural Network (GNN) on the Music Notation Graph structure to predict context-dependent offsets, achieving an additional 50–85% RMSE reduction on stems and beams by modelling how neighbouring glyphs constrain placement. Cross-dataset analysis shows that spacing differences between the two corpora are explained by note density (3.3×), not style, and that duration-proportional spacing does not hold in handwriting (R² = 0.001). In downstream evaluation, a YOLOv8 detector pretrained on GNN-positioned synthetic data achieves +30% mAP50 over the baseline and +11% over empirical means when fine-tuned on 200 real handwritten staves, showing that positioning accuracy matters for downstream OMR.

Keywords: Optical Music Recognition · Music Notation Synthesis · Graph Neural Networks · Handwriting Analysis · Data Augmentation

1 Introduction

An OMR system’s performance highly depends on the availability of training data. Manually annotating handwritten scores is labour-intensive and there are only a few relatively small such datasets for the purpose of training deep learning models. To address this there are synthesis frameworks which generate realistic training images from symbolic music representations. However, recent work has identified a “glass ceiling” on the effectiveness of synthetic training data [1], where increasing the volume of synthetic data yields diminishing returns. Understanding what this ceiling is made of and how to get past it requires decomposing the

E. Shatri, J. Mayer, J. Hajič jr.

synthetic-to-real domain gap into its main factors such as symbol appearance, paper texture, and spatial layout.

In this paper, we focus on the layout component. Smashcima [10] is an open-source synthesis tool that takes a MusicXML file and produces rastered images of handwritten music together with pixel-level annotations by sampling real glyph images from MUSCIMA++ [11] and positioning them according to a set of rules. However, the numerical parameters of these rules (stem length, accidental offset, beam angle, inter-note spacing) are constants chosen by visual inspection rather than measured from data. Moreover, these rules treat each relationship independently, they cannot model how the position of one glyph constrains its neighbours.

In this work we address two questions: (1) how far do these constants deviate from real handwriting distributions, and (2) can a learned model that captures context-dependent positioning further improve synthesis quality? We make the following contributions:

  1. A systematic empirical characterisation of inter-glyph positioning distributions across 199 relationship types, extracted from two complementary annotated corpora ( ∼\sim285k relationships).

  2. A Graph Neural Network that predicts context-dependent glyph offsets from the Music Notation Graph structure, reducing positioning RMSE by 50–85% over empirical means on stems and beams.

  3. Cross-dataset validation showing that spacing differences between controlled and real-world corpora are primarily a density effect (3.3×), not a style difference, and that duration-proportional spacing does not hold in handwriting (R² = 0.001).

  4. A downstream evaluation showing that GNN-positioned synthesis improves detection mAP50 by +30% over the baseline and +11% over empirical means on real handwritten staves with 200-shot fine-tuning.