Music Theme Generation

All projectsWorking demo

Browse classical themes, inspect their notation, and generate new musical ideas in Theme Lab.

Markov + transformer · MIDI + notation

An original notation excerpt displayed in Theme Lab.

A score excerpt from Theme Lab. Explore and play the themes in the demo.

Overview

How can a computer generate a short musical idea with a recognizable shape? Music Theme Generation explores this question through a corpus of classical themes and an interactive application, Theme Lab.

Try Theme Lab on Hugging Face

Explore the themes

The project draws on Harold Barlow and Sam Morgenstern’s A Dictionary of Musical Themes, a catalogue published in 1949 to help readers identify works from their opening melodies. Theme Lab makes nearly 10,000 themes available to browse, inspect as notation, and play. Search by composer or title, explore different keys, and download examples as MIDI or ABC notation.

Generate new examples

The application offers two approaches: a variable-order Markov model and a small transformer model. They provide different ways of learning from the corpus and producing new sequences of pitches and durations. The Markov generator uses regular constraints to control properties of the resulting sequence.

Choose an engine, adjust the generation settings, and inspect and listen to the results. The aim is to make musical generation something that can be explored through concrete examples.

Work in progress

The demo is usable, and the research continues. There is no dedicated published paper on this project yet. The two generators are experimental tools; their presence in the same application does not constitute a controlled comparison of their musical quality.

The constrained Markov approach connects this project to my continuing work on Markov Constraints.

Open the demo · All projects