Sunday, November 27, 2011

Gonna need a bigger ipod...

When I was a kid taking piano lessons and starting to write small pieces I remember talking to an adult who was a bit less excited about music.  "Eventually we'll run out of new songs altogether.  There are only so many notes, and only so long of a piece that people can tolerate. Musicians copy each other a lot already."  I was initially shocked by this, but as much as I disliked it, it seemed to make sense.  I began to wonder how much music was really left to be found.  Was this really true, or just an assertion based on general musical disinterest?

Knowing a little more math than I did then, I can think about the question a bit differently now.  Here's my shot at figuring out how many songs there are to be found:

First of all, I'll be using simple counting techniques that that most people learn in middle or high school.  Nothing fancy.  For example: if a person rolls two six-sided dice (with different numbers/characters on each face of each die) the number of possible combinations is equal to:
  6 x 6 = 36
Add another die with unique characters and you just multiply by 6 again.  Simple.

Well, we can put some limits on what constitutes a musical piece.  To keep things manageable, we'll limit the length of a piece to 3 minutes.  Also, we'll cut out sounds above 20kHz, since that's beyond the range of human hearing.  For resolution we'll use 16 bits, since that's good enough for CDs.  We'll only handle mono stuff; the second channel added by stereo may inflate the numbers artificially.

So we'll find the total number of unique mono CD quality recordings that fit within 3 minutes.  Each bit can be one of 2 possibilities (a 1 or a zero), so our base will be 2.

2^(16 bits per sample x 44,100 samples per second x 3 minutes x 60 seconds per minute)

2^127008000 = 2^(1.27 x 10^8) = 10^(38234000)

Okay, so take a 2 and double it more than 100 million times.  That's a lot of twos.  Or 10 raised to the 38 millionth power, if you prefer.  But what does it mean?  It means that there are that many different 3 minute songs that you could record at CD quality.  It would take about 25 billion years to play them all back one after the other (unless I've made a mistake in my arithmetic, which is very possible).  Right now, though, the difference between one unique song and the next could be the addition or omission of the slightest pop or crackle, or delaying everything by a fraction of a second, or any of a number of other trivial changes.  

So, let's try a more constrained estimate based on musical principles.  We'll look for the number of unique melodies that exist.  We'll limit the possibilities to 8 measures of 4/4 with the equal tempered chromatic notes over 2 octave (25 notes).  The fastest note that we'll allow is a sixteenth note.  Let's see what we get:

25^(16 notes per measure x 8 measures)
10^(128 x log10(25))

Okay, so now we have a lot of tens, but not NEARLY as many as the 3-minute songs that we counted earlier.  Again, this time we weren't counting full songs, but melodies, which some might consider the basis of a song.  So, how much is 10^179?  Well, wikipedia is telling me that there are 10^80 atoms in the known universe.  That means that if each atom in the universe were actually a portal to another universe of equal size, each of the atoms in each of the universes would have their own 8-bar melody, and there would still be a lot left over.

So, if there are any readers that I haven't yet scared away with math, here is today's piece of music recorded over the Thanksgiving holiday:

Penta gone by are.kay.more


  1. All I heard was "music BLAH math BLAH BLAH numbers BLAH BLAH BLAH"

    Oh look! cool music! like!

  2. So I guess if I ever write any music it won't take away from the possibilities left to others. That's reassuring.

    Great music. I really enjoyed 0:40 to 1:10 or so. And the mathematician enjoyed the infinite series at the end.