/** * kenny smith * Created 24 april 2007 */ import krister.Ess.*; AudioChannel myChannel; SquareWave myWave; void setup(){ frameRate(12); size(500, 500); noCursor(); colorMode(HSB, 255); noStroke(); Ess.start(this); myChannel=new AudioChannel(); myChannel.initChannel(myChannel.frames(1000)); } void draw(){ if(mousePressed) { myWave=new SquareWave(mouseX/2,0.2); myWave.generate(myChannel,0,myChannel.frames(1000)); myWave=new SquareWave(mouseX/2,0.2); myWave.generate(myChannel,0,myChannel.frames(1000)); } myChannel.play(); color inside = color(mouseX/2, 5, mouseY/2); color middle = color(mouseX-126, 126, 255); color outside = color(mouseX+126, 126, 255); background(mouseX, mouseY, 255); rec(mouseX, mouseY, 5, inside, middle, outside); } void rec(int x, int y, int t, color inside, color middle, color outside) { if (t > 0){ outside += color (20,20,20); middle += color (20,20,20); x = int (x *1.1); y = int (y *1.1); fill(outside); rect(x, y, int(x * (0.25*t)), int(y * (0.25*t))); fill(middle); rect(x+ 100, y + 100, int(x * (0.25*t)), int(y * (0.25*t))); t--; rec(x, y, t, inside, middle, outside); } else return; } void reiter(int x, int y, color inside, color middle, color outside) { int i = 1; int j = 1; int hor =0; int vert = 0; for (j = 1; j <= 5; j++) { for (i = 1; i <= 5; i++) { hor = i*100; fill(outside); rect(hor-100, (100*j)-100 , 90, 90); fill(middle); rect(hor-80, (100*j)-80, 50, 50); fill(inside); rect(hor-60, (100*j)-60, 10, 10); } } }