Sunday, May 14, 2006

Algorithms & Music

So it looks like if you want to get involved in any music engine, some basic knowledge of logic and programming is really necessary or at least, very convenient.

What you need to create some sort of music engine and to create music for that engine, is to create a set of rules, something that will serve for the musician as well as the programmer.

Have in mind that a programmer with a good set of rules (what we call specification) will have an easy time coding your music into the game and it will work perfectly well from the beginning, but it you don’t give good rules the guess work on the programming side could ruin your musical results.

Programs follow what we call algorithms, in other words, a set of rules to solve a problem, check this out:
http://en.wikipedia.org/wiki/Algorithm

Algorithms usually solve problems following a very easy logic path, which can be graphically displayed with flow charts:
http://en.wikipedia.org/wiki/Flow_charts

Examples of algorithms applied to music are here:
http://en.wikipedia.org/wiki/Algorithmic_music

http://ccrma-www.stanford.edu/~blackrse/algorithm.html


Don’t think is something new; check this out from the ccrma page:
“Mozart, too, used automated composition techniques in his Musikalisches Wurfelspiel ("Dice Music"), a musical game which "involved assembling a number of small musical fragments, and combining them by chance, piecing together a new piece from randomly chosen parts" (Alpern, 1995). This very simple form of "algorithmic" composition leaves creative decisions in the hands of chance, letting the role of a dice to decide what notes are to be used.”

If you want to go even further:

http://en.wikipedia.org/wiki/Finite_state_machine