Maikovsky: Composing Folk Music with Markov Chains
Posted October 14, 2018. 145 words.
The music it makes is a little bit strange and it doesn’t really understand how many beats should be in a bar, but if that is a problem up the iterations. Keep raising the iterations and eventually you might even hear a tune that you know!
Under the hood, it is relatively simple. After making an Ajax request to load about 300 tunes it “parses” each tune into a data structure that is easy to work with. Then two Markov Chains are generated for the title and for the music, the other attributes are just chosen randomly.
Tunes can be played back with or without chords, and on any instrument. Click here to start.