Could there come a time when all possible new melodies have already been composed?
Let’s place some restrictions on “melody”. Let’s restrict melody to a 12-note succession of pitches with various durations within an octave. This is not arbitrary as most melodies are within those parameters. We can also limit a tune to its most characteristic first phrase or even a part of it, i.e. enough pitches to recognize it. Using whole melodies would swell the numbers below to even higher levels by many orders of magnitudes.
To figure out how many different possible permutations of those 12 pitches could exist we start by randomly selecting a starting note and then finding out how many “next steps” are possible from it to form the 2nd note, and so on. A “next note” of any note would be one of:
This means that there are 520 to the power of 12 unique tunes possible, or: 390,877,006,486,250,192,896,000,000,000,000
In English this is Three hundred and ninety trillion trillion trillion (plus change) possible tunes.
No one know of course how many tunes have already been composed since humans evolved to be able to do that, but assuming that a unique new tune has been invented every minute by someone somewhere in the past 10,000 years (the estimated age of human civilization), a quite preposterous totally unrealistic assumption even for today let alone for early humans who had more important things to worry about than producing new tunes, we would have only exploited 5,256,000,000,000 (5 trillion) potential unique songs so far, a paltry 0.0000000000000000000134467 of all possible tunes.
It would take many times the projected lifespan of the entire universe to run out of possible new tunes
 Randomly chosen: Jingle Bells 11 notes, Oh Canada 10, Yankee Doodle 14, Twinkle, twinkle little star 14, Take me to the Moon 13
The Kvetching Factory
"Start every day with a smile and get it over with" (W.C. Fields)