/markov-chain-music-generator

Generates (very) simple piano music made to imitate an input using higher-order multivariate Markov chains

Primary LanguageMathematicaOtherNOASSERTION

Overview

Generates (very) simple piano music made to imitate an input using higher-order multivariate Markov chains.

This project was the final project for a linear algebra class. Mostly due to time constraints, a significant portion is less developed than I might have hoped. Perhaps most notably, input must be translated from notes to numbers via a key, and it must be done manually. This also limited the amount of input I was able to provide to the program at the time.

Calculations.nb is essentially Higher-order Multivariate.nb adapted for the purpose of generating music. All other notebook files are examples of the names of the files.

The results folder provides the first three results generated by the program as well as three randomly generated tracks. The generated results do not sound good. The point of this project was not originally to make a usable program, but to prove that such a program is within reach. To that end, the generated results only needed to sound markedly better than a randomly generated set of notes. To judge for yourself, play a randomly generated output to a procedurally generated output.

Use

Though somewhat impractical in its current form, it is still usable. As stated above, the music must be translated to and from numbers. The rules are in Key.txt. Octaves are not accounted for -- only the 12 basic note names. The first set of data corresponds to one note per beat division in the right hand, and the second set to the left hand. The original project used eighth note divisions, but I did not experiment with shorter or longer divisions. It is worth noting though that corresponding indices between the two sets are expected to be directly related (i.e. played at the same time).