AN INFINITE FEELING, A FINITE LIBRARY

Library of Melodies

Every possible melody has an address.

Discover the idea behind the library ↓

Discovery settings

Require specific sounded notes (optional)

Enable to require multiple notes together. Position counts sounded notes, not rests: position 3 is the third played note. For example, require A for 1/16 at position 1 and B for 1/16 at position 3. Requirements apply to Discover only.

Settings apply when you click Discover, Find melody, or Find ID. Changing a control alone does not alter the displayed bar.

Your melody

One bar · 4/4

Generate or find a melody to display the score.

Melody address

Click Discover to generate a melody.

Numerical ID

—

Find a melody

THE STORY BEHIND THE LIBRARY

About Library of Melodies

Every possible melody has an address.

Inspired by Jonathan Basile's Library of Babel and the thought-provoking explorations of Michael Stevens (Vsauce on YouTube), Library of Melodies is an interactive project dedicated to mathematically exploring, generating, and indexing every possible musical sequence within a defined set of constraints.

At its core lies a simple but fascinating question: What if every possible melody within a single measure of music could be assigned a unique, permanent address?

Rather than storing an unimaginable number of musical sequences, the library uses mathematical algorithms to generate, identify, and retrieve them on demand. Every valid melody has a unique numerical identifier and musical address, allowing it to be discovered, revisited, and shared.

A universe of musical possibilities

35,041,899,898,882,876,336,112,595,553,275,974,641

Over 35 undecillion uniquely addressable musical sequences.

That's approximately 35 billion billion billion billion possibilities, all contained within one 4/4 measure.

Every sequence can be reconstructed from its permanent address, displayed in musical notation, and played directly in your browser, without a database holding every possible melody. The library is mathematically enumerated, not generated by artificial intelligence or selected from a catalog of existing compositions.

Some sequences may sound familiar, others surprisingly beautiful, and many entirely unconventional. All are valid inhabitants of this defined musical universe.

The mathematical boundaries

  1. Pitch range: 13 chromatic pitches spanning one octave, including both endpoints—for example, C4 through C5.
  2. Time signature: A single measure of 4/4, equivalent to four quarter-note beats.
  3. Rhythmic resolution: Events can be as short as a thirty-second note (1/32). Dotted notes, sustained durations, and rests are supported, provided the total duration fills exactly one measure.
  4. Individual note attacks: Consecutive notes of the same pitch remain distinct. Two successive 1/32 A notes are different from one sustained 1/16 A note.
  5. Rest normalization: Adjacent rests are combined into one rest of equivalent duration. Two consecutive 1/32 rests are represented as a single 1/16 rest.

These boundaries make complete enumeration possible, while giving every valid sequence a consistent representation and unique mathematical identity.

Discovering the library

Explore the library through random discovery or retrieve any valid sequence using a permanent musical address or numerical ID. Discovery controls include:

Each discovery can be viewed in standard musical notation and played in the browser. Discovery settings do not change a melody's identity or permanent address.

Mathematics meets music

Music expresses emotion and human creativity, yet every melody has an underlying structure of pitches, durations, intervals, and rhythms. Library of Melodies explores the intersection of these worlds.

How many distinct melodies fit into a single measure? How much of this musical universe has humanity explored? Could an unfamiliar combination inspire an entirely new composition? And what would happen if the boundaries expanded to more octaves, longer pieces, or simultaneous voices?

The library does not determine which melodies are beautiful, meaningful, or original. It provides a way to navigate possibilities from which new musical ideas may emerge.

Our vision

Library of Melodies is designed for musicians, composers, music enthusiasts, students, developers, and anyone curious about mathematics and music. Our ambition is to create an accessible platform for musical exploration, discovery, and creative experimentation.

Future developments may include note-position and duration constraints, melodic pattern searches, broader pitch ranges, personal collections, MIDI export, harmonization, chord progressions, and polyphonic arrangements.

Throughout that evolution, one principle will remain fundamental: every melody should retain a permanent, reproducible mathematical identity.

Library of Melodies is not meant to replace human creativity. It is an invitation to discover unexpected musical ideas within a vast mathematical landscape.

An unimaginably vast musical universe, waiting to be explored—one melody at a time.
Every melody has an address. The next discovery is yours.