2 class TelevisionStatic extends SCPattern {
3 BasicParameter brightParameter = new BasicParameter("BRIGHT", 1.0);
4 BasicParameter saturationParameter = new BasicParameter("SAT", 1.0);
5 BasicParameter hueParameter = new BasicParameter("HUE", 1.0);
6 SinLFO direction = new SinLFO(0, 10, 3000);
8 public TelevisionStatic(LX lx) {
10 addModulator(direction).trigger();
11 addParameter(brightParameter);
12 addParameter(saturationParameter);
13 addParameter(hueParameter);
16 void run(double deltaMs) {
17 boolean d = direction.getValuef() > 5.0;
18 for (LXPoint p : model.points) {
19 colors[p.index] = lx.hsb((lx.getBaseHuef() + random(hueParameter.getValuef() * 360))%360, random(saturationParameter.getValuef() * 100), random(brightParameter.getValuef() * 100));
24 class AbstractPainting extends SCPattern {
28 SinLFO colorMod = new SinLFO(0, 360, 5000);
29 SinLFO brightMod = new SinLFO(0, model.zMax, 2000);
31 public AbstractPainting(LX lx) {
33 addModulator(colorMod).trigger();
34 addModulator(brightMod).trigger();
36 img = loadImage("abstract.jpg");
40 void run(double deltaMs) {
41 for (LXPoint p : model.points) {
42 color c = img.get((int)((p.x / model.xMax) * img.width), img.height - (int)((p.y / model.yMax) * img.height));
43 colors[p.index] = lx.hsb(hue(c) + colorMod.getValuef()%360, saturation(c), brightness(c) - ((p.z - brightMod.getValuef())/p.z));
48 class Spirality extends SCPattern {
49 final BasicParameter r = new BasicParameter("RADIUS", 0.5);
58 for (LXPoint p : model.points) {
59 colors[p.index] = lx.hsb(0, 0, 0);
63 public void run(double deltaMs) {
64 angle += deltaMs * 0.007;
65 rad += deltaMs * .025 * direction;
66 float x = model.xMax / 2 + cos(angle) * rad;
67 float y = model.yMax / 2 + sin(angle) * rad;
68 for (LXPoint p : model.points) {
69 float b = dist(x,y,p.x,p.y);
71 colors[p.index] = blendColor(
73 lx.hsb(lx.getBaseHuef() + 25, 10, map(b, 0, 10, 100, 0)),
76 colors[p.index] = blendColor(
78 lx.hsb(25, 10, map(b, 0, 10, 0, 15)),
82 if (rad > model.xMax / 2 || rad <= .001) {