RSS
 

On Markov Chain Music

03 May

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.

MCM1

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!

MCM2

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

 

Tags: , , ,

Leave a Reply

 
CAPTCHA Image
*
 
  1. Elisa

    May 4, 2010 at 12:20 pm

    Nah, he's gyring in the wabe!

     
  2. Philip Bjorge

    April 17, 2013 at 11:22 am

    I'm experimenting with some generative music and needed a simple example of how you could construct a musical markov chain that actually sounded pleasant.

    I had no idea you could just pick a song and generate the model yourself. It makes sense.

    Thanks for posting this.