X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=TobySegaran.pde;h=a54658f9bcbdc1e346b02ef7b6aaf5a33a8fe5f2;hb=4749563ed0cc35bde6bdd13eecdfc6e361d5320b;hp=32b6d82aaa6a321a274e6196f167dc23d84d0f8b;hpb=34327c962351112e07c3d93f56ffc543fac45b58;p=SugarCubes.git diff --git a/TobySegaran.pde b/TobySegaran.pde index 32b6d82..a54658f 100644 --- a/TobySegaran.pde +++ b/TobySegaran.pde @@ -24,13 +24,13 @@ class GlitchPlasma extends SCPattern { } public void run(double deltaMs) { - for (Point p : model.points) { - float hv = sin(dist(p.fx + pos, p.fy, 128.0, 128.0) / 8.0) - + sin(dist(p.fx, p.fy, 64.0, 64.0) / 8.0) - + sin(dist(p.fx, p.fy + pos / 7, 192.0, 64.0) / 7.0) - + sin(dist(p.fx, p.fz + pos, 192.0, 100.0) / 8.0); + for (LXPoint p : model.points) { + float hv = sin(dist(p.x + pos, p.y, 128.0, 128.0) / 8.0) + + sin(dist(p.x, p.y, 64.0, 64.0) / 8.0) + + sin(dist(p.x, p.y + pos / 7, 192.0, 64.0) / 7.0) + + sin(dist(p.x, p.z + pos, 192.0, 100.0) / 8.0); float bv = 100; - colors[p.index] = color((hv+2)*50, satu, bv); + colors[p.index] = lx.hsb((hv+2)*50, satu, bv); } if (random(1.0)bright[p.index]) { - colors[p.index] = color(hv,sat[i].getValuef(),br); + colors[p.index] = lx.hsb(hv,sat[i].getValuef(),br); bright[p.index] = br; } } @@ -154,7 +154,7 @@ class SoundRain extends SCPattern { gain = 50*parameter.getValuef(); } } - protected void onActive() { + void onActive() { if (this.fft == null) { this.fft = new FFT(lx.audioInput().bufferSize(), lx.audioInput().sampleRate()); this.fft.window(FFT.HAMMING); @@ -184,10 +184,10 @@ class SoundRain extends SCPattern { for (int j=0; javgSize) seq=avgSize-seq; seq=constrain(seq,0,avgSize-1); - float br=max(0, lightVals[seq]-p.fy); - colors[p.index] = color((dis*avgSize*65)/model.xMax,90,br); + float br=max(0, lightVals[seq]-p.y); + colors[p.index] = lx.hsb((dis*avgSize*65)/model.xMax,90,br); } } }