-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(doDual==true){
- //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(); }
- }
-
-
-}
-