Skip to main content
QUICK REVIEW

[Paper Review] Partitura: A Python Package for Symbolic Music Processing

Carlos Cancino-Chacón, Silvan David Peter|arXiv (Cornell University)|Jun 2, 2022
Music and Audio ProcessingComputer Science6 citations
TL;DR

Partitura is a lightweight Python package that simplifies symbolic music processing for music information retrieval (MIR) by enabling efficient parsing of MEI, MusicXML, Humdrum, and MIDI files into structured, MIR-ready data formats such as note arrays and piano rolls. It supports key music analysis tasks like pitch spelling, key signature detection, and voice separation, and uniquely handles score-to-performance alignments, making it ideal for researchers needing minimal musical expertise and high compatibility with machine learning pipelines.

ABSTRACT

Partitura is a lightweight Python package for handling symbolic musical information. It provides easy access to features commonly used in music information retrieval tasks, like note arrays (lists of timed pitched events) and 2D piano roll matrices, as well as other score elements such as time and key signatures, performance directives, and repeat structures. Partitura can load musical scores (in MEI, MusicXML, Kern, and MIDI formats), MIDI performances, and score-to-performance alignments. The package includes some tools for music analysis, such as automatic pitch spelling, key signature identification, and voice separation. Partitura is an open-source project and is available at https://github.com/CPJKU/partitura/.

Motivation & Objective

  • To reduce the barrier to entry for researchers in music information retrieval (MIR) by simplifying the processing of symbolic music data.
  • To provide a lightweight, efficient alternative to complex symbolic music libraries like music21, focusing on MIR-relevant data structures.
  • To enable seamless handling of multiple symbolic music formats (MEI, MusicXML, Humdrum, MIDI) and score-performance alignments.
  • To integrate essential music analysis tools—such as pitch spelling, key signature detection, and voice separation—directly into the data processing pipeline.
  • To support high-level MIR tasks through easy access to standardized, numerically efficient representations like sparse piano rolls and structured note arrays.

Proposed method

  • Parsing symbolic music files (MEI, MusicXML, Humdrum, MIDI) into native Python objects using dedicated internal representations.
  • Converting scores and performances into standardized MIR data structures: note arrays (as NumPy structured arrays) and piano rolls (as SciPy sparse matrices).
  • Supporting time resolution control via the `time_div` parameter to generate piano rolls at different temporal granularities (e.g., eighth or sixteenth notes).
  • Implementing music analysis tools in the `partitura.musicanalysis` module to infer pitch spelling, key signatures, voice assignments, and tonal tension from symbolic data.
  • Using heuristic and rule-based inference to recover missing musical information (e.g., pitch spelling, voice labels) in MIDI files treated as scores.
  • Enabling alignment between symbolic scores and MIDI performances at note- or time-level (e.g., beat and measure level), a unique feature among existing libraries.

Experimental results

Research questions

  • RQ1How can symbolic music data from diverse formats (MEI, MusicXML, Humdrum, MIDI) be uniformly parsed and represented in a way that supports MIR workflows?
  • RQ2What is the most effective way to extract commonly used MIR data structures—such as note arrays and piano rolls—from symbolic music representations?
  • RQ3Can lightweight, high-level music analysis tools be integrated into a data processing pipeline without requiring deep symbolic music representation?
  • RQ4How can score-to-performance alignments be systematically represented and computed in a way that supports downstream MIR tasks?
  • RQ5To what extent can missing musical metadata (e.g., pitch spelling, voice labels) in MIDI files be reliably inferred using rule-based methods?

Key findings

  • Partitura successfully parses and represents symbolic music from MEI, MusicXML, Humdrum, and MIDI formats into consistent, MIR-ready Python objects.
  • The package enables one-line extraction of note arrays and piano rolls with customizable time resolution, using efficient sparse matrix representations.
  • Music analysis tools such as pitch spelling, key signature detection, and voice separation are accurately inferred from symbolic data, even in MIDI files lacking explicit metadata.
  • Partitura uniquely supports score-to-performance alignments at both note- and time-level, enabling alignment-based MIR tasks.
  • The package reduces the need for manual preprocessing and musical expertise, streamlining data pipelines for MIR research.
  • The library is designed for performance and extensibility, with ongoing development focused on handling malformed files, parallel processing, and automatic score unfolding.

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.