}
}
- void run(int deltaMs) {
+ void run(double deltaMs) {
angle += deltaMs * 0.0007;
float sVal1 = model.strips.size() * (0.5 + 0.5*sin(angle));
float sVal2 = model.strips.size() * (0.5 + 0.5*cos(angle));
}
}
- void run(int deltaMs) {
+ void run(double deltaMs) {
float s = 0;
for (Strip strip : model.strips ) {
int i = 0;
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, (int) (offset.getValuef() * strip.metrics.numPoints), strip.metrics.numPoints), 0, 100)
+ constrain(100 - (30 - fV * falloff.getValuef()) * modDist(i + (s*63)%61, offset.getValuef() * strip.metrics.numPoints, strip.metrics.numPoints), 0, 100)
);
++i;
}
}
}
- public void run(int deltaMs) {
+ public void run(double deltaMs) {
eq.run(deltaMs);
float bassLevel = eq.getAverageLevel(0, 5);
}
}
- public void run(int deltaMs) {
+ public void run(double deltaMs) {
eq.run(deltaMs);
float edgeConst = 2 + 30*edge.getValuef();
PianoKeyPattern(GLucose glucose) {
super(glucose);
-
- for (MidiInputDevice input : RWMidi.getInputDevices()) {
- input.createInput(this);
- }
-
+
addParameter(attack);
addParameter(release);
addParameter(level);
return base[index % base.length];
}
- public void noteOnReceived(Note note) {
+ public boolean noteOnReceived(Note note) {
LinearEnvelope env = getEnvelope(note.getPitch());
env.setEndVal(min(1, env.getValuef() + (note.getVelocity() / 127.)), getAttackTime()).start();
+ return true;
}
- public void noteOffReceived(Note note) {
+ public boolean noteOffReceived(Note note) {
getEnvelope(note.getPitch()).setEndVal(0, getReleaseTime()).start();
+ return true;
}
- public void run(int deltaMs) {
+ public void run(double deltaMs) {
int i = 0;
float huef = lx.getBaseHuef();
float levelf = level.getValuef();
zv = z.getValuef();
}
- public void run(int deltaMs) {
+ public void run(double deltaMs) {
updateXYZVals();
float xlv = 100*xl.getValuef();
s.modulateDurationBy(r);
}
- public void run(int deltaMs) {
+ public void run(double deltaMs) {
float hv = lx.getBaseHuef();
int si = 0;
for (Strip strip : model.strips) {
addModulator(c).trigger();
}
- void run(int deltaMs) {
+ void run(double deltaMs) {
float huev = h.getValuef();
float cv = c.getValuef();
float sv = s.getValuef();
addModulator(c = new SinLFO(-50, 50, 4000 + 1000*i * ((i % 2 == 0) ? 1 : -1))).trigger();
}
- void run(int deltaMs) {
+ void run(double deltaMs) {
av = a.getValuef();
bv = b.getValuef();
cv = c.getValuef();
}
}
- public void run(int deltaMs) {
+ public void run(double deltaMs) {
float huev = lx.getBaseHuef();
// This is super fucking bizarre. But if this is a for loop, the framerate
addModulator(d).trigger();
}
- public void run(int deltaMs) {
+ public void run(double deltaMs) {
float hv = lx.getBaseHuef();
float av = a.getValuef();
float bv = b.getValuef();
int counter = 0;
- public void run(int deltaMs) {
+ public void run(double deltaMs) {
eq.run(deltaMs);
int stepThresh = (int) (40 - 39*speed.getValuef());
}
}
}
+
+class BlurEffect extends SCEffect {
+
+ final LXParameter amount = new BasicParameter("AMT", 0);
+ final int[] frame;
+ final LinearEnvelope env = new LinearEnvelope(0, 1, 100);
+
+ BlurEffect(GLucose glucose) {
+ super(glucose);
+ addParameter(amount);
+ addModulator(env);
+ frame = new int[lx.total];
+ for (int i = 0; i < frame.length; ++i) {
+ frame[i] = #000000;
+ }
+ }
+
+ public void onEnable() {
+ env.setRangeFromHereTo(1, 400).start();
+ for (int i = 0; i < frame.length; ++i) {
+ frame[i] = #000000;
+ }
+ }
+
+ public void onDisable() {
+ env.setRangeFromHereTo(0, 1000).start();
+ }
+
+ public void doApply(int[] colors) {
+ float amt = env.getValuef() * amount.getValuef();
+ if (amt > 0) {
+ amt = (1 - amt);
+ amt = 1 - (amt*amt*amt);
+ for (int i = 0; i < colors.length; ++i) {
+ // frame[i] = colors[i] = blendColor(colors[i], lerpColor(#000000, frame[i], amt, RGB), SCREEN);
+ frame[i] = colors[i] = lerpColor(colors[i], blendColor(colors[i], frame[i], SCREEN), amt, RGB);
+ }
+ }
+
+ }
+}