https://github.com/IsaacLewis/MidiMarkov
The crystal theme worked the best (it's basically some scales on the piano that go up and down).
With a first order Markov chain, the output was a random walk of notes going higher and lower. With a second order chain, the notes went up and down fairly steadily, but with scales peaking at odd points. With a third-order chain, you get close to the original song out.
(It's hard to explain in text, without knowing the correct music vocabulary, but I hope you get the idea).
Actually, I think this kind of Markov model might be a better introduction than some of the others I've seen, since it's extremely simple to understand.
http://nest.echonest.com/post/526547218/james-brown-forever-...
I don't know his music well enough to tell it's a mix. Maybe you can.
It doesn't work as well as in gangnam style.
I didn't take time to try to understand why. Either this is because echonest's analyzed mp3 isn't the same as mine. Or the function to compute distance between beats isn't generic enough.