import processing.sound.*;
SoundFile song;
int n;
Square[] rect;
float x2 = 0;
//float noiseScale = 0.0002;
void setup() {
size(400, 400);
song = new SoundFile(this, “kgf.mp3”);
song.loop();
n = 30;
rect = new Square[n];
for (int i=0; i<n; i++) {
rect[i] = new Square(i);
}
}
void draw() {
background(0);
for (int i=0; i<n; i++) {
rect[i].display();
}
}
class Square {
Square(int index) {
}
void display() {
float x1 = 0;
float x = 0, y = 0;
fill(random(255), random(255), random(255));
for (int i = 0; i < width; i++) {
//stroke(random(255));
//strokeWeight(1);
rect(i*30, noise(x1, x2)*300, 10, 10);
x1 += map(i, 0, width, 0, 200);
frameRate(10);
}
for (int j = 0; j < 20; j++) {
x2 += map(j, 0, height, 0, 9);
}
}
}