Thank you very much. The changes including the last one, which I tested maintaining the k array in draw, but using the rgb channel values directly from the pixel color improves the speed a lot. When using an 800/800 canvas, the original sketch nearly stops, but when using the values directly, the sketch still runs fluidly. So that’s a big win. My goal was trying to make a processing’s tweet of it, but that is not going to happen. Still far too much characters ![]()
a=k=,r=42,g=84,b=128,u=v=p=0,s=32,setup=e=>{createCanvas(w=400,w),pixelDensity(1);for(let e=0;e<w;e++)for(let i=0;i<4w;i++)a[4e+4iw]=int((b+bsin(e/32)+(b+bcos(i/s))+(b+bsin(sqrt(ee+ii)/s)))/4);for(i=0;i<128;i++)u=sin(.12i),v=sin(iPI/50+.79),k[i]=color(r+ub,g+vb,b+ub)},draw=e=>{p++,loadPixels();for(let e=0;e<pixels.length;e+=4)c=k[a[e]+p&127],pixels[e]=c._getRed(),pixels[e+1]=c._getGreen(),pixels[e+2]=c._getBlue(),pixels[e+3]=255;updatePixels()};//#つぶやきProcessing