Archive for May 3rd, 2010

On Markov Chain Music

May 3rd, 2010 2 comments

Ever wonder what music produced by a Markov chain might sound like?  Yeah, me too! ...and... wonder no more!  So I went to where the piano is and grabbed the more regular, simple score I could find.  As it turns out it was Mozart's Twinkle Twinkle variations (Zwolf Variationen uber "Ah, vous dirai-je, Maman" KV 265).  Because it is written in C major and the notes are mostly regularly spaced this was great!  I used the first variation (more notes) to produce a transition probability matrix.  Perhaps an important thing to note (pun intended) is that the range is from B to E (about an octave and a half).  The little song produced is about 30 measures and has no real tune to it, although in some parts it does resemble the original melody.  Also, I added three non-random notes at the end to make it end gracefully.


Of course, arranging it a bit it can sound marginally better;  here's how I've done it, adding accompaniment and instruments, using Garageband's licks and prefabricated transitions (to save time).  Enjoy!


(I hope Mozart is not writhing in his grave!)