MusPy: a shared layer for symbolic music generation pipelines
A toolkit for symbolic music generation
At a glance
- What is it?
- MusPy is an MIT-licensed Python library that standardises the boring middle of a symbolic music generation pipeline: dataset download and preparation, format conversion, representation conversion, and objective evaluation. It is a utility library, not a model, and its value depends on whether your pipeline already has those pieces.
- Who is it for?
- Adopt MusPy if you are building a symbolic music generation system and want the dataset, I/O, representation and evaluation layers to match published work instead of hand-rolling them. Do not adopt it if you need a trained model, an audio-first pipeline, or anything with an active release cadence, since the newest release listed is v0.5.0 from April 2022.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Activity is slowing. The repository last received commits 6 months ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.
DEEP OPEN-SOURCE ANALYSIS
The gap MusPy fills sits between the dataset and the model
The README describes a music generation pipeline as data collection, data preprocessing, model creation, model training and model evaluation, and observes that some components need to be customised per model while others can be shared. MusPy targets the shared ones. Concretely, it ships a dataset management system for commonly used datasets, data I/O for MIDI, MusicXML and ABC, implementations of the pitch-based, event-based, piano-roll and note-based representations, and evaluation tools including audio rendering, score and piano-roll visualisation, and objective metrics. The stated motivation is reproducibility: when several papers each implement their own version of a piano-roll conversion or a metric, results stop being comparable. The intended user is a researcher or engineer training a symbolic music model who would otherwise write the same conversion and metric code a fourth time. It is explicitly a utility library, and the disclaimer is blunt about the dataset side: MusPy downloads and prepares public datasets but does not host them, vouch for their quality or fairness, or claim you have a licence to use them.
How the pieces connect: datasets in, representations through, metrics out
The architecture implied by the feature list is a set of layers rather than a single pipeline object. At the bottom, a dataset management system handles download and preparation for named datasets and exposes interfaces to PyTorch and TensorFlow, so a dataset can be fed to a training loop without a bespoke loader. Above that, data I/O reads and writes symbolic formats (MIDI, MusicXML, ABC) and also bridges to other libraries: music21, mido, pretty_midi and Pypianoroll are named as interfaces. That bridging matters more than it first appears, because it means MusPy can act as a conversion hub rather than a walled garden: you can keep using music21 for the parsing you already trust and still route the result through MusPy's representations. The representation layer is where the modelling assumptions live, and the README lists four: pitch-based, event-based, piano-roll and note-based. The evaluation layer sits at the end and covers audio rendering, score and piano-roll visualisation, and objective metrics. Note what is absent from that stack: there is no model, no training loop, and no claim about generation quality. The library defines the vocabulary and the measuring instruments, not the music.
Installation and the commands the README actually gives
The installation instructions are two lines. For a normal install, run pip install muspy. To build from source, download the release archive and run python setup.py install. That is the entirety of the setup guidance in the README; there are no environment variables, no config file and no service to start. Documentation lives at salu133445.github.io/muspy and in the code as docstrings, which is the practical place to look for the dataset names, the representation class names and the metric function signatures, since the README does not enumerate them. The library is pure Python and listed under the Python language with an MIT licence, so there is no compilation step to worry about beyond what your chosen backend needs. If you use MusPy in published work, the README asks you to cite the ISMIR 2020 paper by Dong, Chen, McAuley and Berg-Kirkpatrick, and links the paper, slides, poster, video and arXiv preprint. Budget for that citation as part of adoption if you are in an academic setting.
The dataset disclaimer is the sharpest constraint in the project
Most library disclaimers are boilerplate. This one is not, because dataset management is a headline feature. MusPy will download and prepare public datasets on your behalf, and the README states plainly that the project does not host or distribute those datasets, does not vouch for their quality or fairness, and does not claim you have a licence to use them, placing that determination on you under each dataset's own licence. That is a real operational constraint, not a formality. If your organisation has a policy about training data provenance, the fact that a helper function fetched the corpus does not answer the policy question, and the library is telling you so in advance. The README also invites dataset owners to open a GitHub issue if they want an entry updated or removed, which is a reasonable maintenance channel but also a reminder that dataset availability can change under you. Treat the dataset layer as a convenience wrapper over sources you still need to clear yourself.
Release cadence is the thing to check before you depend on it
The releases listed are v0.3.0 in January 2021, v0.4.0 in October 2021 and v0.5.0 in April 2022. The repository is not archived and shows activity well after that, but no newer release is listed in the material available here, so anyone pinning a version should assume the tagged releases are old and decide whether they are willing to track the main branch instead. This is a common shape for academic tooling: the paper lands, the library stabilises, and the release tags stop moving while the code does not. The practical consequence is that bug reports and format edge cases may be fixed on main without ever appearing in a version you can pin. For a research prototype that is tolerable. For a pipeline you intend to freeze and hand to someone else, it is a reason to vendor the specific commit you validated rather than depend on a version number. The MIT licence itself is permissive and imposes no copyleft obligation on your own code, though the datasets MusPy fetches carry their own terms, which is a separate question from the library licence.
Where MusPy is the wrong tool, and what to use instead
MusPy is the wrong tool if you need a model. It provides no architecture, no pretrained weights and no training loop; the README frames it as essential tools for developing a music generation system, which is a statement about scaffolding, not about generation. If your goal is to produce music rather than to build and measure a system that produces music, you will spend your time on the wrong layer. It is also the wrong tool for audio-first work: the representations are symbolic (pitch, event, piano-roll, note) and audio appears only as rendering for evaluation, so a pipeline built around waveforms or spectrograms gets little from it. For the parsing and manipulation of symbolic scores themselves, music21 is the established alternative, and MusPy's own README lists an interface to it rather than positioning against it. The difference in approach is worth stating: music21 is a musicology-oriented toolkit for analysing and manipulating scores, while MusPy is organised around the machine learning pipeline, with dataset management, tensor-friendly representations and objective metrics as first-class concerns. Many projects will reasonably use both, with music21 doing the parsing and MusPy handling representations and evaluation.
Who should adopt it, and what to verify first
Adopt MusPy if you are building a symbolic music generation system and want the dataset, I/O, representation and evaluation layers to line up with published conventions rather than with your own inventions. The reproducibility argument in the README is the strongest one: standard representations and standard metrics are what make two systems comparable at all, and reimplementing them privately guarantees that your numbers mean something slightly different from everyone else's. Do not adopt it if you need a trained model, an audio-domain pipeline, or a dependency with a predictable release schedule. Before you commit, verify three specific things in the documentation at salu133445.github.io/muspy: the exact list of datasets the management system prepares and whether your target corpus is on it, whether the PyTorch and TensorFlow interfaces cover the representation you intend to use, and the licence of every dataset you pull through the library, since the project disclaims responsibility for that and will not answer it for you. If your work is published, add the ISMIR 2020 citation to your references at the same time you add the dependency, because the README asks for it.
Editorial conclusion
Adopt MusPy if you are building a symbolic music generation system and want the dataset, I/O, representation and evaluation layers to match published work instead of hand-rolling them. Do not adopt it if you need a trained model, an audio-first pipeline, or anything with an active release cadence, since the newest release listed is v0.5.0 from April 2022. Before committing, verify three things against the current documentation: which datasets the management system actually prepares, whether the PyTorch and TensorFlow interfaces cover the representation you plan to use, and the licence of each dataset you pull, because the project explicitly disclaims any responsibility for that.
Community notes