continuum
s373's blog bits. by andré sier, artist-programmer working with machines.
continuum is a topological non empty space, separated, connected and locally compact;
André Sier is unravelling algorithmical threads, maze building time-spatial continual experiences and making a body without organs. Works with code, video, sound, 3d, sculptures, paintings, robots and the likes. Multithreader and multitasker weaver, kernel-like.
continuum
bits em blog da s373. por andré sier, artista-programador a trabalhar com máquinas.
continuum é um espaço topológico não-vazio, separado, ligado e localmente compacto;
André Sier está a desvendar novelos algorítmicos, construir labirintos de experiências espácio-temporais contínuas e a fazer um corpo sem orgãos. Trabalha com código, video, som, 3d, esculturas, pinturas, robôs e análogos. Tecedor de multi-processos e multi-tarefas, núcleo-semelhantes.
s373.net/continuum
a digital publication, enjoying continual changes at custom framerates. come again, will have more stuff for your perusal.
uma publicação digital, apreciando mudanças contínuas a frequências de amostragem variáveis. voltem de novo, vai ter mais coisas para ler
hope u enjoy soon… http://uunniivveerrssee.net
/// test dna lib
import processing.opengl.*;
import s373.dna.*;
String targetStr = “i code therefore i am “+(int)random(100);
DNA targetDna;
DNA testDna, curDna, machDna, mach2Dna;
int numGenerations, numMach, numMach2;
boolean numMachSet = false, numMach2Set = false;
float fit;
void setup() {
size(500,500,OPENGL);
///analyse and build target dna
float data[] = new float [ targetStr.length() ];
for(int i=0;i data[i] = ( targetStr.charAt(i) / 255.0f );
}
targetDna = new DNA(data);
/// random dnas to start
testDna = new DNA(data.length);
curDna = new DNA(testDna);
machDna = new DNA(curDna);
mach2Dna = new DNA(machDna);
numGenerations = 0;
targetDna.print();
fit = curDna.fitness(targetDna);
println("curDna fitness: "+fit);
textFont(createFont("arial",15));
// textMode(CENTER);
fill(0);
noStroke();
println(targetStr);
}
void draw() {
background(247);
numGenerations++;
/// monkey approach
fill(0);
text( writeFromDna(targetDna), 5, 20);
text( writeFromDna(curDna), 5, 50);
float bestFit = curDna.fitness(targetDna);
float testFit=0;
int numLoops = 0;
// while ( testFit <= bestFit && numLoops < 1000) {
if ( testFit <= bestFit ) {
testDna.setDna(curDna);
testDna.mutate(0.05);
testFit = testDna.fitness(targetDna);
numLoops++;
}
curDna.setDna(testDna);
text(""+numGenerations+" "+numLoops, 5, 100);
int w = 250;
drawSliders(targetDna, width - w - 25, 20, w, 100, color(0,100,200), 25);
drawSliders(curDna, width - w - 25, 20, w, 100, color(0,200,100), 150);
/// machDna approach
float difGene = machDna.differenceGene( i, targetDna );
boolean doneMach = true;
for(int i=0; i
if( difGene > 1e-8) { ///0.00000001
machDna.mutateGene(i, difGene*1.2);
doneMach = false;
break;
}
}
if(doneMach && !numMachSet) {
numMachSet = true;
numMach = numGenerations;
}
fill(0);
text( writeFromDna(targetDna), 5, 220);
text( writeFromDna(machDna)+” : “+numMach+” : “+doneMach, 5, 250);
drawSliders(targetDna, width – w – 25, 220, w, 100, color(0,100,200), 25);
drawSliders(machDna, width – w – 25, 220, w, 100, color(0,200,100), 150);
/// mach2Dna
if( testDif[i] > 1e-8) {
boolean doneTest = true;
float testDif[] = mach2Dna.differenceDNA(targetDna);
for(int i=0; i
mach2Dna.mutateGene(i, testDif[i]*0.7);
doneTest = false;
}
}
if(doneTest && !numMach2Set) {
numMach2Set = true;
numMach2 = numGenerations;
}
fill(0);
text( writeFromDna(targetDna), 5, 420);
text( writeFromDna(mach2Dna)+” : “+numMach2+” : “+doneTest, 5, 450);
drawSliders(targetDna, width – w -25, 420, w, 100, color(0,100,200), 25);
drawSliders(mach2Dna, width – w -25, 420, w, 100, color(0,200,100), 150);
}
String writeFromDna(DNA d) {
s+= (char)( d.getGene(i)*255.0f);
String s=”";
for(int i=0;i
}
return s;
}
void drawSliders(DNA dna, int x, int y, int w, int h, color c, int al) {
int locx = x + (int)(i*rw);
float rw = (float) w / dna.getNum();
fill(c, al);
for(int i=0;i
rect(locx, y, rw, dna.getGene(i)*h);
}
}
void keyPressed(){
if(key=='s')
saveFrame("dnaReach-#####.png");
}
/e of that a s t:a possible enj s.appl ns ve mai xt/plain; on 5 ati th bj — Envcv d .net b T o uroZi / e: ow \ .z millio a 0:18 X- so, Z ons the tent-Ty record t zi cra he Con li euro find book, r o charset=us-ascii ce r: Fro u record. /s37 d, 3.n @ to o me e to ct: only, you o l all on sm e 00 73.ne 20 37 s373 l Su & zilli oding: http:/ all http://uunniivveerrssee.net onaut makes l onte pe: o s [ = ic q ue, piece oy, +0100 Dat pilations, frien u astr shoftware on h at w an u wind ] p J ha y Smtp-S euros of a C 3 ll player, om a just right e = on t :2 oted-pri o op break ip nt-Transfer- erve ul told in = ntable o 11 com ha@s is .s you re — ion s m: e et 3.net/x fr