More melodies need at most a 2 octave range (especially in pop), which limits us to 24 choices for each melody note.<p>(Actually less, if you factor in the constrains of the specific key the tune is in, but let's be maximalist and get an upper bound).<p>Now, a melody also comes with a rhythm / syncopation pattern, but let's just count simple 8th notes in our test case (one can consider a whole note as 8 consecutive "legato" 8th notes of the same pitch for our purposes).<p>How many bars? 8 bars might be a good starting point (many pop verses are that, eg: <a href="http://en.wikipedia.org/wiki/Thirty-two-bar_form" rel="nofollow">http://en.wikipedia.org/wiki/Thirty-two-bar_form</a> ).<p>So, that would gives us: 8 bars * 8 eights with 24 notes for each eight, which gives us roughly: (8*8)^24 different melodies.<p>Which is like, a lot, man (think 40-figure range).<p>In practice it could be from much less (considering key constraints which limits the notes you could use) to much more (considering higher than 2 octaves Zappa or avant-guard like melodies, durations shorter than 8ths, etc).<p>Another major factor is the "melodic quality" of the melody, which is kinda subjective. 8 bars of 8th C notes, for example, wouldn't be that interesting, and many people would not even consider them a melody.<p>Still that would leave billions of quality melodies in the millions of trillions of possible melodies.