- The paper develops a multilabel Conditional Random Field that combines motif-level musical features with within-segment dependencies and supports inference through permutation tests and sandwich-based confidence intervals.
- Beethoven’s early and middle periods show similar transformation frequencies but different interaction structures: early segments exhibit broadly negative cross-family associations, while middle-period segments show selective positive co-occurrence alongside strong exclusions.
- The framework integrates aligned MusicXML, harmony, and expert motif annotations to analyze eight transformation families, offering a statistically rigorous approach for studying structured variation in symbolic music despite limitations from segmentation, anchor selection, and sparse late-period data.
This paper develops a probabilistic framework for modeling how musical motifs are transformed within their local context, applied to Beethoven's piano sonatas. The central methodological contribution is a multilabel Conditional Random Field (CRF) estimated for inferential rather than predictive purposes, combining motif-level feature effects with graph-structured dependencies among nearby instances, and supporting formal statistical inference through permutation-based model comparison and sandwich-based confidence intervals (2603.26478).
The empirical basis is a fusion of three resources: the Beethoven Piano Sonatas Dataset (BPSD) providing MusicXML encodings of first movements with functional harmony annotations from BPS-FH, and the BPS-Motif dataset supplying expert annotations of more than 250 motif classes and roughly 5,000 instances across the corpus. Because these resources use incompatible formats (MIDI-based CSV versus MusicXML), the authors perform an alignment step resolving mismatches in pitch spelling, timing, and notation; the processed data and code are publicly released.
Each motif instance is characterized by ten aggregated descriptors spanning pitch (spread, register), rhythm (inter-onset-interval variability, silence proportion, metrical stress), harmony (harmonic-complexity spread, secondary-function chord proportion, key-change count), and expressive markings (expressive density, dynamic variability). Movements are partitioned into segments approximating phrase-level structure using rule-based cues—rests, sustained repeated pitches, and cadential harmonic events—with boundaries filtered to preserve motif integrity and enforce a minimum span of eight measures.
Transformation labels are derived by comparing each instance to an anchor: the first occurrence of its motif class within the segment (or the most recent anchor from a preceding segment if the class appears only once). Note correspondences between anchor and instance are established by matching on pitch, metrical position, and duration, with dynamic programming alignment used when simple matching fails. Eight transformation families are evaluated automatically: identity, contour-preserving, salient-leap-preserving, rhythm-preserving, harmony-preserving (in terms of Tonic/Pre-Dominant/Dominant functional zones), intervallic-preserving, note addition/removal, and symmetry. Retrograde is excluded because it occurs too rarely in this repertoire.
Two design choices deserve emphasis because they shape all downstream results. First, the anchor-based reference assumes that variation relates to the initial local prototype rather than accumulating sequentially across successive occurrences; the authors acknowledge both perspectives may be musically meaningful but adopt the stable-reference convention. Second, segmentation is rule-based rather than expert-annotated, so segments approximate rather than certify phrase structure.
Model specification and estimation
The CRF defines a conditional distribution over multilabel transformation indicators Y∈{0,1}N×Q given features X, with two components: unary terms YiqXi⊤α⋅q linking features to each transformation, and pairwise terms AijYiqYjrβqr capturing co-occurrence across nearby instances. The adjacency matrix A is block-diagonal by segment, with Gaussian-decay edge weights wij=exp(−(i−j)2/σ2) at σ=1; edges below weight 10−5 are pruned. This restriction of interactions to within-segment edges is motivated primarily by computational tractability, and the authors note that cross-segment dependencies may exist in principle.
Exact maximum likelihood is intractable due to densely connected segment subgraphs, so estimation uses Besag's pseudo-likelihood, which reduces to a set of logistic conditionals optimized via L-BFGS with small L2 penalties (λ=10−3) that prove numerically inconsequential. Identifiability constraints are imposed: X0 is symmetric and centered (row/column sums zero), and non-bias feature coefficients in X1 are mean-centered, separating baseline frequencies from genuine interaction effects.
Inference proceeds on two fronts. Nested model comparisons (baseline → unary → full) use composite likelihood ratio statistics calibrated by 1,000 segment-constrained permutations, with permutation schemes designed to disrupt only the structure under test. Parameter uncertainty uses Wald intervals from the Godambe sandwich variance appropriate to composite likelihood estimators, with Benjamini-Hochberg false discovery rate control (X2) within each parameter family.
A key inferential point is that effective sample size is governed by the number of independent segments, not motif instances. For pairwise coefficients X3, only segments containing at least one occurrence of transformations X4 or X5 contribute information—a substantial reduction in sparse settings. Individual sonatas fall below the roughly 50-cluster threshold recommended for cluster-robust inference, so models are estimated at the stylistic-period level: early (Sonatas Nos. 1–11, 19–20; 1,953 instances in 242 segments) and middle (Nos. 12–18, 21–27; 2,192 instances in 204 segments). The late period (Nos. 28–32) is excluded because several transformation families occur too rarely for stable estimation; subsampling experiments indicate this sparsity reflects structural properties of late-period writing rather than sample size alone, though this interpretation rests on the specific transformation scheme adopted.
Results
Labels are sparse: most families occur in fewer than a quarter of instances. Note addition/removal dominates in both periods (~39%), followed by salient-leap preservation (~0.23) and intervallic preservation. Period contrasts are modest but directionally coherent: the middle period shows higher rates of intervallic preservation (0.212 vs. 0.193) and symmetry (0.068 vs. 0.051), and lower rates of identity (0.049 vs. 0.056) and rhythm preservation (0.120 vs. 0.135)—consistent with reduced literal repetition and greater structural modification in middle-period works.
Global model comparison
All three nested comparisons yield significant improvements in both periods (all permutation p-values ≤ 0.003), establishing that motif-level features carry explanatory power beyond baseline frequencies, and that contextual dependencies add information beyond features. Notably, the unary→full gain is substantially larger in the middle period (CLR = 1299.7 vs. 926.9), indicating a larger relative contribution of contextual dependencies in middle-period data—an early signal of the interaction-structure differences confirmed later.
Unary effects
The clearest cross-period contrast concerns tonal stability. In the early period, higher local key-change rates are associated with reduced probabilities of contour-, salient-leap-, rhythm-, harmony-preserving, and symmetry transformations (e.g., X6 for symmetry, SE 0.017); no key-change effects survive correction in the middle period. Conversely, temporal and articulatory variability effects emerge only in the middle period: inter-onset-interval variability reduces identity and intervallic-preservation probabilities, and accentuation variability reduces identity and rhythm preservation. Metrical stress consistently stabilizes identity in both periods (positive coefficients ~0.21–0.25), while silence-related effects shift character: associated with reduced identity and increased rhythmic modification in the early period, but with both increased identity/salient-leap preservation and decreased contour preservation in the middle period. Secondary-function harmony shows opposite-signed associations with symmetry across periods (positive in early, negative for identity/rhythm in middle).
These patterns imply that the two periods differ not merely in transformation frequency but in which musical dimensions govern transformation probability—tonal motion in the early works, surface-level temporal and expressive conditions in the middle works. Effect magnitudes are moderate throughout, acting as local modulations around low baseline probabilities rather than deterministic signatures.
Pairwise dependencies
Both periods exhibit strong positive self-association for every transformation family (diagonal X7 estimates ranging from ~1.5 to ~2.9), indicating that segments tend toward internally homogeneous transformation regimes. The decisive contrast lies in cross-family structure:
| Structural feature |
Early period |
Middle period |
| Cross-family signs |
All retained effects negative |
Mixed positive and negative |
| Identity relations |
Negative with note-edit, harmony, symmetry |
Positive with contour (+0.490) and symmetry (+0.301); negative with others |
| Strongest exclusions |
Contour–intervallic (−1.184); identity–symmetry (−1.473) |
Harmony–symmetry (−1.445); contour–symmetry (−1.343); identity–rhythm (−1.055) |
In the early period, no positive cross-family co-occurrence survives correction: segments practicing literal repetition are statistically separated from those involving structural reorganization, and different modification principles exclude one another. In the middle period, selective positive associations emerge—identity co-occurs with contour preservation and symmetry—while strong exclusions persist among structurally incompatible types. This constitutes a reorganization of contextual interaction structure between periods, consistent with the larger unary→full CLR gain in the middle period, and suggests increased differentiation in how transformation principles combine within phrases without eliminating within-family clustering.
Limitations and open questions
Several limitations bear directly on interpretation. The anchor-based labeling convention fixes a single reference per segment; sequential accumulation of variation across successive occurrences is not modeled, and results could differ under alternative references. Segmentation is rule-based, and the restriction of graph edges to within-segment pairs excludes potential cross-segment dependencies for tractability. The exclusion of the late period means claims about stylistic development cover only the early-to-middle trajectory; whether late-period transformation organization continues the observed reorganization remains untested under this scheme. Transformation families and features constitute one operational design—the framework admits alternatives, including expert or perceptually motivated labels—but the present findings are conditional on these definitions. Finally, inference relies on asymptotic sandwich approximations whose adequacy depends on the number of informative segments, which is limited for rare transformation pairs.
Conclusion
The paper provides a statistically grounded account of motivic transformation in symbolic music, demonstrating that transformation occurrences depend systematically on local musical features and exhibit structured, period-specific co-occurrence patterns. Its principal empirical finding is that the difference between Beethoven's early and middle periods resides less in which transformations occur than in how they relate within local contexts: uniformly negative cross-family associations in the early period give way to selective positive coexistence alongside persistent exclusions in the middle period. Methodologically, the work illustrates how multilabel CRFs with pseudo-likelihood estimation, permutation calibration, and sandwich-based uncertainty can support formal inference on annotated structural data organized into approximately independent contextual units, a formulation applicable beyond musicology to any corpus of sparse multilabel annotations with local dependence.