X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=MarkSlee.pde;h=0adbe5589d680b8f9b5e4866067316587dd12f53;hb=254fbb6855f64f25317a5226aa1bc5f47274251d;hp=7b1b86bae1af50c5ec8409f89a9506e4bd6493ff;hpb=9b893d9614672cc7ec0e9ed8e9e67388737a3c17;p=SugarCubes.git diff --git a/MarkSlee.pde b/MarkSlee.pde index 7b1b86b..0adbe55 100644 --- a/MarkSlee.pde +++ b/MarkSlee.pde @@ -1,6 +1,6 @@ class SpaceTime extends SCPattern { - SinLFO pos = new SinLFO(0, 15, 3000); + SinLFO pos = new SinLFO(0, 1, 3000); SinLFO rate = new SinLFO(1000, 9000, 13000); SinLFO falloff = new SinLFO(10, 70, 5000); float angle = 0; @@ -8,8 +8,10 @@ class SpaceTime extends SCPattern { BasicParameter rateParameter = new BasicParameter("RATE", 0.5); BasicParameter sizeParameter = new BasicParameter("SIZE", 0.5); + public SpaceTime(GLucose glucose) { super(glucose); + addModulator(pos).trigger(); addModulator(rate).trigger(); addModulator(falloff).trigger(); @@ -39,10 +41,10 @@ class SpaceTime extends SCPattern { int i = 0; for (Point p : strip.points) { colors[p.index] = color( - (lx.getBaseHuef() + 360 - p.fx*.2 + p.fy * .3) % 360, - constrain(.4 * min(abs(s - sVal1), abs(s - sVal2)), 20, 100), - max(0, 100 - fVal*abs(i - pVal)) - ); + (lx.getBaseHuef() + 360 - p.fx*.2 + p.fy * .3) % 360, + constrain(.4 * min(abs(s - sVal1), abs(s - sVal2)), 20, 100), + max(0, 100 - fVal*abs(i - pVal*(strip.metrics.numPoints - 1))) + ); ++i; } ++s; @@ -52,7 +54,7 @@ class SpaceTime extends SCPattern { class Swarm extends SCPattern { - SawLFO offset = new SawLFO(0, 16, 1000); + SawLFO offset = new SawLFO(0, 1, 1000); SinLFO rate = new SinLFO(350, 1200, 63000); SinLFO falloff = new SinLFO(15, 50, 17000); SinLFO fX = new SinLFO(0, model.xMax, 19000); @@ -61,6 +63,7 @@ class Swarm extends SCPattern { public Swarm(GLucose glucose) { super(glucose); + addModulator(offset).trigger(); addModulator(rate).trigger(); addModulator(falloff).trigger(); @@ -83,14 +86,14 @@ class Swarm extends SCPattern { void run(int deltaMs) { float s = 0; - for (Strip strip : model.strips) { + for (Strip strip : model.strips ) { int i = 0; for (Point p : strip.points) { float fV = max(-1, 1 - dist(p.fx/2., p.fy, fX.getValuef()/2., fY.getValuef()) / 64.); colors[p.index] = color( (lx.getBaseHuef() + 0.3 * abs(p.fx - hOffX.getValuef())) % 360, constrain(80 + 40 * fV, 0, 100), - constrain(100 - (30 - fV * falloff.getValuef()) * modDist(i + (s*63)%61, offset.getValuef(), 16), 0, 100) + constrain(100 - (30 - fV * falloff.getValuef()) * modDist(i + (s*63)%61, (int) (offset.getValuef() * strip.metrics.numPoints), strip.metrics.numPoints), 0, 100) ); ++i; } @@ -449,7 +452,7 @@ class Blinders extends SCPattern { colors[p.index] = color( (hv + p.fz + p.fy*hs.getValuef()) % 360, min(100, abs(p.fx - s.getValuef())/2.), - max(0, 100 - mv/2. - mv * abs(i - 7.5)) + max(0, 100 - mv/2. - mv * abs(i - (strip.metrics.length-1)/2.)) ); ++i; }