Few caveats: I definitely didn't write this code under the assumption that anyone would ever see or use it. It's organized enough for me to understand since I wrote it, but it isn't well-commented or anything. As I say in my thesis itself, I wouldn't inflict on anyone the task of fully understanding this program just by reading the source code. Possible, but not super fun. The code is included in .ipynb and .txt formats. The first is a notebook format, similar to Mathematica, and it's what I coded in. I used Juliabox.com, an online Julia compiler and server, to write and run everything- if you upload the ipynb there, it should work, as long as you install the "MIDI.jl" package to your account there. The txt file is a markdown file, which is a lot easier to open and goof around with if you don't want to mess with notebooks, but I'm not sure how I would go about running anything using the txt file. All of the code to actually run stuff is at the bottom (though of course it is important that everything above it runs too). There is a set of parameters to set down at the bottom, and then three functions that handle the preprocessing, learning, and composition steps. Also included is a zip file of the MIDI files I fed it to learn stuff. Tip: sometimes you get better results by using fewer of them! Just in case, I've also included a copy of my thesis document. It explains the ideas behind what is going on here, and maybe it will help decipher the program, if you end up wanting to. Finally, two MIDI output files are included too. These are cherry-picked results that Composobot produced, but they sound kind of good. Enjoy maybe! Also, please use any or all of this for any purpose at all, except limiting anyone else's use, with or without crediting me. Locking up ideas is the opposite of science!