And if so, how close are we to reaching the limit?

In: 8

A piano has 88 keys, one for each tone that can be played in a melody, so it’s a good instrument to use as an example for this.

So, composing a new song, for each note you have 88 possible choices. That means there can be 88 one-note “songs”, 7744 two-note “songs”, 600,000 3-note “songs”, 60 million 4-note “songs”, 5 billion 5-note “songs”, and the number increases rapidly the more notes are added.

However, even for a long song (many many notes in it), you still have a *finite* number of unique combinations. Huge number, but not infinite. The problem is that there’s no restriction or rule to the number of notes you could have in a song, so in theory you could decide to “make your song unique” by just moving the goal-posts and increasing “the number of notes”, to infinity really, your song could “never end”. Doing that would actually give you an infinite number of possible unique songs.

Realistically though, melodies that actually sound like “actual music” and can clearly be classified into a genre, yeah there’s a finite number of those. Enormous number, though, I don’t think we’re anywhere close to reaching it.

There is a theoretical upper limit of songs of a given length. Here are details from another Reddit post by ericGraves:

Composed? No. The space of time limited [continuous signals](https://en.wikipedia.org/wiki/Continuous_signal) is of course uncountably infinite.

Differentiated? Yes. To explain this, we have to make two assumptions,

* each song can be reproduced with some maximum amount of power,

* there will be noise added to the signal (which we will assume is [Gaussian](https://en.wikipedia.org/wiki/Gaussian_noise))

* that all sounds outside our hearing range are immaterial to use and can not be used to differentiate songs.

We will say this maximum amount of signal power to noise power is S, while the range of human hearing (about 20 to 20 KHz) is W. With these definitions, there are at most

2^(TW log[1 + S])

T-second songs that can be reliably differentiated between.

This observation is in essence, the [Shannon-Hartley theorem](https://en.wikipedia.org/wiki/Shannon%E2%80%93Hartley_theorem). In more detail, any bandlimited^([1]) (occupying finite frequency range) signal can be reproduced using a version of the signal sampled in time at frequency of 2W. [See here for a graphical representation of this, the middle on the right being the time sampled version of the top left.](https://www.tutorialspoint.com/signals_and_systems/images/signal_sampling.png). This is, in essence, the [Nyquist Shannon Sampling theorem](https://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem). Hence allowing us to replace this continuous signal, with a vector of length

samples = seconds (samples/second) = T (2W)

At this point we have a vector of length 2TW. For every possible song that could be differentiated, we can associate a binary sequence of length *c*. If this sequence was length 3, then 2^3 = 8 songs could be reliably distinguished. Now note that

log(number of songs)/vector length = bits/symbol.

The maximum number of bits/symbol is a well studied metric, called [the channels capacity](https://en.wikipedia.org/wiki/Channel_capacity). For the case of Gaussian noise, *c* = 2^(-1) log(1 + S), where S at the outset.

Thus the capacity defines the maximum number of differentiable signals subject to the noise, and the sampling theorem the maximum number of discrete points needed to represent the continuous bandlimited function. Multiplying the two quantities gives a maximum number of

2^(TW log[1+S] )

T-second songs. You can also approach this problem from a [rate distortion](https://en.wikipedia.org/wiki/Rate%E2%80%93distortion_theory) perspective (ie every song within a certain distortion is equally likely, so I just need to pick the minimum number of songs to represent them all), and end up with the same result.

[1]- All bandlimited signals are infinite in time. To account for this nuance you should technically use [prolate spheroidal functions](https://en.wikipedia.org/wiki/Prolate_spheroidal_wave_function). The result is unchanged, you need a vector of 2TW for representation.

edit- As /u/DevestatingAttack pointed out, screwed up my units originally. Had bits of song instead of songs. Changed from TW log[1+S] -> 2^(TW log[1+S]).

Yes, but that number is so huge that you may as well ask if there are a finite number of grains of sand on the beach.

There are only seven chords, meaning that there are only so many ways to put those chords together in a pattern. However, each of those chords has a whole pile of variants, including majors, minors, sharps, sevenths, etc. There are still a finite way to put these together, but it’s a lot bigger now than it was at the beginning of this paragraph when you only had seven.

Then we have tempo. Playing a chord pattern slowly vs fast makes a huge difference and can result in a completely different song.

But the most important thing is the rhythm and phrasing. I can play the chords C, D, and E in the most basic and even way possible, each one held for four beats, and it will sound good enough to write a song. You might take those same chords and chop it up a bit. Maybe you play three C chords in quarter notes and then a D held out for four beats, followed by E with some sort of embellishment guitar lick at the end, all at a faster tempo than mine. You and I have just written two entirely different songs with the same three chords.

And then we add lyrics… maybe I’m writing a love song over those three chords while you’re writing a historical ballad about the French Revolution. Same three chords, but now we are in entirely different arenas while both remaining in the same genre, let’s say indie rock artists.

And then finally we both take our separate songs to our separate bands and begin to build on them. You decide to play your song angry and loud, with a killer guitar solo in the middle. I decide to whisper into the mic while a violin plays softly over my song and use minimal percussion.

So now we have two songs that are C,D, and E, and they are nowhere near the same song.

For the record, I’ll probably like your song better.

Songs are differentiated by their melody, harmony, meter, rhythm, and formal structure. There are enough variable parameters that we’re not going to run out of possible variations

Being a fixed number of notes you could be limited there, but the length could continue to extend to make longer versions of the same song making them different.

Really the factor that makes it a finite number is that eventually the heat death of the universe will occur and there won’t be people to create said music.