int NUM = 10, WEIGHT = 0; float D = 0.0; void setup() { size(600, 600); frameRate(60); smooth(); noFill(); colorMode(HSB); stroke(255); background(0); } void keyPressed() { if (key >= '0' && key <= '9') WEIGHT = int("" + key); } void draw() { noStroke(); fill(0, 0, 0, 5); rect(0, 0, width, height); if (0 == WEIGHT) strokeWeight((frameCount % 30) < 20 ? 1 : 5); else strokeWeight(WEIGHT); noFill(); stroke(frameCount % 255, 127, 255, 150); D += 0.001; beginShape(); curveVertex(0, frameCount % height); for (int x = 0; x < width; x += width / NUM) { float y = (0.5 - noise((PI + x + frameCount * 0.1) * 0.01 * D)) * height / 2; curveVertex(x, y + (frameCount % height)); } curveVertex(width, frameCount % height); curveVertex(width, frameCount % height); endShape(); }