1 class JackieSquares extends SCPattern {
2 private BasicParameter rateParameter = new BasicParameter("RATE", 0.25);
3 private BasicParameter attackParameter = new BasicParameter("ATTK", 0.3);
4 private BasicParameter decayParameter = new BasicParameter("DECAY", 0.2);
5 private BasicParameter saturationParameter = new BasicParameter("SAT", 0.7);
7 SinLFO hueMod = new SinLFO(0, 360, 4000);
8 SinLFO spreadMod = new SinLFO(1, 10, 8000);
18 f = model.faces.get(n % model.faces.size());
20 boolean infiniteAttack = (attackParameter.getValuef() > 0.999);
21 hasPeaked = infiniteAttack;
22 value = (infiniteAttack ? 1 : 0);
25 // returns TRUE if this should die
26 boolean age(double ms) {
28 value = value + (float) (ms / 1000.0f * ((attackParameter.getValuef() + 0.01) * 5));
35 value = value - (float) (ms / 1000.0f * ((decayParameter.getValuef() + 0.01) * 10));
41 private float leftoverMs = 0;
42 private List<FaceFlash> flashes;
43 private int faceNum = 0;
45 public JackieSquares(LX lx) {
47 addParameter(rateParameter);
48 addParameter(attackParameter);
49 addParameter(decayParameter);
50 addParameter(saturationParameter);
51 addModulator(hueMod).trigger();
52 addModulator(spreadMod).trigger();
54 flashes = new LinkedList<FaceFlash>();
57 public void run(double deltaMs) {
58 leftoverMs += deltaMs;
59 float msPerFlash = 1000 / ((rateParameter.getValuef() + .01) * 100);
60 while (leftoverMs > msPerFlash) {
61 leftoverMs -= msPerFlash;
62 faceNum += int(spreadMod.getValuef());
63 flashes.add(new FaceFlash(faceNum));
66 for (LXPoint p : model.points) {
70 for (FaceFlash flash : flashes) {
71 float hue = (hueMod.getValuef() + flash.hue) % 360.0;
72 color c = lx.hsb(hue, saturationParameter.getValuef() * 100, (flash.value) * 100);
73 for (LXPoint p : flash.f.points) {
78 Iterator<FaceFlash> i = flashes.iterator();
80 FaceFlash flash = i.next();
81 boolean dead = flash.age(deltaMs);
90 class JackieLines extends SCPattern {
91 private BasicParameter rateParameter = new BasicParameter("RATE", 0.25);
92 private BasicParameter attackParameter = new BasicParameter("ATTK", 0.3);
93 private BasicParameter decayParameter = new BasicParameter("DECAY", 0.2);
94 private BasicParameter saturationParameter = new BasicParameter("SAT", 0.7);
96 SinLFO hueMod = new SinLFO(0, 360, 4000);
97 SinLFO spreadMod = new SinLFO(1, 10, 8000);
107 f = model.strips.get(n % model.strips.size());
109 boolean infiniteAttack = (attackParameter.getValuef() > 0.999);
110 hasPeaked = infiniteAttack;
111 value = (infiniteAttack ? 1 : 0);
114 // returns TRUE if this should die
115 boolean age(double ms) {
117 value = value + (float) (ms / 1000.0f * ((attackParameter.getValuef() + 0.01) * 5));
124 value = value - (float) (ms / 1000.0f * ((decayParameter.getValuef() + 0.01) * 10));
130 private float leftoverMs = 0;
131 private List<StripFlash> flashes;
132 private int stripNum = 0;
134 public JackieLines(LX lx) {
136 addParameter(rateParameter);
137 addParameter(attackParameter);
138 addParameter(decayParameter);
139 addParameter(saturationParameter);
140 addModulator(hueMod).trigger();
141 addModulator(spreadMod).trigger();
143 flashes = new LinkedList<StripFlash>();
146 public void run(double deltaMs) {
147 leftoverMs += deltaMs;
148 float msPerFlash = 1000 / ((rateParameter.getValuef() + .01) * 100);
149 while (leftoverMs > msPerFlash) {
150 leftoverMs -= msPerFlash;
151 stripNum += int(spreadMod.getValuef());
152 flashes.add(new StripFlash(stripNum));
155 for (LXPoint p : model.points) {
159 for (StripFlash flash : flashes) {
160 float hue = (hueMod.getValuef() + flash.hue) % 360.0;
161 color c = lx.hsb(hue, saturationParameter.getValuef() * 100, (flash.value) * 100);
162 for (LXPoint p : flash.f.points) {
167 Iterator<StripFlash> i = flashes.iterator();
168 while (i.hasNext()) {
169 StripFlash flash = i.next();
170 boolean dead = flash.age(deltaMs);
180 class JackieDots extends SCPattern {
181 private BasicParameter rateParameter = new BasicParameter("RATE", 0.15);
182 private BasicParameter attackParameter = new BasicParameter("ATTK", 0.3);
183 private BasicParameter decayParameter = new BasicParameter("DECAY", 0.2);
184 private BasicParameter saturationParameter = new BasicParameter("SAT", 0.7);
186 SinLFO hueMod = new SinLFO(0, 360, 4000);
187 SinLFO spreadMod = new SinLFO(1, 10, 16000);
197 f = model.points.get(n % model.points.size());
199 boolean infiniteAttack = (attackParameter.getValuef() > 0.999);
200 hasPeaked = infiniteAttack;
201 value = (infiniteAttack ? 1 : 0);
204 // returns TRUE if this should die
205 boolean age(double ms) {
207 value = value + (float) (ms / 1000.0f * ((attackParameter.getValuef() + 0.01) * 5));
214 value = value - (float) (ms / 1000.0f * ((decayParameter.getValuef() + 0.01) * 10));
220 private float leftoverMs = 0;
221 private List<PointFlash> flashes;
222 private int pointNum = 0;
224 public JackieDots(LX lx) {
226 addParameter(rateParameter);
227 addParameter(attackParameter);
228 addParameter(decayParameter);
229 addParameter(saturationParameter);
230 addModulator(hueMod).trigger();
231 addModulator(spreadMod).trigger();
233 flashes = new LinkedList<PointFlash>();
236 public void run(double deltaMs) {
237 leftoverMs += deltaMs;
238 float msPerFlash = 1000 / ((rateParameter.getValuef() + .01) * 5000);
239 while (leftoverMs > msPerFlash) {
240 leftoverMs -= msPerFlash;
241 pointNum += int(spreadMod.getValuef());
242 flashes.add(new PointFlash(pointNum));
245 for (LXPoint p : model.points) {
249 for (PointFlash flash : flashes) {
250 float hue = (hueMod.getValuef() + flash.hue) % 360.0;
251 color c = lx.hsb(hue, saturationParameter.getValuef() * 100, (flash.value) * 100);
252 colors[flash.f.index] = c;
255 Iterator<PointFlash> i = flashes.iterator();
256 while (i.hasNext()) {
257 PointFlash flash = i.next();
258 boolean dead = flash.age(deltaMs);