Image: Medium, Alex Bainter
Alex Bainter has a good explainer post on Medium about how he used Markov Chains to generate a much longer version of Aphex Twin's aisatasana. Using a JSON representation of a MIDI file of the track, he built a Markov Chain system to generate over four million unique phrases which can play for over 451 days without repetition of a phrase. The result is available to listen to on generative.fm.
Source: