Further, each note may transition to the next note in a
number of ways,
"normally" (separately plucked and fretted), by sliding, by
hammer-on by pull-off. I will allow for the possibility of sliding
from a note to itself which enables 1/16th notes, 1/8th notes,
(and even 3/8th notes).

So what does that leave?

Choose 1 note from 12, 32 times, and choose one of four
methods of transitioning to the next note, 31 times.

I can probably divide that number by twelve because it
would count each riff played in each key, and I would really
only want to count each riff in one key. (Yeah, that helps).

12^31 * 4^31
13136460329474767592159014329848871194456369557143552

Hmm, I still don't feel like I've accomplished anything.
What is stil missing is a way to toss out even some
proportion
of the riffs as being "non-musical", I know there are plenty
of
non-musical riffs counted in there, but I have no
idea
how to toss them out.

Hmm, lets say I only allow two methods of transitioning
between
notes. After all, riffs that differ only by using a
pull-off or
a hammer-on vs. an ordinary plucking style aren't really
all that
different, it's more a matter of how well the riff is
performed than a matter of it being a different riff
altogether.
I still have to allow for sliding though, to allow for the
possibility
of different time values for the notes and still have
everything
add up to just one measure.

So that would be:

12^31 * 2^31
6117141027690268863066571918245810640257024

A little better, but still a freakin' huge number, and
I'm still
counting too many duplicate riffs that differ only by
"sliding" vs.
normal plucking.

So thinking about it a little differently, for the first
note, there,
are 12 choices. For the remaining 31 notes, you really have
13 choices,
you can just allow the previous note to continue uninterupted,
or you
can start new note, from a choice of 12. And once again, I
can divide
by 12 to limit each riff to one key.

So that gives us:

12 * 13^31 / 12
34059943367449284484947168626829637

One problem I still see, most music has whole notes, half
notes, quarter notes, eighth notes, sixteenth notes, and 32nd notes,
which I have allowed for, but I have also allowed for 3/8th notes,
7/8th notes, etc... Well those would typically be written as a
quarter note note tied to an eighth note, or a half note tied to
a quarter note tied to an eighth note respectively, so I
suppose I have to allow them.

But, suppose we limit things so that notes can only be
32nds, 16ths, 8ths, 4ths, halves, or whole notes, that is,
no "3/8th" notes, no triplets, or other weird
Chopin-esque stuff. (Chopin would do weird things
like have the left hand play 17 notes in one measure
while the right hand had to play 13 in the same
amount of time, 17 against 13.
What a bastard.)

Anyway, what would that kind of convenient blindness leave?

I imagined a measure, which you chop up in a number of pieces
(at most 32 pieces) and as you cut it up, you could make
as many as 31 cuts, or as few as zero, and each cut
would have to slice one of the remaining pieces
exactly in half. Being rather
bad at combinatorics and discrete math I
wrote a little brute
force C program:

For example, music is not limited to the diatonic system of the West. Oh, no, that would be far too easy. Arabic music has quarter tones, and some of their tones are off pitch to our western ears. Indian music... don't get me started. Chinese music is easy, and adds little to the list - it traditionally has five notes (which, I believe, mirror their five elements), which (I hope) use tones that us westerners adopted.

Music also has different segments to it, which can have an already-made melody in it without the song being called "plagarized". One can also have short snippets of melody, called riffs, which are not necessarily characeristic of a song, artist, nor style of music. Even music played in a different style of music can sound completely different, not to mention remixes.

Making an equation among these lines is nigh impossible, as even forgetting just one characteristic can throw off the equation by billions. I am confident to say that there are enough melodies in the world for my liking, perhaps infinite.

I realize that alternate tunings will not differentiate music much, but it can bring out character in songs and changes harmony in subtle ways.

I've stumbled upon this node many many times in my search of interesting takes on music synthesis and the like and finally I'm writing the solution thats occured to me. ferrouslepidoptera's node, while very interesting and insightful, made many generalizations, which were mostly noted throughout their node. First off, i'd like to give props to them for tackling such a large problem reasonably. Now exit all reasonability and enter this node.

With this said, I propose a much simpler solution. A PCMaudio file of 44100hz and 16 bits can (watch me make a generalization here) reproduce any sound audible to the human ear. This means that if we take a 16-bit number (0 to 65535) 44,100 times a second, we can reproduce any 'melody' for that second, matching any timbre, amplitude, chording, just intonation, etc. So if we make a generalization that no melody lasts more than a second, we find that there are only:
(65535^44100 - 65535) different sounds that can be reproduced in 1 second. (minus 65535, because there are that many combinations where every number is the same, producing silence).
Using some trivial mathematics, the result is:
2.96958 *(10^215,529).
And keep in mind, that result is only mono. Stereo would be the square of that number. Note: We could probably divide this number by 16 (2^4) as our ear could probably not perceive the difference in speaker position of 16/65535 or 1/4095 of the speaker's maximum aplitude.

Now, as for the musical qualities of the afformentioned 'melodies'? Who am I to dictate what arbitrary set of 16-bit integers speaks directly to the soul of an individual? Some combination of each of those seconds creates your favorite song, your most hated song, and yes, even that overuse of power chords and distortion you created in your basement. To me, this is really interesting. No matter what you say, or how you say it, or how you play your instrument, or what it sounds like when you blink or click your mouse, for one second it is simply 1 of the possible 2.96958 *(10^215,529) seconds of sound.

A fine attempt, but let us not forget that you've left out at least two possibilities:

