Learning and Visualizing Music Specifications Using Pattern Graphs

Rafael Valle, Daniel J. Fremont, Ilge Akkaya, Alexandre Donzé, Adrian Freed, Sanjit A. SeshiaISMIR 2016

While machine learning has made significant strides in music generation, the resulting models often function as "black boxes," providing little insight into the underlying rules of a musical style. This paper, presented at ISMIR 2016 by researchers from UC Berkeley, adapts "specification mining" from software engineering to automatically extract formal, human-interpretable rules from music data. By representing these rules as Pattern Graphs, the authors provide a framework for style validation and constrained machine improvisation.

The Problem: Interpretability in Music AI

Describing musical rules manually is a daunting task due to the multidimensional nature of music. While modern AI can mimic styles, it lacks transparency. Existing pattern discovery algorithms often face computational bottlenecks (NP-hardness). This research seeks a middle ground: a system that learns formal mathematical specifications that are both computationally efficient and easy for humans to visualize and understand.

Methodology: From Features to Pattern Graphs

The core innovation lies in a three-step process to build a Pattern Graph:

  1. Feature Extraction: Symbolic (MIDI) or audio data is processed to extract features such as pitch, duration, and chord degree.
  2. Pattern Mining: The system identifies three primary idiomatic patterns:
  3. Followed (F): Event $a$ is immediately followed by $b$.
  4. 'Til (T): Event $a$ repeats one or more times before transitioning to $b$.
  5. Surrounding (S): Event $a$ appears both before and after $b$ (e.g., a neighbor tone).
  6. Graph Construction and Merging: These patterns form a directed multigraph where nodes are musical states and edges are the discovered patterns. To maintain clarity, the authors use Pattern Merging, where complex patterns (like 'Til') subsume or replace simpler transitions.
Figure 1: A basic Pattern Graph showing transitions (F) between Consonant and Dissonant states.

Key Insights: Music as Logic

By treating music as a formal language, the authors utilize "Control Improvisation"—a framework originally developed for robotics—to impose "hard" and "soft" constraints on generative systems. This allows for the quantification of musical style through a Violation Ratio: the frequency with which a piece breaks the mined rules of a reference style. Unlike a neural network, a Pattern Graph can be plotted, allowing a musician to see exactly how a style resolves dissonances or handles repetitions.

Figure 5: A complex Pattern Graph representing learned specifications. The labels (F, TF, STF, SF) illustrate how simple transitions are merged into more complex idiomatic patterns.

Results and Applications

The system was evaluated on several datasets, including blues and classical music. Key findings include:

  • Style Validation: The system successfully distinguished genres. For instance, Baroque and Romantic pieces showed lower mutual violation ratios compared to Rock or Rap, confirming that the mined rules captured genre-specific traits.
  • Improved Improvisation: Generative models constrained by Pattern Graphs produced music with significantly higher melodic similarity to training data and better harmonic coherence than unconstrained models (like a standard Factor Oracle).
  • Quantifiable Accuracy: Mined blues specifications generalized well to unseen test data, with a low average violation ratio of approximately 0.02 per song.

Conclusion and Future Work

Pattern Graphs offer a powerful, interpretable alternative to black-box music models. While currently limited by dataset size and discrete state representations, the authors plan to expand the system to handle continuous audio data using Gaussian Mixture Models (GMMs), allowing for more nuanced analysis of fluid musical features.

Summary updated

BibTeX
@inproceedings{valle2016learning,
  author = {Rafael Valle and Daniel J. Fremont and Ilge Akkaya and Alexandre Donzé and Adrian Freed and Sanjit A. Seshia},
  title = {{Learning and Visualizing Music Specifications Using Pattern Graphs}},
  booktitle = {ISMIR},
  year = {2016},
}
Figure