+class TestCubePattern extends SCPattern {
+
+ private SawLFO index = new SawLFO(0, Cube.POINTS_PER_CUBE, Cube.POINTS_PER_CUBE*60);
+
+ TestCubePattern(GLucose glucose) {
+ super(glucose);
+ addModulator(index).start();
+ }
+
+ public void run(int deltaMs) {
+ for (Cube c : model.cubes) {
+ int i = 0;
+ for (Point p : c.points) {
+ colors[p.index] = color(
+ lx.getBaseHuef(),
+ 100,
+ max(0, 100 - 80.*abs(i - index.getValuef()))
+ );
+ ++i;
+ }
+ }
+ }
+}
+