void setup() { size(893, 50); smooth(); } void draw() { strokeWeight(2); float offset = 126.0; float scaleVal = 126.0; float angleInc = map(mouseX, 0, 893, 0, TWO_PI); float angle = PI; for (int x = -52; x <= width; x +=5) { float y = offset + (sin(angle) * scaleVal); stroke(y); line(x, 0, x+50, height); angle += angleInc; } }