Skip to main content
QUICK REVIEW

[Paper Review] MusPy: A Toolkit for Symbolic Music Generation

Hao‐Wen Dong, Ke Chen|arXiv (Cornell University)|Aug 5, 2020
Music and Audio ProcessingComputer Science33 references23 citations
TL;DR

MusPy is an open-source Python toolkit for symbolic music generation that streamlines data I/O, preprocessing, dataset management, and model evaluation. It enables cross-dataset generalizability analysis, revealing that models trained on large, diverse datasets like LMD generalize better, and combining heterogeneous datasets improves model robustness and generalization across domains.

ABSTRACT

In this paper, we present MusPy, an open source Python library for symbolic music generation. MusPy provides easy-to-use tools for essential components in a music generation system, including dataset management, data I/O, data preprocessing and model evaluation. In order to showcase its potential, we present statistical analysis of the eleven datasets currently supported by MusPy. Moreover, we conduct a cross-dataset generalizability experiment by training an autoregressive model on each dataset and measuring held-out likelihood on the others---a process which is made easier by MusPy's dataset management system. The results provide a map of domain overlap between various commonly used datasets and show that some datasets contain more representative cross-genre samples than others. Along with the dataset analysis, these results might serve as a guide for choosing datasets in future research. Source code and documentation are available at https://github.com/salu133445/muspy .

Motivation & Objective

  • To address the lack of a unified, extensible toolkit for symbolic music generation that standardizes data handling and evaluation.
  • To enable reproducible and efficient research by providing consistent interfaces for diverse music datasets, formats, and representations.
  • To analyze statistical and structural differences across 11 commonly used symbolic music datasets.
  • To evaluate cross-dataset generalizability of music generation models and guide dataset selection.
  • To investigate whether combining heterogeneous datasets improves model generalization.

Proposed method

  • MusPy provides a central 'Music' object to represent symbolic music in multiple formats, abstracting low-level data representation.
  • It supports I/O for 11 datasets in various formats (MIDI, MusicXML, ABC, etc.) with automated downloading and parsing.
  • The toolkit includes standardized preprocessing pipelines and evaluation metrics for music generation, including perplexity and alignment-based metrics.
  • Cross-dataset generalizability is evaluated by training autoregressive models (e.g., LSTM) on one dataset and testing on others, measuring held-out likelihood.
  • Stratified sampling is applied when combining datasets to mitigate class imbalance and improve generalization.
  • Statistical analysis of dataset characteristics (e.g., duration, genre, polyphony) is performed to compare diversity and structural properties.

Experimental results

Research questions

  • RQ1How do the statistical properties of commonly used symbolic music datasets differ in terms of duration, genre, polyphony, and note distribution?
  • RQ2To what extent can models trained on one dataset generalize to other datasets, and what factors influence this generalizability?
  • RQ3Does combining multiple heterogeneous datasets improve the generalization performance of music generation models?
  • RQ4Which datasets serve as better pretraining sources due to their cross-genre and structural diversity?
  • RQ5How does dataset size and representation type (monophonic vs. multi-pitch) affect model perplexity and generalization?

Key findings

  • The Lakh MIDI Dataset (LMD) exhibits the best cross-dataset generalizability, likely due to its large size and cross-genre diversity.
  • Models trained on multi-pitch datasets generalize well to monophonic datasets, but not vice versa, indicating a hierarchy in representational complexity.
  • The JSBach Chorale Dataset shows poor generalization to other datasets, possibly due to its fixed quarter-note resolution and homogeneous note duration distribution.
  • NES Music Database poses a significant generalization challenge, with most models achieving high perplexity, likely due to its distinct game music characteristics.
  • Combining all 11 datasets improves generalization across most targets, and stratified sampling reduces bias toward larger datasets while lowering perplexity on smaller ones.
  • Perplexity correlates positively with dataset size within both monophonic and multi-pitch groups, indicating that larger, more diverse datasets are harder to model.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.