}
}*/
-List<LXParameter> gparams;
-
- class DualBlender extends SCEffect {
- int lastSeen;
- BasicParameter p1 = new BasicParameter("p1", 0);
- BasicParameter p2 = new BasicParameter("p2", 0);
- BasicParameter p3 = new BasicParameter("p3", 0);
- BasicParameter p4 = new BasicParameter("p4", 0);
- BasicParameter p5 = new BasicParameter("p5", 0);
- BasicParameter p6 = new BasicParameter("p6", 0);
- BasicParameter p7 = new BasicParameter("p7", 0);
- BasicParameter p8 = new BasicParameter("p8", 0);
- DualBlender(GLucose glucose){
- super(glucose);
- gparams = gplay.getParameters();
- addParameter(p1);
- addParameter(p2);
- addParameter(p3);
- addParameter(p4);
- addParameter(p5);
- addParameter(p6);
- addParameter(p7);
- addParameter(p8);
-
- lastSeen=millis();
- }
-
- void onParameterChanged(LXParameter p){
- if(p==p1) { gparams.get(0).setValue(p.getValuef()); }
- if(p==p2) { gparams.get(1).setValue(p.getValuef()); }
- if(p==p3) { gparams.get(2).setValue(p.getValuef()); }
- if(p==p4) { gparams.get(3).setValue(p.getValuef()); }
- if(p==p5) { gparams.get(4).setValue(p.getValuef()); }
- if(p==p6) { gparams.get(5).setValue(p.getValuef()); }
- if(p==p7) { gparams.get(6).setValue(p.getValuef()); }
- if(p==p8) { gparams.get(7).setValue(p.getValuef()); }
- }
-
- void doApply(int[] colors){
- if (enabled) {
- //gplay.onActive();
- gplay.go(millis()-lastSeen);
- lastSeen=millis();
- int[] pcolors = gplay.getColors();
- for(int i=0; i<colors.length; i++){
- colors[i]=blendColor(colors[i],pcolors[i], MULTIPLY);
- }
- } else {}//gplay.onInactive(); }
- }
-
-
-}
-
}
}
-class MaskTransition extends SCTransition {
+abstract class BlendTransition extends SCTransition {
- MaskTransition(GLucose glucose) {
+ final int blendType;
+
+ BlendTransition(GLucose glucose, int blendType) {
super(glucose);
+ this.blendType = blendType;
}
void computeBlend(int[] c1, int[] c2, double progress) {
for (int i = 0; i < c1.length; ++i) {
colors[i] = lerpColor(
c1[i],
- blendColor(c1[i], c2[i], MULTIPLY),
+ blendColor(c1[i], c2[i], blendType),
(float) (2.*progress),
RGB);
}
for (int i = 0; i < c1.length; ++i) {
colors[i] = lerpColor(
c2[i],
- blendColor(c1[i], c2[i], MULTIPLY),
+ blendColor(c1[i], c2[i], blendType),
(float) (2.*(1. - progress)),
RGB);
}
}
}
+class MultiplyTransition extends BlendTransition {
+ MultiplyTransition(GLucose glucose) {
+ super(glucose, MULTIPLY);
+ }
+}
+
+class ScreenTransition extends BlendTransition {
+ ScreenTransition(GLucose glucose) {
+ super(glucose, SCREEN);
+ }
+}
+
+class BurnTransition extends BlendTransition {
+ BurnTransition(GLucose glucose) {
+ super(glucose, BURN);
+ }
+}
+
+class DodgeTransition extends BlendTransition {
+ DodgeTransition(GLucose glucose) {
+ super(glucose, DODGE);
+ }
+}
+
+class OverlayTransition extends BlendTransition {
+ OverlayTransition(GLucose glucose) {
+ super(glucose, OVERLAY);
+ }
+}
+
+class AddTransition extends BlendTransition {
+ AddTransition(GLucose glucose) {
+ super(glucose, ADD);
+ }
+}
+
+class SubtractTransition extends BlendTransition {
+ SubtractTransition(GLucose glucose) {
+ super(glucose, SUBTRACT);
+ }
+}
+
+class SoftLightTransition extends BlendTransition {
+ SoftLightTransition(GLucose glucose) {
+ super(glucose, SOFT_LIGHT);
+ }
+}
class BassPod extends SCPattern {
* your name. Implement your classes there, and add them to the list below.
*/
-// TODO(mcslee): get rid of this global, make engine support two decks
-LXPattern gplay;
-
LXPattern[] patterns(GLucose glucose) {
return new LXPattern[] {
// DanH
new Noise(glucose),
- gplay = new Play(glucose), // XXX do this properly
+ new Play(glucose),
new Pong(glucose),
// Alex G
LXTransition[] transitions(GLucose glucose) {
return new LXTransition[] {
new DissolveTransition(lx),
- new MaskTransition(glucose),
+ new MultiplyTransition(glucose),
+ new ScreenTransition(glucose),
+ new BurnTransition(glucose),
+ new DodgeTransition(glucose),
+ new OverlayTransition(glucose),
+ new AddTransition(glucose),
+ new SubtractTransition(glucose),
+ new SoftLightTransition(glucose),
new SwipeTransition(glucose),
new FadeTransition(lx),
};
return new LXEffect[] {
new FlashEffect(lx),
new BoomEffect(glucose),
- new DualBlender(glucose),
- // new DesaturationEffect(lx),
+ new DesaturationEffect(lx),
new ColorFuckerEffect(glucose),
};
}
debugUI = new DebugUI(pandaMappings);
overlays = new UIContext[] {
uiPatternA = new UIPatternDeck(lx.engine.getDeck(0), "PATTERN A", 4, 4, 140, 344),
- new UICrossfader(4, 352, 140, 152),
- new UIOutput(4, 508, 140, 122),
+ new UICrossfader(4, 352, 140, 212),
new UIPatternDeck(lx.engine.getDeck(1), "PATTERN B", width-144, 4, 140, 344),
new UIEffects(width-144, 352, 140, 144),
new UITempo(width-144, 498, 140, 50),
+ new UIOutput(width-144, 552, 140, 122),
uiDebugText = new UIDebugText(4, height-64, width-8, 44),
uiMapping = new UIMapping(mappingTool, 4, 4, 140, 344),
for (LXTransition t : transitions) {
items.add(new TransitionScrollItem(t));
}
- new UIScrollList(1, titleHeight, w-2, 60).setItems(items).addToContainer(this);
- new UIParameterSlider(4, titleHeight + 66, w-10, 24).setParameter(lx.engine.getDeck(1).getCrossfader()).addToContainer(this);
- new UIToggleSet(4, 122, w-10, 20) {
+ new UIScrollList(1, titleHeight, w-2, 120).setItems(items).addToContainer(this);
+ new UIParameterSlider(4, titleHeight + 126, w-10, 24).setParameter(lx.engine.getDeck(1).getCrossfader()).addToContainer(this);
+ new UIToggleSet(4, 182, w-10, 20) {
protected void onToggle(String value) {
displayMode = value;
}