That’s a nicer way to describe the phenomena of having a great idea that is just a little bit lacking, goes nowhere then, an other party does something quite similar, but with one or two improvements or refinements that lead to a higher level of success.
This time, I’m talking about cricket; A program I wrote sometime around 2004, to evolve csound patches using a genetic algorithm and midimutant, a system that evolves patches for the Yamaha DX7.
First, I shall paste some words about project gensound, which predates the formation of bigwinky media labs:
The goal of the gensound project is to create a tool for generating intresting csound orchestras using a genetic algorithm.
Csound is a sound synthesis program written at MIT decades ago. It predates MIDI and all the digital audio technology that you hear everyday. To run Csound you supply two files. The first describes an “orchestra”, consisting of “instruments” defined in terms of signal processing “opcodes.” The second file describes timing and control information. The two files are roughly analogous to a MIDI synth patch, and a MIDI sequence. Consult the numerous web resources for more information on Csound.
Because Csound’s possibilities are vast, my hope was that a GA tool could be used to assist a designer create intresting new sounds. The intention is to make the sound designer play the role of the merit function in the genetic algorithm.
The essential user experience goes something like this:
The user listens to a number of sound samples. Each sample is an individual in the sessions initial population of sounds.
The user assigns a score to each sound. The tool deletes sounds scored below a certain threshold. Sounds with relatively high scores are “mated” to produce new sounds that have some charactaristics of both parents; the new sounds are added to the population.
I’m not an expert in Genetic Algorithms and perhaps the first prototype, called Cricket, reflects that fact. In any case, Cricket is a Java program that presents sounds to the user by using the
javax.sound.sampled classes to play wave files. These wave files are produced by a virtual synthisizer implemented as a Java wrapper around Csound. Cricket’s virtual synthisizer is pretty simple, as of this writing, it consists of half a dozen Csound opcodes. The intresting thing about this virtual synthisizer is that its parameters can be set by supplying a random bit sequence. So, to generate the initial population of sounds, all Cricket needs to do is create a set of random bit sequences. To audition the sounds, Cricket instantiates a virtual synthisizer, supplies it an individual bit sequence, and plays the resulting wave file.
Cricket keeps score of all the sounds and deletes the poor performers and mates the better ones. Mating is done by taking two bit sequences and crossing them over to create a new sequence that has the head of one parent, and the tail of another. Finally the new bitsequence is mutated by probabilistically toggling a small number of bits in the child bit sequence.
And about cricket itself, I wrote, 10 or more years ago:
Cricket’s purpose is to demonstrate the essence of the gensound idea.
The range of sounds that Cricket can produce is severely limited. Its virtual synth has only three generators:
The noise and oscillator signals are sent through their own ADSR envelope before being mixed together. The things that cricket will vary..I should say the things that Cricket can vary are the various arguments to the CSound opcodes that are used for generators and the ADSR envelopes.
The left side of the Cricket screen shows the population of sounds. This part of the display consists of a stack of sound audition panels, one panel for each sound in the population. The colored bars represent the sounds genetic material. Cricket knows how to convert that DNA in to a particular set of settings for the virtual synth. Clicking the play button will cause Cricket to do just that and play the sound for the user to audition. If is a bad sound, the delete check box can be selected to indicate that this sound is below the survival threshold and, will fail to live in subsequent generations of the population. Other wise the slider is used to indicate a score for the sound.
The Right of the screen are a number of controls for adjusting the simple Genetic Algorithm’s parameters.
pairing fraction controls how much of the population participates in breeding. Setting this to all for example, will allow all the surviving individuals to mate. Setting to lower fraction, will allow only the higher ranked sounds to participate.
offspring per pair Specifies how many children each mating pair produces.
mutation probability Controls the likely hood that one bit in a new individuals DNA will be flipped.
population limit If the population grows beyond this limit, additional lower ranked sounds will be culled (deleted) even though they were not marked for deletion by the user.
Comparing cricket with midimutant, the key gap is the evaluation responsibility, the task of judging the individuals in the population, is a human in cricket but, is automatic in midimutant. Midimutant is comparing members of the population to a target sound. in Cricket, a user had to listen to each sound and give it a (subjective) score. This was the fatal flaw. It also was limited by the very simple csound synth that was the object of the evolving genome.
Here is one of the more interesting midimutant examples