###

# Audivolv eVOLVes AUDIo

http://audivolv.com

Ben F Rayfield

Open-source license: GNU GPL 2+

###

Evolves musical intruments you play with the mouse.

left, right, red, green, blue, mousex, mousey, mousex2... var15, var16...

###

Evolves musical intruments you play with the mouse.

left, right, red, green, blue, mousex, mousey, mousex2... var15, var16...

Example code is in "Create Musical Instruments" tab.

###

The amplitude is the sound.

Evolved code is stateless except for position in hypercube.

###

JavaCode object{

Immutable. Its evolved score and links are in an EvolveData<JavaCode>

String code()

List childs()

List floVars(String regexDescriptionMatcher)

String describeFloVar(String floVarName)

Code:

temp = x;

x = x*3 + Math.sin(x);

y = x + .2;

x = temp;

Description of x: RLRRRL

Description of y: L

JavaCode floVarRename(String oldFloVarName, String newFloVarName)

}

###

Breed 2 JavaCodes X and Y

X and Y are a linear sequence of child JavaCodes. Start with X's childs.

###

Breed 2 JavaCodes X and Y

X and Y are a linear sequence of child JavaCodes. Start with X's childs.

20% chance{

Pick 2 equal-size random ranges of childs, in X and Y.

Overwrite X's childs with Y's childs.

}

###

Breed 2 JavaCodes X and Y

X and Y are a linear sequence of child JavaCodes. Start with X's childs.

20% chance{

Pick 2 equal-size random ranges of childs, in X and Y.

Overwrite X's childs with Y's childs.

}

5% chance{

Cut X between 2 childs, and swap the 2 ranges. Ignore Y.

}

###

Breed 2 JavaCodes X and Y

X and Y are a linear sequence of child JavaCodes. Start with X's childs.

20% chance{

Pick 2 equal-size random ranges of childs, in X and Y.

Overwrite X's childs with Y's childs.

}

5% chance{

Cut X between 2 childs, and swap the 2 ranges. Ignore Y.

}

5% chance{

Randomly reorder X's childs. Ignore Y.

}

###

Breed 2 JavaCodes X and Y

X and Y are a linear sequence of child JavaCodes. Start with X's childs.

20% chance{

Pick 2 equal-size random ranges of childs, in X and Y.

Overwrite X's childs with Y's childs.

}

5% chance{

Cut X between 2 childs, and swap the 2 ranges. Ignore Y.

}

5% chance{

Randomly reorder X's childs. Ignore Y.

}

70% chance{

Pick random childs to remove.

Quantity to remove is random^2 fraction of the childs.

Keeps code size down because new childs are only added if vars are missing.

}

###

Breed 2 JavaCodes X and Y

Fix the mutated code

###

Breed 2 JavaCodes X and Y

Fix the mutated code

This increases evolved code size. Score higher for shorter code.

###

Breed 2 JavaCodes X and Y

Fix the mutated code

This increases evolved code size. Score higher for shorter code.

Each var must be Lvalue and Rvalue at least once.

###

Breed 2 JavaCodes X and Y

Fix the mutated code

This increases evolved code size. Score higher for shorter code.

Each var must be Lvalue and Rvalue at least once.

Pick a random child in Y. Lvalue var names are child.floVars(".*L.*")

###

Breed 2 JavaCodes X and Y

Fix the mutated code

This increases evolved code size. Score higher for shorter code.

Each var must be Lvalue and Rvalue at least once.

Pick a random child in Y. Lvalue var names are child.floVars(".*L.*")

Pick an Lvalue (or Rvalue) thats missing in the mutated code.

###

Breed 2 JavaCodes X and Y

Fix the mutated code

This increases evolved code size. Score higher for shorter code.

Each var must be Lvalue and Rvalue at least once.

Pick a random child in Y. Lvalue var names are child.floVars(".*L.*")

Pick an Lvalue (or Rvalue) thats missing in the mutated code.

If child does not have that var as Lvalue, rename some var in child.

###

Breed 2 JavaCodes X and Y

Fix the mutated code

This increases evolved code size. Score higher for shorter code.

Each var must be Lvalue and Rvalue at least once.

Pick a random child in Y. Lvalue var names are child.floVars(".*L.*")

Pick an Lvalue (or Rvalue) thats missing in the mutated code.

If child does not have that var as Lvalue, rename some var in child.

Add the new child in a random place.

###

