Markov Chains

A brief explanation

OSCAR uses Markov chains to create new harmonic and melodic material. From a mathematical standpoint, a Markov chain describes a process that can be considered to be in exactly one of a number of "states" at any given time. Take, for example, a system that has three possible states, called A, B, and C. The system can be in only one of these states at any given time.

The heart of the Markov chain is the analysis of the transitions between the states. The key is the so-called transition matrix that contains the probabilities of moving from any state to any other state. A transition matrix for our example system might look like this:

  A B C
A 45 25 30
B 10 90 0
C 33 34 33
 

The letters A, B, and C along the left side of the matrix are our possible current states; the letters along the top are our possible future states. If, for example, our current state is A, the probability of moving to each of the possible future states is expressed in the matrix: there is a 45% chance that the next state will be A, a 25% chance that the next state will be B, and a 30% chance that the next state will be C. Once the next state is chosen, it becomes the new current state; the chain propagates as each new state determines the possibilities for the state that comes next. This is a first-order Markov chain, because it is only the current state that determines the probabilities for the next state. In a second-order Markov chain, the current and previous states determine the probabilities for the next state. A second-order transition matrix looks like this:

  A B C
A A 45 20 35
A B 10 85 5
A C 34 33 33
B A 50 20 30
B B 10 0 90
B C 67 0 33
C A 50 15 35
C B 10 90 0
C C 33 34 33
 

If, for example, the current state is B, and the previous state was C, we look on the matrix row labeled "C B" and find that there is a 10% chance of the next state being A, a 90% chance of the next state being B, and no chance of the next state being C.

OSCAR uses first-order Markov chains for melodic genesis and second-order Markov chains for harmonic genesis. The possible "states" are simply musical intervals: melodically, the intervals -12 through 12 (descending octave through an ascending octave) are permitted. The permitted harmonic intervals are 0 through 12 (unision through octave). Unlike our example system, OSCAR does not use a transition matrix. Instead, it uses a number of transition arrays. A transition array is simply a different way to orgranize a transition matrix. Instead of the first-order transition matrix shown above, we could have used three transition arrays: each row in the matrix becomes it's own array.

A
A 45
B 25
C 30
B
A 10
B 90
C 0
C
A 33
B 34
C 33
 

The title of each array, at the top in bold, is the current state, and the probabilities for possible future state are listed beneath it. OSCAR uses transition arrays to create strings of melodic and harmonic intervals. The title of each array is the current melodic interval, or in the case of harmonic arrays, the current and previous harmonic intervals. Each array contains the transition probabilities for every possible future interval.

OSCAR uses two types of transition arrays, analysis and performance arrays. The difference between these two array types is discussed in the next section.


Email Greg OSCAR Main PageOSCAR's Data Arrays