After successfully making a melody from random notes, I thought I’d try the same idea from a random melody. This is sort of cheating, since I’ve used this trick to start melodies before. One method of generating a random melody is to start with a time signature, say 4/4. Then split it into tied quavers.

Then we randomly include or remove the ties to produce notes. This is equivalent to encoding the rhythm as a binary number where a 1 is a tie and 0 is no tie. Hence, for a 4/4 bar, there are 128 possible rhythms. Of course, there are other possible rhythms, but this is acceptable to start with.

Now, I get some random digits from this website. and generate a couple of bars of random rhythm. (1010001 and 0011010) produces:

This is pretty easy to make into a melody:

I conjecture that it is possible to come up with a decent melody from a random rhythm. The key here is to repeat that rhythm a bit.