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