Hypercube is an N-dimensional space where each dimension ranges -1 to 1

###

Hypercube is an N-dimensional space where each dimension ranges -1 to 1

Human - Root fitness function.

###

Hypercube is an N-dimensional space where each dimension ranges -1 to 1

Human - Root fitness function.

Func object - Core of Audivolv.

###

Hypercube is an N-dimensional space where each dimension ranges -1 to 1

Human - Root fitness function.

Func object - Core of Audivolv.

JavaCode object - Tree of Java code strings.

###

Hypercube is an N-dimensional space where each dimension ranges -1 to 1

Human - Root fitness function.

Func object - Core of Audivolv.

JavaCode object - Tree of Java code strings.

Hypercube templates - Inital population of JavaCode.

###

Func is the core of Audivolv.

Type into Audivolv window{

green = green*.9999 + .0001*(-mousex);

double yellow = (red + green)/2;

left = Math.sin(yellow*5000);

}

###

Func is the core of Audivolv.

Type into Audivolv window{

green = green*.9999 + .0001*(-mousex);

double yellow = (red + green)/2;

left = Math.sin(yellow*5000);

}

First substitution{

f3 = f3*.9999 + .0001*(-f7);

double yellow = (f2 + f3)/2;

f0 = Math.sin(yellow*5000);

}

###

Func is the core of Audivolv.

Type into Audivolv window{

green = green*.9999 + .0001*(-mousex);

double yellow = (red + green)/2;

left = Math.sin(yellow*5000);

}

First substitution{

f3 = f3*.9999 + .0001*(-f7);

double yellow = (f2 + f3)/2;

f0 = Math.sin(yellow*5000);

}

"void run(double flos[], int f, Object obs[], int o){

flos[f+3] = flos[f+3]*.9999 + .0001*(-flos[f+7]);

double yellow = (flos[f+2] + flos[f+3])/2;

flos[f] = Math.sin(yellow*5000);

//Recursion would run(flos, f+25, obs, o+5)

}"

SoundCard.play(Javassist compile "void run(d...");

###

Main parts

Hypercubes: Human, Func, JavaCode, Templates.

###

Main parts

Hypercubes: Human, Func, JavaCode, Templates.

Breed function - Creates JavaCode from 1 or 2 parents.

###

Main parts

Hypercubes: Human, Func, JavaCode, Templates.

Breed function - Creates JavaCode from 1 or 2 parents.

Javassist - on-the-fly Java compiler.

###

In a few years, open-source mind-reading helmets replace mouse.

Create music while you sleep.

###

Just make sure you can turn it off

###

Hypercubes for sound have these vars:

Fast outputs: 1 amplitude for each speaker

Slow outputs: red, green, blue, predict mousex, predict mousey

Fast inputs: 1 amplitude for each microphone

Slow inputs: mousex, mousey, mousex half a second ago...

Fast other vars: Evolved code uses them however it wants.

###

Hypercubes for sound have these vars:

Fast outputs: 1 amplitude for each speaker

Slow outputs: red, green, blue, predict mousex, predict mousey

Fast inputs: 1 amplitude for each microphone

Slow inputs: mousex, mousey, mousex half a second ago...

Fast other vars: Evolved code uses them however it wants.

Other hypercubes do not have those limits. Example: f0 = Math.sin(f1+f2);

###

SoundCardPart chooses how evolved Func.run(flos[],int,obs[],int) are used

At least 1 for each sound-card or software mixer.

Runs how many times per second?

Speakers or microphones? How many?

Round flos[LEFT SPEAKER] to 8 or 16 bit number, then copy to sound-card.

Right speaker is flos[LEFT SPEAKER + 1]

27th microphone is flos[MICROPHONE + 26]

###

Func is the core of Audivolv.

Like Java's stack, but divided into 2 stacks.

void run(double flos[], int f, Object obs[], int o){ ...evolved code... }

int flos(){ return 25; }

int obs(){ return 5; }

boolean stateless(){ return true; }

###

Fitness-function tells what sounds good. Its already an AGI.

###

Fitness-function tells what sounds good. Its already an AGI.

Processes 10 kibibytes per second output from Audivolv.

###

Fitness-function tells what sounds good. Its already an AGI.

Processes 10 kibibytes per second output from Audivolv.

Inputs 2 bytes per second to Audivolv.

###

Fitness-function tells what sounds good. Its already an AGI.

Processes 10 kibibytes per second output from Audivolv.

