Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Looking for evolutionary music example code [closed]

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.

like image 352
Dan Dyer Avatar asked Oct 13 '08 18:10

Dan Dyer


People also ask

What is the evolutionary explanation for music?

The Musilanguage hypothesis This model argues that "music emphasizes sound as emotive meaning and language emphasizes sound as referential meaning." The musilanguage model is a structural model of music evolution, meaning that it views music's acoustic properties as effects of homologous precursor functions.

What are the three of the evolutionary theories for music development?

Evolution of (music) cognition According to Lewontin [44], evolutionary theory stands on three principles—variation, heredity and natural selection—that limit scientific inquiry into cognition.

Is music an evolutionary adaptation?

Although evolutionary theories about music remain wholly speculative, musical behaviors satisfy a number of basic conditions, which suggests that there is indeed merit in pursuing possible evolutionary accounts.

In what sense is music an evolutionary conundrum?

In what sense is music an evolutionary conundrum? Music is found universally in human societies and appears to have a gentic basis, but it is not immediately clear how that would affect survival and, therefore, could be selected for or against.


2 Answers

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.

like image 61
JoeBloggs Avatar answered Sep 21 '22 00:09

JoeBloggs


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.

like image 29
Dan Dyer Avatar answered Sep 20 '22 00:09

Dan Dyer