(PC recommended)

*March 2020*

This program calculates how many possible songs you could write in one measure of music, depending on configurable settings like the time signature.

The project was inspired by this Vsauce video from 2012:

In the video, Michael cites an article from 2000 that uses music theory to answer the question of how many songs could possibly be written. Here is that article:

Visit "How many melodies are there in the universe?"To define some boundaries around the problem, the author limits the possible songs to songs that are only one measure long, with a 4-4 time signature (common time), and with only 12 possible notes/pitches that are no shorter than 32nd notes. Notes also can't overlap to make chords, so this calculation would be appropriate for monophonic instruments like wind instruments.

It's a great article, but I was curious about what the total number of combinations would be if you use different parameters from the author's (like different key signatures). That's why I made an interactive calculator, with configurable settings. The calculator uses this formula, which I'll hopefully explain in a future video:

Total possibilities = (number of pitches + 1) * ( (number of pitches + 2) ^ (smallest note duration [as an integer] - 1) )

If you plugged in the parameters from the article, my formula would give you this answer:

Total possibilities = (12 + 1) * ( (12 + 2) ^ (32 - 1) )

Total possibilities = 4,404,660,688,698,196,366,793,268,778,376,364,032

That number *would* match the article's answer, if not for the fact that the article also allows the notes to slide from one pitch to a different pitch, like you'd do on a trombone, and my formula doesn't allow for that.

Music is a lot more nuanced than either formula accounts for. Most songs have a lot of things that neither formula takes into account, such as:

- Chords
- More than one instrument
- Changes in volume
- Changes in tempo
- Specific vocal intonations
- Lyrics
- Percussion
- Player instructions, like:
- Legato
- Staccato
- Vibrato
- Pizzicato
- And many, many other things

These factors would explode the number of possibilities far past the thirty-seven-digit number above. Overall, there isn't really a single objective way to answer the question "how many songs could possibly exist?", but I think my answer could at least be considered a good lower bound, and it's a very big lower bound.

My calculator can't do a lot of things, but it can at least account for songs that have tuplets, like triplets and quintets. For example, you could allow for quarter-note triplets (aka crotchet triplets) by entering a "sixth" note as the custom smallest duration (or some multiple of six). That's because you could think of a quarter-note triplet as being one third of a half note, and 1/3 * 1/2 = 1/6.

The calculator also allows you to change the time signature, which I wanted to mention because you may not notice it at first.