MathVideo

Melody Math: Is Original Music Extinct?

Vanilla Ice ripped off Queen. MC Hammer copied Rick James. Lady Gaga’s latest sounds just like Madonna.

But is there nothing new under the sun? Is it possible that any music you write is always going to be a copy of something else, because everything is already written? Let’s stick some factorials on this question and find out.

Correction: I screwed up on the math for the number I mention at 6:33, defining the number of possibilities for a 3-note sequence. The number should be 397, not 66. My apologies!

Warning: There’s a lot of math here. If you’d rather skip the way we figured out how to get the answers and get to the answers themselves, skip ahead to 6:20.

Previous post

Apocamon

Next post

Mad Quickies 5.25

Ashley Hamer

Ashley Hamer

Ashley Hamer (aka Smashley) is a saxophonist and writer living in Chicago, where she performs regularly with the funk band FuzZz and jazz ensemble Big Band Boom. She also does standup comedy, sort of, sometimes. Her tenor saxophone's name is Ladybird.

15 Comments

  1. May 25, 2011 at 10:43 am

    I will admit to not having watched the whole thing yet, but thanks for this!

    Have you read the short story “Melancholy Elephants” by Spider Robinson? It’s very similar to your discussion here, only with more character development and less mathematics. http://www.spiderrobinson.com/melancholyelephants.html

  2. May 25, 2011 at 12:28 pm

    <3 math!

  3. May 25, 2011 at 1:12 pm

    Oh man, great video – nice job with the editing!
    .
    There’s a lot to explore in this space. It reminded me of one of an AI from Sam Ogden a while back [1], which had some awesome discussion going on (see especially all of VoxMachina’s comments).

  4. May 25, 2011 at 1:15 pm

    Whoops, ignore the “[1]”. I was going to make the link a footnote, but I hotlinked instead.

  5. May 25, 2011 at 3:51 pm

    Cool! I do have objections to the first couple sentences of your post, however. Vanilla Ice didn’t rip off Queen. He sampled Queen. Same for Hammer and Rick James. Your article is about how there are no new melodies, not about whether sampling is a legitimate form of musical expression. That is a different debate. Because the conclusion of your video is that there are enough combinations, and you encourage people to “be original,” it may be taken as an attack on sampling, which is not what I think you are going for. Instead of Ice and Hammer, “My Sweet Lord” is a better example: http://en.wikipedia.org/wiki/My_Sweet_Lord#Legal_controversy

    Anyway… nice video!

  6. May 26, 2011 at 4:50 pm

    Great video!

    I frequently struggle with this when I’m writing and a melody pops into my head, I always think “is this original? Or am i just recalling a melody from the tens of thousands of other melodies that I’ve heard?”

    I noticed that you didn’t mention rhythm as a component to melody (unless I missed it). How much do you think that affects things? I would think it’d be possible to arrive at a unique melody that may have the same pitches as something else, but can still be considered original.

  7. May 26, 2011 at 5:33 pm

    I’ve gotten this rhythm question a lot, from the first time I brought up this idea to the rest of the MAL crew up until the mass of youtube comments (always oh so much fun). Personally, I really think that unless the rhythm is drastically different, the same melodic sequence with a different rhythmic construction is still the same melody. My background is in jazz, and jazz musicians are always striving to play with the rhythm of a melody to “make it their own,” and no matter what one does with it, the basic melody always seems to shine through.

    Now, it’s true that in extreme cases the same melody in a different rhythm can sound vastly different (and on top of that, copyright law protects “order and duration of notes”), but it’s really a continuum of what will and won’t make someone perceive something as the same melody. An eighth-note difference does not a different tune make, but double the length of a few notes and put in a few lengthy rests and you may have a new song on your hands. How math can work this out is something I’m currently puzzling over.

  8. May 26, 2011 at 5:44 pm

    And I s’pose I should respond to @onzi, even though — full disclosure — this argument was something he sent to me privately on facebook and I told him to comment on the site to make me look good enhance the debate. This is what I responded with on facebook:

    I’m not making a judgement call on sampling, you’re right, but I am responding to a common argument used in its defense. “Who cares if [artist] borrowed from [artist]? Nobody can ever write anything original anyway, so why worry about it?”

  9. May 26, 2011 at 6:59 pm

    Sorry, didn’t even look at the YouTube comments.

    But I agree with you regarding rhythm. It’s something that would ultimately be up to the listener, and probably vary greatly based on aesthetics. Mathematically, you could maybe figure out some sort of probability by which a drastic enough change in rhythm would make a unique melody. I bet that probability would also increase with the number of notes involved.

    Although it isn’t really relevant to my point, I was reminded of this: http://soundcloud.com/birdfeeder/jurassic-park-theme-1000-slower

    There are still some recognizable sections of the “Jurassic Park” theme in there to be sure, but I think it’s an interesting experiment in morphing an existing piece of music into something different.

  10. May 26, 2011 at 9:01 pm

    This is easy to do with pitch, but only in the 12-tone equal tempered system. Step outside of that and quantifying pitch becomes nearly as difficult as quantifying dynamics and timbre.

    Even staying with 12 tone equal temperament but adding in harmony complicates the numbers pretty wildly – how many combinations of a four note melodic pattern are there when combined with a three note chord? Or split across a number of three note chords? Or how about taking the same melodic pattern but modifying it into different modal patterns? Or adding in independent counterpoint?

    If anything, asking these sorts of questions is futile if one expects a concrete answer, but they do help to reveal what people perceive as the important aspects of music. It’s tempting to ask what people do and don’t define as music, but in my experience this quickly turns even the friendliest forum into a ‘your favorite band sucks’ flamewar. Music is a complicated phenomenon involving aesthetics, acoustics, cognition, anthropology, and sociology, so such broad questions are extremely difficult to answer quantitatively (which you pretty much mention in the video anyway). Still a fun thought experiment, though, and actually opens up a doorway to aesthetics.

  11. May 27, 2011 at 10:52 am

    You’re speaking my language, VoxMachina. One melody over several chord structures is the main thing I plan on covering in the next video.

  12. May 27, 2011 at 7:58 pm

    @joshuazucker – It took me a while, but I finally read that short story. Beautiful! While I don’t necessarily believe that will happen to us, it’s a fascinating thing to think about, and wonderfully written.

  13. June 4, 2011 at 5:13 am

    About the rhythm thing. This goes much further than just a few notes being a bit longer or shorter. A melody can get very different when the notes get to be different at the strong counts of the measure. There’s also a big difference in the amount of swing a melody has. And don’t forget rests.

    Also, when you look at full melodies, they’re mostly build up from motives. One motive can be the same as in another melody, but if it’s only three notes, the other ones will be different. This of course can go on forever. You can make them as long as you like.

    And there is also a different in octaves. An interval of an octave can be used in a melody as well and gives character, not only colour. And also bigger jumps. But the development of the melody plays a big role too. A melody can end up an octave of maybe two higher.

    There’s also no specified time. A melody can be played in 64th notes if you like over a tempo of 200 bpm or whole notes (or longer) over a tempo of 10 bpm. They may be the same notes and have the same relation between them rhythmically, no one’s going to hear them as the same. Even half tempo.

    So for every possible order of notes (including intervals over the octave) you have the tempo, rhythm, context (chords). I imagine the numbers get insanely big.

  14. June 11, 2011 at 11:39 pm

    Leonard Bernstein wrote a book about this:

    http://www.amazon.com/Infinite-Variety-Music-Leonard-Bernstein/dp/1574671642

    I read it years ago so I don’t really remember his arguments. He did go into the math involved in musical variety but at the time I didn’t look into it enough to see if he got the numbers right. His thesis, as implied by the title, was that there is so much variety in all the variables of music that the possibilities are effectively infinite.

    I do remember thinking at the time that there’s an issue as to what exactly can most folk perceive as a unique melody? If you have an eight note sequence and you raise the third note by a semitone will people perceive them as two unique entities? Sure, I think they would if you play them sequentially. But what about if they are heard a day apart, a week apart or a year apart? This question goes beyond simple, and not so simple :), math. It also speaks to human perception of uniqueness.

  15. July 3, 2011 at 12:53 pm

    Hi saw the video and thought I would do a bit of calculation on my own since I am a math student.

    Over to my assumptions. Every assumption I make, I try to make on the conservative side so the number I come up with will probably be an underestimation. I assume every melody possible is built up of 12 notes. These notes can then be combined to form harmonies that consists of up to 4 notes each. Then I assume that every melody can be played in up to 30 different ways depending on the pitch you are using. Remember this will only be an estimate. Then I assume that between every note you must have an interval of time before the next. I say that you only are allowed to have up to 4 beats before playing the next note an that you can have as little as 1/16 an everything in between.

    This means that you can have 12!/(12-4)! different harmonies (although a lot of them certainly are disharmonious). We call this number h.

    For all the different time intervals you have first 1/16, then 2/16 and so on up to 64/16 = 4 beats. This means you can have 64 different time intervals in between the “tones”. We call this number p.

    That means that for a melody consisting of n “tones” where every tone is a is a combination of notes (from 1 note up to 4 notes), you can have h^n combinations of harmonies.

    Between every harmony you can have p different time intervals. This means that for a certain combination of harmonies in a melody consisting of n “tones” you can have p^(n-1) different combination of time-intervals (because there are n-1 time intervals).

    If we add this reasoning together we get that for a melody consisting on n “tones” we can have
    h^n*p^(n-1) combinations of harmonies and time-intervals. Because we could play any such combination by assumption in 30 different ways that all sound the same (different pitch) we have to divide by 30. This leaves the general formula for different melodies of n “tones”

    a(n) = (p^n*h^(n-1))/30

    But as you say in your video you have to do this individually for every number of notes. This means you have to do a sum. So if you want the number of melodies you can get from up to m “tones” you get.

    a(1) + a(2) + … + a(m) = sum(i_1^m) a(i)

    If we then assume that for every melody it takes one person at least one second figuring out one tone. Then for a melody of n “tones” it takes _minimum_ n seconds. If we then count the seconds it takes to compose all the different melodies that consists of up to m “tones” we get

    number of seconds = a(1)*1 + a(2)*2 + … + a(m)*m

    Because more people can be working on melodies than one we have to divide by the number of people. Currently there are about 7.1*10^9 people in the world after http://www.ibiblio.org/lunarbin/worldpop. So we divide by 8*10^9 to be sure, and call this number H (Humans).

    number of seconds for all humans in the world =
    (number of seconds)/H

    If we want this in years we simply divide by the number of seconds in a year (60*60*24*365) which we call y. Putting it all together we get

    number of years to create all possible combinations of melodies consisting of up to m “tones” =
    (a(1)*1 + a(2)*2 + … + a(m)*m)/(y*H)

    Now I made a c++ program to calculate this (because I’m a nerd and found this fun) and the source code is below:
    #include
    #include

    using namespace std;

    double a(double n);
    double fac(double tall);

    int main () {
    double H = 8*10^9, y = 60*60*24*365, m = 0;
    cout <> m;
    double ans = 0;

    for (int i = 1; i <= m; i++) {
    ans += a(i)*i;
    }

    ans = ans/(H*y);

    cout << "Number of melodies up to " << m << " is: \t" << ans << endl << endl;

    return 0;
    }

    double a(double n) {
    double p = 64, h = fac(12)/fac(12-4);
    return (pow(p, n)*pow(h, n-1))/30;
    }

    double fac(double tall) {
    if (tall == 0)
    return 1;
    return tall*fac(tall-1);
    }

    The conclusion was then that is you had every person on earth making melodies, taking 1 second to create one "tone" of the song, with our conservative assumptions, it would take 5.6*10^280 years for them to exhaust every possibility. THIS IS AN INSANELY HUGE NUMBER! It is larger than for any human mind to get a firm grasp on how large it is! To put it in perspective; the age of the universe is about 13.75 Gigayears = 19*10^9 years. So you have that the time it takes to exhaust all options is inconceivably longer than the inconceivably long age of the universe! Hence I would argue that it is practically infinitely large. For all practical purposes it is infinite, but technically it is finite (and HUGE).

    Because it is so long I would argue that IF some civilization exhausted all posibilities, by the time they were done they would have forgotten the first ones. More than that. It would be no measurable trace of it ever to have existed in the universe. So yes. It would be practically impossible to exhaust all options, and you don't have to be afraid about it in your lifespan, or your childs lifespan, or any potential grandchild that would have any resemblence to anything human (due to evolution we would probably evolve to something completly different (or become extinct by the time it is proper for us to worry).

Leave a reply