Inputs 2 bytes per second to Audivolv.

Disadvantage of the hardware: stateful.

###

Fitness-function tells what sounds good. Its already an AGI.

Processes 10 kibibytes per second output from Audivolv.

Inputs 2 bytes per second to Audivolv.

Disadvantage of the hardware: stateful.

Its a Human, listens to speakers, moves mouse, optionally clicks Good/Bad.

###

Simpler fitness-function parts

Divide Human's score by code length.

70% of score flows to ancestors.

Errors are scored very low.

"Movement score" is higher for code thats harder to predict.

###

Hypercube vector fields

x = y; is a 2d hypercube

###

Hypercube vector fields

x = y; is a 2d hypercube

Some hypercubes have a time var that can go negative

b = if(c > 0) d; else e; If time is negative, d or e changes instead of b.

###

Hypercube vector fields

x = y; is a 2d hypercube

Some hypercubes have a time var that can go negative

b = if(c > 0) d; else e; If time is negative, d or e changes instead of b.

Reversible time vs a different version that assumes each possible past.

###

Hypercube vector fields

x = y; is a 2d hypercube

Some hypercubes have a time var that can go negative

b = if(c > 0) d; else e; If time is negative, d or e changes instead of b.

Reversible time vs a different version that assumes each possible past.

Generated code is __hypercube templates__ with vars renamed.

###

Movement score

Higher for code thats harder to predict.

Choose 100 random points in the hypercube (-1 to 1, 25 dimensions).

Start from each, and see how many times input->output->input before repeating.

Approximate. Which is it closest to?

###

Javassist

On-the-fly Java compiler

Compiles evolved code and what you type in "Create Musical Instruments" tab.

###

Demo

Evolve for different colors left/right, top/bottom, and different sounds.

Experimental mouse prediction mode.

###

Future designs

Derivatives on hypercube vector fields.

Evolve code to predict other evolved code.

###

Future designs

Learn to change music to control Humans hand on mouse

###

Future designs

Learn to change music to control Humans hand on mouse

Binary network of Funcs (each node has 2 childs).

###

Future designs

Learn to change music to control Humans hand on mouse

Binary network of Funcs (each node has 2 childs).

Each Func alone plays audio with mouse.

###

Future designs

Learn to change music to control Humans hand on mouse

Binary network of Funcs (each node has 2 childs).

Each Func alone plays audio with mouse.

Of many ways to move, control hand to move either of 2 specific ways.

###

Future designs

Learn to change music to control Humans hand on mouse

Binary network of Funcs (each node has 2 childs).

Each Func alone plays audio with mouse.

Of many ways to move, control hand to move either of 2 specific ways.

If not move either of those ways, weaken connection between those Funcs.

###

Future designs

Learn to change music to control Humans hand on mouse

Binary network of Funcs (each node has 2 childs).

Each Func alone plays audio with mouse.

Of many ways to move, control hand to move either of 2 specific ways.

If not move either of those ways, weaken connection between those Funcs.

If move 1 of those 2 ways, strengthen, and continue binary-search using mouse.

###

Future designs

Evolve connectionist nodes/functions

###

Future designs

Evolve connectionist nodes/functions

Node = network = constant-size array of variable-size arrays.

###

Future designs

Evolve connectionist nodes/functions

Node = network = constant-size array of variable-size arrays.

In the same node, array sizes depend on eachother: CONSTANTRANGE, EQUAL, MULTIPLY, or POWER.

###

Future designs

Evolve connectionist nodes/functions

Node = network = constant-size array of variable-size arrays.

In the same node, array sizes depend on eachother: CONSTANTRANGE, EQUAL, MULTIPLY, or POWER.

Examples: Bayesian node. Audio node.

###

Future designs

Evolve connectionist nodes/functions

Node = network = constant-size array of variable-size arrays.

In the same node, array sizes depend on eachother: CONSTANTRANGE, EQUAL, MULTIPLY, or POWER.

Examples: Bayesian node. Audio node.

HeapQueue is int[], int[], flo[].

###

Future designs

Evolve connectionist nodes/functions

Node = network = constant-size array of variable-size arrays.

In the same node, array sizes depend on eachother: CONSTANTRANGE, EQUAL, MULTIPLY, or POWER.

Examples: Bayesian node. Audio node.

HeapQueue is int[], int[], flo[].

All arrays are always completely full.

###

Future designs

Evolve connectionist nodes/functions

Node = network = constant-size array of variable-size arrays.

