Music Generation Algorithm
Objective
The goal of the RobOrchestra Science team is to enable the robots to improvise their own music. Robots, while excelling at many things, are not particularly known for their taste in music, giving the Computer Science group the challenge of introducing robots to refined musical culture.
How it Works
What robots do understand, however, is probability. By presenting a robot with a piece of music composed by a human musician, the robot can examine the song, count the number of notes it contains, and more importantly, determine the likelihood that a certain note will follow another.
By examining many pieces of music, a robot can build a table called a Markov Graph which contains entries for all pairs of notes. These graphs provide a quick reference for the robot at a given point: "given that I have just played note A, what is the probability that I should now play note B? C? D?" Given a significant musical database, the robot can come to understand music in a purely mathematical expression of note transitions.
To generate a song, it takes a random walk on its Markov Graph, producing a string of notes that will, probabilistically, resemble human-composed music. This technique has proven effective given a single melodic line to be composed for a single musical robot. With an entire orchestra at its disposal, the team found that running multiple graphs for each instrument did not produce harmonious results and thus developed the idea of a chorded Markov Graph.
Creating Harmony
For this method the robots examine pieces of music for the chord progression inherent in their composition, recording the probabilities of a sequence trasitioning between anything from C Major chords to F# Minor chords. Once given the chorded Markov Graph, the team worked on extracting a melody line from the progression of chords.
By chooosing a component of the chord to be the primary melody note, an inner single note Markov graph was established to form transitions of the melody note away from its chord value that would eventually lead it into its next chord-tone. In this manner the robots can create melodies of their own while begin certain to harmonize with each other.