Deriving Representative Structure from Music Corpora

Ilana Shapiro, Ruanqianqian (Lisa) Huang, Zachary Novack, Cheng-i Wang, Hao-Wen Dong, Taylor Berg-Kirkpatrick, Shlomo Dubnov, Sorin LernerarXiv 2025 · DOI

Abstract

This paper introduces the Structural Temporal Graph (STG), a unified data structure designed to capture the multi-layered hierarchy of music, ranging from melodic intervals to large-scale sections. By leveraging simulated annealing and SMT solvers, the proposed framework enables the calculation of structural distance between compositions and the synthesis of a "centroid" STG that represents the common architectural DNA of a music corpus. Experimental results demonstrate high correlation with human stylistic judgments and low error rates in structural recovery, offering a robust method for corpus-level musical analysis and summarization.

Introduction

Music is inherently hierarchical. A single piece consists of overlapping layers: melodies form motifs, motifs sit within harmonic contours, and these are organized into rhythmic patterns and large-scale sections such as verses and choruses. While existing algorithms can analyze these levels individually, two major gaps remain in the field of music informatics:

  1. Integration: Current models rarely capture the "vertical" relationships between these levels and the "horizontal" temporal relationships simultaneously.
  2. Summarization: There is a lack of mathematical frameworks to define the "average" structure of a music collection (e.g., the common architectural traits of 100 Mozart sonatas).

This research addresses these gaps by introducing a framework to represent, compare, and synthesize complex musical hierarchies, moving beyond individual song analysis toward corpus-level structural modeling.

Methodology

The Structural Temporal Graph (STG)

The core of this framework is the Structural Temporal Graph (STG), a $k$-partite directed acyclic graph. Each level of the graph represents a different musical feature, such as segmentation, motifs, keys, chords, and melody. Edges in the STG represent temporal containment; for instance, an edge might connect a "Chorus" node to the specific "Chord" nodes that occur within its timeframe.

The Structural Temporal Graph (STG) represents music as a multi-layered hierarchy where nodes represent features and edges represent temporal containment.

Structural Distance and Centroid Derivation

Comparing two STGs is treated as a Graph Edit Distance (GED) problem. Since GED is NP-hard, the authors utilize Simulated Annealing (SA) to find an optimal alignment between two graphs, allowing for a quantitative measure of structural similarity.

To summarize a corpus, the framework seeks a "centroid" graph that minimizes the distance to all other graphs in the set. This is achieved through a Bi-Level Simulated Annealing approach. The resulting approximate centroid is then "repaired" using an SMT solver (Z3) to ensure it obeys "musical physics"—global constraints such as "every chord must have a parent key" and "sections must form a continuous linear chain."

Datasets

The study utilized polyphonic symbolic MIDI piano music from the Kunstderfuge and Classical Piano MIDI datasets. The corpus included works by J.S. Bach, Mozart, Beethoven, Schubert, Chopin, Alkan, and Haydn. To ensure fair comparison, the researchers controlled for song duration, selecting pieces within 7 seconds of each other.

Results and Discussion

Human Alignment and Mathematical Accuracy

The "Structural Distance" metric was validated against the Classical Music Navigator, a ground-truth of stylistic similarity based on human annotations. The method achieved a Spearman’s rank correlation of $\rho_s = 0.8207$, significantly outperforming standard MIDI feature extraction and audio similarity metrics.

In controlled mutation tests, the simulated annealing approach recovered ground-truth distances with very low relative error. As shown in the performance analysis, the relative error remains minimal across various compositions even as mutation parameters increase, validating the robustness of the optimization approach.

Relative error of the structural distance metric across different musical works, demonstrating the robustness of the simulated annealing approach.

Corpus Characterization

The synthesized centroids successfully captured the "essential" structures of composers. For instance, the Mozart corpus centroid captured over 70% of the most common 5-node structural patterns found across his individual works. This suggests that the STG hierarchy is more than the sum of its parts; structural distance is most accurate when the entire hierarchy is preserved rather than ablated.

Conclusion

The STG framework provides a robust method for capturing and summarizing the hierarchical nature of music. While currently dependent on the quality of underlying analysis tools and symbolic MIDI data, future work aims to extend this to raw audio and generative applications. By using centroid STGs as templates, generative AI could potentially produce new music that strictly adheres to the structural "DNA" of specific composers or styles.

Summary updated

BibTeX
@misc{shapiro2025deriving,
  author = {Ilana Shapiro and Ruanqianqian (Lisa) Huang and Zachary Novack and Cheng-i Wang and Hao-Wen Dong and Taylor Berg-Kirkpatrick and Shlomo Dubnov and Sorin Lerner},
  title = {{Deriving Representative Structure from Music Corpora}},
  year = {2025},
  eprint = {2502.15849},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.15849},
}
Figure