class SpaceTime extends SCPattern {
- SinLFO pos = new SinLFO(0, 15, 3000);
+ SinLFO pos = new SinLFO(0, 1, 3000);
SinLFO rate = new SinLFO(1000, 9000, 13000);
SinLFO falloff = new SinLFO(10, 70, 5000);
float angle = 0;
BasicParameter rateParameter = new BasicParameter("RATE", 0.5);
BasicParameter sizeParameter = new BasicParameter("SIZE", 0.5);
+
public SpaceTime(GLucose glucose) {
super(glucose);
+
addModulator(pos).trigger();
addModulator(rate).trigger();
addModulator(falloff).trigger();
int i = 0;
for (Point p : strip.points) {
colors[p.index] = color(
- (lx.getBaseHuef() + 360 - p.fx*.2 + p.fy * .3) % 360,
- constrain(.4 * min(abs(s - sVal1), abs(s - sVal2)), 20, 100),
- max(0, 100 - fVal*abs(i - pVal))
- );
+ (lx.getBaseHuef() + 360 - p.fx*.2 + p.fy * .3) % 360,
+ constrain(.4 * min(abs(s - sVal1), abs(s - sVal2)), 20, 100),
+ max(0, 100 - fVal*abs(i - pVal*(strip.metrics.numPoints - 1)))
+ );
++i;
}
++s;
class Swarm extends SCPattern {
- SawLFO offset = new SawLFO(0, 16, 1000);
+ SawLFO offset = new SawLFO(0, 1, 1000);
SinLFO rate = new SinLFO(350, 1200, 63000);
SinLFO falloff = new SinLFO(15, 50, 17000);
SinLFO fX = new SinLFO(0, model.xMax, 19000);
public Swarm(GLucose glucose) {
super(glucose);
+
addModulator(offset).trigger();
addModulator(rate).trigger();
addModulator(falloff).trigger();
void run(int deltaMs) {
float s = 0;
- for (Strip strip : model.strips) {
+ for (Strip strip : model.strips ) {
int i = 0;
for (Point p : strip.points) {
float fV = max(-1, 1 - dist(p.fx/2., p.fy, fX.getValuef()/2., fY.getValuef()) / 64.);
colors[p.index] = color(
(lx.getBaseHuef() + 0.3 * abs(p.fx - hOffX.getValuef())) % 360,
constrain(80 + 40 * fV, 0, 100),
- constrain(100 - (30 - fV * falloff.getValuef()) * modDist(i + (s*63)%61, offset.getValuef(), 16), 0, 100)
+ constrain(100 - (30 - fV * falloff.getValuef()) * modDist(i + (s*63)%61, (int) (offset.getValuef() * strip.metrics.numPoints), strip.metrics.numPoints), 0, 100)
);
++i;
}
colors[p.index] = color(
(hv + p.fz + p.fy*hs.getValuef()) % 360,
min(100, abs(p.fx - s.getValuef())/2.),
- max(0, 100 - mv/2. - mv * abs(i - 7.5))
+ max(0, 100 - mv/2. - mv * abs(i - (strip.metrics.length-1)/2.))
);
++i;
}