In an era when millions of songwriters upload music to the internet—and just about any song can be plucked from obscurity by TikTok teens—it seems inevitable that the same melodies end up in different songs. There have been a number of high-profile music copyright-infringement cases, including a multimillion-dollar decision against Katy Perry for her song “Dark Horse.” A jury found that she’d infringed upon the copyright of Flame, a Christian rapper who’d posted a song with the same melody to YouTube, even though Perry insisted that she’d never heard of the song or the rapper. For some musicians, musicologists, and lawyers, the verdict felt scary; after all, large numbers of songs now live on SoundCloud and YouTube. It became thinkable to ask: Could the world run out of original melodies?
Damien Riehl and Noah Rubin were two of those worried musicians. Riehl is a lawyer who has worked on copyright. Rubin is a coder. They were hanging out after a long day at work when a “a lark, a thought experiment” occurred to Riehl: Maybe they could exhaust all possible melodies—and in so doing, protect musicians from being sued for copying songs they don’t remember hearing.
On the one hand, they can’t really create them all. A melody, simply put, is a sequence of notes. If you’re talking about all the notes and all the traditions of music around the world, the combinatorics yields functionally infinite possibilities for the melodies that result. Take just the 88 notes on a piano and, for instance, 12-note sequences. You get 216 sextillion melodies. And of course, that’s only within the Western tradition, in which these particular frequency ranges are considered notes.