spheres[1].radius = 50;
}
- public void run(int deltaMs) {
+ public void run(double deltaMs) {
// Access the core master hue via this method call
float hv = hueParameter.getValuef();
float lfoValue = lfo.getValuef();
}
// returns TRUE when this should die
- boolean age(int ms) {
- p.add(v, ms / 1000.0);
+ boolean age(double ms) {
+ p.add(v, (float) (ms / 1000.0));
return this.p.y < (0 - this.radius);
}
}
raindrops = new LinkedList<Raindrop>();
}
- public void run(int deltaMs) {
+ public void run(double deltaMs) {
leftoverMs += deltaMs;
while (leftoverMs > msPerRaindrop) {
leftoverMs -= msPerRaindrop;
}
// returns TRUE if this should die
- boolean age(int ms) {
+ boolean age(double ms) {
if (!hasPeaked) {
- value = value + (ms / 1000.0f * ((attackParameter.getValuef() + 0.01) * 5));
+ value = value + (float) (ms / 1000.0f * ((attackParameter.getValuef() + 0.01) * 5));
if (value >= 1.0) {
value = 1.0;
hasPeaked = true;
}
return false;
} else {
- value = value - (ms / 1000.0f * ((decayParameter.getValuef() + 0.01) * 10));
+ value = value - (float) (ms / 1000.0f * ((decayParameter.getValuef() + 0.01) * 10));
return value <= 0;
}
}
flashes = new LinkedList<CubeFlash>();
}
- public void run(int deltaMs) {
+ public void run(double deltaMs) {
leftoverMs += deltaMs;
float msPerFlash = 1000 / ((rateParameter.getValuef() + .01) * 100);
while (leftoverMs > msPerFlash) {
float prevRamp = 0;
float[] wobbleSpeeds = { 1.0/8, 1.0/4, 1.0/2, 1.0 };
- public void run(int deltaMs) {
+ public void run(double deltaMs) {
float ramp = (float)lx.tempo.ramp();
if (ramp < prevRamp) {
beat = (beat + 1) % 32;
}
/**
- * Not very flushed out but pretty.
+ * Two spinning wheels, basically XORed together, with a color palette that should
+ * be pretty easy to switch around. Timed to the beat; also introduces "clickiness"
+ * which makes the movement non-linear throughout a given beat, giving it a nice
+ * dance feel. I'm not 100% sure that it's actually going to look like it's _on_
+ * the beat, but that should be easy enough to adjust.
+ *
+ * It's particularly nice to turn down the clickiness and turn up derez during
+ * slow/beatless parts of the music and then revert them at the drop :) But maybe
+ * I shouldn't be listening to so much shitty dubstep while making these...
*/
class TimPinwheels extends SCPattern {
private BasicParameter horizSpreadParameter = new BasicParameter("HSpr", 0.75);
private BasicParameter derezParameter = new BasicParameter("Drez", 0.25);
private BasicParameter clickinessParameter = new BasicParameter("Clic", 0.5);
private BasicParameter hueParameter = new BasicParameter("Hue", 0.667);
- private BasicParameter hueSpreadParameter = new BasicParameter("HSpd", 0.55);
+ private BasicParameter hueSpreadParameter = new BasicParameter("HSpd", 0.667);
float phase = 0;
private final int NUM_BLADES = 12;
private float prevRamp = 0;
- public void run(int deltaMs) {
+ public void run(double deltaMs) {
float ramp = lx.tempo.rampf();
float numBeats = (1 + ramp - prevRamp) % 1;
prevRamp = ramp;
// 1 -> 180
float hueSpread = (hueSpreadParameter.getValuef() - 0.5) * 360;
- float fadeAmount = (deltaMs / 1000.0) * pow(sharpnessParameter.getValuef() * 10, 1);
+ float fadeAmount = (float) (deltaMs / 1000.0) * pow(sharpnessParameter.getValuef() * 10, 1);
for (Pinwheel pw : pinwheels) {
pw.age(numBeats);
if (random(1.0) >= derez) {
float v = values[i];
- colors[p.index] = color((360 + hue + pow(v, 2) * hueSpread) % 360, 40 + pow(1 - v, 0.25) * 50, v * 100);
+ colors[p.index] = color((360 + hue + pow(v, 2) * hueSpread) % 360, 30 + pow(1 - v, 0.25) * 60, v * 100);
}
}
}
return m;
}
- public void run(int deltaMs) {
+ public void run(double deltaMs) {
for (Point p : model.points) {
color c = colors[p.index];
colors[p.index] = color(hue(c), saturation(c), brightness(c) - 3);