+/**
+ * This shows how to iterate over towers, enumerated in the model.
+ */
+class TestTowerPattern extends SCPattern {
+ private final SawLFO towerIndex = new SawLFO(0, model.towers.size(), 1000*model.towers.size());
+
+ public TestTowerPattern(GLucose glucose) {
+ super(glucose);
+ addModulator(towerIndex).trigger();
+ }
+
+ public void run(int deltaMs) {
+ int ti = 0;
+ for (Tower t : model.towers) {
+ for (Point p : t.points) {
+ colors[p.index] = color(
+ lx.getBaseHuef(),
+ 100,
+ max(0, 100 - 80*LXUtils.wrapdistf(ti, towerIndex.getValuef(), model.towers.size()))
+ );
+ }
+ ++ti;
+ }
+ }
+
+}
+