Looking for evolutionary music example code [closed]
Asked Answered
F

3

8

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.

Fetial answered 13/10, 2008 at 18:58 Comment(0)
F
1

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

Update (January 2010): And this online system, which doesn't have source code but is an example of what can be achieved. I also found Grammidity, which allows for sequences of MIDI events to be evolved from grammars.

Update (July 2011): I've just found some relevant Python code on the MIT Open Courseware site.

Fetial answered 15/10, 2008 at 21:42 Comment(0)
D
1

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.

Diazo answered 13/11, 2008 at 16:22 Comment(1)
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.Fetial
A
0

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.

Atalanti answered 29/10, 2008 at 11:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.