views:

522

answers:

3

I would like to implement an interactive evolutionary algorithm for generating music (probably just simple melodies to start with).

I'd like to use JFugue for this. Its website claims that it is well-suited to evolutionary music, but I can't find any evolutionary examples.

I already have a framework to provide the evolutonary machinery. What I am looking for is some simple, working code that demonstrates viable approaches for the musical part (e.g. suitable encodings and evolutionary operators for the evolved tunes).

I have some ideas how it might be achieved, but I'm not particularly knowledgeable about music theory, so to start with I'd like to just reimplement something that is known to work.

So does anybody have, or know of, any freely available code (any language is fine) that demonstrates one or more approaches to evolutionary music?

EDIT: I'm specifically looking for evolutionary code rather than other techniques that could be used for music synthesis.

A: 

So far I've found only this, which is a genetic programming example in C.

EDIT: And this online system, which doesn't have source code but is an example of what can be achieved.

And I also found Grammidity, which allows for sequences of MIDI events to be evolved from grammars.

Dan Dyer
A: 

There is some research going into using Cellular Automata for generating music. As with all other music generation, it is really a question of mapping rather than generation. You could use pretty much anything as input as long as you define your mapping so that it sound "good" (well I guess interesting is a better word).

Googling "cellular automata music" gives quite a few hits. Another good source for information is the Computer Music Journal if you can get access to their archives.

andy
+1  A: 

You probably want to look into Markov Chains - They're probably of more use to you than an evolutionary algorithm to start with, as judging the quality of the output in order to breed the best is going to be a nightmare (subjective and time-consuming), and they're ideal for combining with evolutionary programming.

There's a good introduction to them on Coding Horror. The article explains the concept and demonstrates the remarkable results, the comments mention music a lot more (I was lost for hours in the comments and the sites they linked to). There's some more specific details and further reading on Wikipedia.

Markov chains have an element of probability to them, so this is where you can combine them with evolutionary programming - by evolving a method of choosing alternatives other than the roll of a dice.

JoeBloggs
Thanks. I'm already familiar with Markov Chains. I'm specifically looking for evolutionary code as I want to use it as an example of what you can do with evolutionary algorithms. I've read lots of stuff mentioning evolutionary music but haven't found any real world example code.
Dan Dyer