In the same node, array sizes depend on eachother: CONSTANTRANGE, EQUAL, MULTIPLY, or POWER.

Examples: Bayesian node. Audio node.

HeapQueue is int[], int[], flo[].

All arrays are always completely full.

Manually choose recursion limit (depth 5), array and flo var limits (range -1 to 1).

###

Future designs

Evolve connectionist nodes/functions

Node = network = constant-size array of variable-size arrays.

In the same node, array sizes depend on eachother: CONSTANTRANGE, EQUAL, MULTIPLY, or POWER.

Examples: Bayesian node. Audio node.

HeapQueue is int[], int[], flo[].

All arrays are always completely full.

Manually choose recursion limit (depth 5), array and flo var limits (range -1 to 1).

Evolve node types. Evolution chooses array types and their size equations.{

###

Future designs

Evolve connectionist nodes/functions

Node = network = constant-size array of variable-size arrays.

In the same node, array sizes depend on eachother: CONSTANTRANGE, EQUAL, MULTIPLY, or POWER.

Examples: Bayesian node. Audio node.

HeapQueue is int[], int[], flo[].

All arrays are always completely full.

Manually choose recursion limit (depth 5), array and flo var limits (range -1 to 1).

Evolve node types. Evolution chooses array types and their size equations.{

Evolve Func that runs a loop, and what vars to: recurse, lookup in heapQueue, read/write flo{

###

Future designs

Evolve connectionist nodes/functions

Node = network = constant-size array of variable-size arrays.

In the same node, array sizes depend on eachother: CONSTANTRANGE, EQUAL, MULTIPLY, or POWER.

Examples: Bayesian node. Audio node.

HeapQueue is int[], int[], flo[].

All arrays are always completely full.

Manually choose recursion limit (depth 5), array and flo var limits (range -1 to 1).

Evolve node types. Evolution chooses array types and their size equations.{

Evolve Func that runs a loop, and what vars to: recurse, lookup in heapQueue, read/write flo{

Evolve Func to be loop body, read/write constant number of flo (given by the loop Func).

###

Future designs

Evolve connectionist nodes/functions

Node = network = constant-size array of variable-size arrays.

In the same node, array sizes depend on eachother: CONSTANTRANGE, EQUAL, MULTIPLY, or POWER.

Examples: Bayesian node. Audio node.

HeapQueue is int[], int[], flo[].

All arrays are always completely full.

Manually choose recursion limit (depth 5), array and flo var limits (range -1 to 1).

Evolve node types. Evolution chooses array types and their size equations.{

Evolve Func that runs a loop, and what vars to: recurse, lookup in heapQueue, read/write flo{

Evolve Func to be loop body, read/write constant number of flo (given by the loop Func).

Play realtime audio, and thousands of times per second,

###

Future designs

Evolve connectionist nodes/functions

Node = network = constant-size array of variable-size arrays.

In the same node, array sizes depend on eachother: CONSTANTRANGE, EQUAL, MULTIPLY, or POWER.

Examples: Bayesian node. Audio node.

HeapQueue is int[], int[], flo[].

All arrays are always completely full.

Manually choose recursion limit (depth 5), array and flo var limits (range -1 to 1).

Evolve node types. Evolution chooses array types and their size equations.{

Evolve Func that runs a loop, and what vars to: recurse, lookup in heapQueue, read/write flo{

Evolve Func to be loop body, read/write constant number of flo (given by the loop Func).

Play realtime audio, and thousands of times per second,

change which 1-5 Funcs are currently playing, traversing and updating the network using the mouse.

###

Future designs

Internet

Has same behaviors as without internet, but smarter.

###

Future designs

Internet

Has same behaviors as without internet, but smarter.

Learn to copy 1 person's hand movements to other person's hand movements,

###

Future designs

Internet

Has same behaviors as without internet, but smarter.

Learn to copy 1 person's hand movements to other person's hand movements,

while each person hears different music.

###

Future designs

Internet

Has same behaviors as without internet, but smarter.

Learn to copy 1 person's hand movements to other person's hand movements,

while each person hears different music.

Similar to the binary Func network, everyone does binary search on people.

###

END

http://audivolv.com

Ben F Rayfield

Open-source license: GNU GPL 2+

###

CodeSimian

Audivolv can create plugins on-the-fly.

Example code for a "CodeSimian Plugin" tab.

Natural-language chatbot, audio synthesis, does too many things...