X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=TobySegaran.pde;h=fd4a44217fb2b4329007da40a9420492b85325c5;hb=821ceae95aca73def4a6d5abc36e0065895cfa37;hp=a46ef4a22a210d3ef9d81c7b1dc93d0b8972d6b7;hpb=1b8ec15f473ce870790425148d7c73255bbe4433;p=SugarCubes.git diff --git a/TobySegaran.pde b/TobySegaran.pde index a46ef4a..fd4a442 100644 --- a/TobySegaran.pde +++ b/TobySegaran.pde @@ -30,7 +30,7 @@ class GlitchPlasma extends SCPattern { + 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); float bv = 100; - colors[p.index] = color((hv+2)*25, satu, bv); + colors[p.index] = color((hv+2)*50, satu, bv); } if (random(1.0)bright[p.index]) { @@ -131,7 +131,7 @@ class StripBounce extends SCPattern { } } -class SoundCubes extends SCPattern { +class SoundRain extends SCPattern { private FFT fft = null; private LinearEnvelope[] bandVals = null; @@ -139,7 +139,7 @@ class SoundCubes extends SCPattern { private int avgSize; SawLFO pos = new SawLFO(0, 9, 8000); - public SoundCubes(GLucose glucose) { + public SoundRain(GLucose glucose) { super(glucose); addModulator(pos).trigger(); } @@ -164,21 +164,54 @@ class SoundCubes extends SCPattern { float value = this.fft.getAvg(i); this.bandVals[i].setEndVal(value,40).trigger(); float lv = min(value*25,100); - if (lv>lightVals[i]-6) { - lightVals[i]=lv; + if (lv>lightVals[i]) { + lightVals[i]=min(lightVals[i]+10,lv,100); } else { - lightVals[i]=lightVals[i]-6; + lightVals[i]=max(lv,lightVals[i]-5,0); } } for (int i=0; i