1) Use of rests/durations: Rests and durations are important in melody making, otherwise, you'll end up sounding like some weird electronic music or a Steve Reich piece. This significantly increases the number of melodies you can get, each note can be held out from anywhere from the 32 or so quavers you define your melody to last, and that is a combinatorial problem my brain is too tired to figure out right now exactly. I think it's something along the lines of (32 * 13) permute 32: This you get from pretending all your possible notes were hand-painted balls in a big vat, which makes ((12notes + space)* 32max), and then you select 32 of these and include the permutations. I think I'm right. Anyway, it's a larger number.

2) Melodies don't always stay within an octave: Think, let's say, OK, a slighty obscure example - Prokofiev's piano sonata no. 6, 3rd movement. The arpegiated a-minor melody comes in, mucks around a bit, does it's thing, and then all of a sudden the tail end of the melody gets carried upwards in ribbons and ends up getting placed in the same spot an octave higher. Sure, while the release date of the next recording of the Prokofiev sonata no. 6 does not exactly have Justin Timberlake crossing out squares in his calendar, that doesn't mean this happens rarely. For instance, you know that bit in a pop song, where everything goes higher? Think Mariah Carey's "Can't live", or most Celine Dion songs. It's a modulation upwards, I think by a perfect fifth in most cases. I don't think you couldn't call that entire stretch a melody, and I think the lowest and highest notes in that set will probably poke outside the 1 octave range.

Melody is a hard thing to define, even definitions that seem academic come up in real music, see brain-liquefying modern music compositions. In my estimation, for all practical purposes there are probably an infinite number of melodies. A friend said that there are more chess games possible than atoms in the universe, and I have another friend that made music out of chess games. Monophonic mostly, I think. Ergo, there are at least as many 'melodies' as there are atoms in the universe.

According to military communication research (sorry, I don't recall specifics), the theoretical maximum amount of information that the human brain can absorb per second is only approximately the equivalent of 45 bits per second. 10800 bits per 4 minutes of listening to the radio or watching TV. I don't know if they know which bits are sufficient to reproduce that experience but I agree that I probably can't send a review report by telegram about a 4 minute video. A good typist can exceed that rate by reflex even without understanding the dictation.

An analog telephone line carries only a frequency range of 3000 cycles per second. It can use QAM to transmit 56000 bits per second, but phase modulation is involved and human hearing is not very much aware of the phase aspect of sound.

30 years ago I began using a primitive extremely lossy binary representation of sound, by which voice and music could be processed experimentally with arithmetic within the limit of 64000 bytes of RAM, able to store one minute of sound at a time in the simplest case, and whole songs by using tricks.

First I made sounds by counting or pseudo random means, 3 years before using this technique for recording. Its purpose was to build a synthesizer, which I knew nothing about, and thought that it was a music generating automatic machine. In my format, counting sounds musical, and pseudo random sounds like the hiss of the s and sh sounds. It may be important that my format is so lossy that it doesn't preserve frequencies, phase, nor amplitude aspects of sound and thus its recognizability and intelligibility are unexplained and generally only useful for fast experimental calculation and exploration of "thumbnail" quality music.

Octave and musical note frequencies can be expressed in Base 12 Log2, from 0.0 for a low A to 11.11 for a high G#. Log2 explains how binary counting generates octaves but not the notes.

I now occasionally use 4 megabytes to represent experimental binarynumeric sound, but usually never even come close to exceeding 64K bytes. Most of my experiments do not exceed a screenful of significant data to generate musical sound.

4 megabytes can hold over 256^4,000,000 numbers from all 00 to
all FF in hexadecimal. Assuming 8-bitPCM, there are constraints that bring the number of possible songs down, such as the average byte value must be hex 80. The same song will be heard if all bits are flipped between 0 and 1, so that makes half as many possible songs. The same song will be heard if the bytes are shifted and the player is looping and therefore the total number of songs must be divided by 4000000. The lowest bit is meaningless, so the number must be halved. Removing all bits except the highest bit still plays recognizable sound, so the number of songs must be divided by 128.
So the number of possible songs must be around...
2^4000000 / 2 due to bit flipping / 4000000 due to shift equivalence = 2 ^ 500,000 possibilities left.
Now what if everyone in the world recorded the same song using a device that records in my format? Out of 6,000,000,000 people, no two people will create an identical file.
There are less than ((2^500,000)-(2^33)) possible songs.
This should be an exponent but it is not. The reason is that all of the songs can be represented by a single bit in that much memory. We know the constant third dimension is the same number.

Now consider that this number represents every possible song sung by every possible singer in every possible language and backed by every possible instrument and every possible parody version and every possible non musical speech or combination of sounds ...plus noise, and I forgot to try to calculate how many are physically impossible sounds that should be excluded.

I recently wrote a short song which has never been sung and programmed my unique synthesizer to create it so that it sounds like that old song that I thought was spontaneously generated by a synthesizer 30 years ago. It is called Viray's Inspiration, and it fits in 32000 bytes and plays for approximately 30 seconds. The voice sounds the same, but the lyrics are different. The music sounds similar but the melody is different. That shall be for replacing all the OLD good-feeling songs that we can't get copyright licenses for with NEW ones that sound similar but are ORIGINAL and may even sound like Elvis singing Michael Jackson's hits with new lyrics and old instruments.

I have partially squeezed (not copied) the Doctor Who intro, including Video into 64K, the audio will be like the original Derbyshire version, and the video of the vortex will be Parametrically synthesized, like Farbrausch's 2000 64KBdemoscene thriller called FR-08. I think that was about 15 minutes of music and video in 64K.
65536/15?/60=getting quite close to 45 bits per second, perhaps?

Hmmm. My guess is any 4-minute song can fit in 64K, so there are less than 2^65536 songs.
But if we can only hear the equivalent of 45 bits per second then
there are only 45x60x4=2^10800 songs. With or without video.
Go Farbrausch!