From: Toby Segaran Date: Sat, 10 Aug 2013 22:58:32 +0000 (-0700) Subject: Improved efficiency X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=a673599fd3ecf7c81ca05959416cc242dfe679fd;p=SugarCubes.git Improved efficiency --- diff --git a/SugarCubes.pde b/SugarCubes.pde index 63dd033..aa794b4 100644 --- a/SugarCubes.pde +++ b/SugarCubes.pde @@ -34,7 +34,7 @@ LXPattern[] patterns(GLucose glucose) { new Psychedelia(glucose), new CubeEQ(glucose), new PianoKeyPattern(glucose), - new WarmPlasma(glucose), + new GlitchPlasma(glucose), new FireEffect(glucose), new StripBounce(glucose), //new SineSphere(glucose), diff --git a/TobySegaran.pde b/TobySegaran.pde index 5735cc3..722f4d4 100644 --- a/TobySegaran.pde +++ b/TobySegaran.pde @@ -1,4 +1,4 @@ -class WarmPlasma extends SCPattern { +class GlitchPlasma extends SCPattern { private int pos = 0; private float satu = 100; private float speed = 1; @@ -7,7 +7,7 @@ class WarmPlasma extends SCPattern { BasicParameter speedParameter = new BasicParameter("SPEED", 0.1); BasicParameter glitchParameter = new BasicParameter("GLITCH", 0.0); - public WarmPlasma(GLucose glucose) { + public GlitchPlasma(GLucose glucose) { super(glucose); addParameter(saturationParameter); addParameter(speedParameter); @@ -17,7 +17,7 @@ class WarmPlasma extends SCPattern { if (parameter == saturationParameter) { satu = 100*parameter.getValuef(); } else if (parameter == speedParameter) { - speed = 10*parameter.getValuef(); + speed = 8*parameter.getValuef(); } else if (parameter == glitchParameter) { glitch = parameter.getValuef(); } @@ -32,8 +32,8 @@ class WarmPlasma extends SCPattern { float bv = 100; colors[p.index] = color((hv+2)*25, satu, bv); } - if (random(1.0)= MAX_INT-1) pos=0; @@ -116,11 +116,7 @@ class StripBounce extends SCPattern { for (Strip strip : model.strips) { for (int i=0;i