I'm not an expert on probability theory, artificial intelligence and machine learning, and even my Music 201 class from years ago has been long forgotten. But if you'll indulge me for the next 10 minutes, I think you'll find that even just a little knowledge can yield impressive results if creatively woven together into an application. I'd like to share with you how PHP can be taught to compose music.

He shows examples of some basic melodies generated by PHP (not the prettiest) and talks about how he "taught" PHP to get better at it. He transcribed other music into Scientific Pitch Notation and used a Markov process to create a "next note selection" method based on the notes around it. He includes the code for his "robot composer" class with its "train" and "compose" methods and and example of its usage.

Link: http://zaemis.blogspot.com/2013/05/composing-music-with-php.html]]>The idea is that there is a random surfer, who starts on web page then browses through in a somewhat random way. [...] This random walk is a Markov chain, a traversal of a matrix that gives the probability of moving to any state from any other state, with the total probabilities for the destinations from any given page adding up to 1. PageRank attempts to find extract a vector of weights from that table, with one weight per page - they aren't related to any particularly query, so are only ever going to be a factor in a page being returned on a results page.

He includes the code to create a page rank rating for a sample set of data with the results showing the differences in ranking based on frequency of times the "page" is linked to and how that relates to the rankings of the other pages.

]]>