Click "Mary" to play Marry Had a Little Lamb. Clicking "Generate Random Mary" creates a random song using the notes of the original. Click "Play" to hear it. Clicking "Generate Markov Mary", and then "Play" will generate and play a song from a simple Markov model, in which we start with a note, and the second note is chosen according to the probabilities that the second follows the first in the original. Each next note is chosen according to the probabilities that the note follows the previous in the original song.
Thanks to Cinda Heeren for this idea, and a Python implementation on which this is based.