xxxxxxxxxx
26
s = [], t = v = 22;
setup = () => {
createCanvas(w = 200, w);
frameRate(9);
for (j = -1; ++j < 8;) {
for (i = -1; ++i < 8;) {
c = createCheckbox().position(i * v, j * v);
o = new p5.SinOsc(w + j * w)
o.amp(0)
o.start()
c.o = o
s.push(c)
}
}
}
draw = () => {
clear();
rect((t = ++t % 8) * v, 0, v, 180);
for (i = -1; ++i < 8;)
if ((b=s[i * 8 + t]).checked()) {
b.o.amp(.5)
b.o.amp(0, .1)
};
}