sinesphere working with notes
[SugarCubes.git] / DanKaminsky.pde
index 59bde733721a99feaacfc1f495b482896a6bdd2c..4021d07b34fde920886f88d95d99c5acbdd9f9fe 100644 (file)
@@ -79,12 +79,12 @@ class ObjectMuckerEffect extends SCEffect {
   ObjectMuckerEffect(GLucose glucose) {
     super(glucose);
   }
-  public void doApply(int[] colors){
+  public void apply(int[] colors){
     /*for(Strip s: model.strips){
       for(int i=0; i<s.points.size(); i++){
          int index = s.points.get(i).index;
          color c = colors[index];
-         colors[index] = color((i*22.5), saturation(c), brightness(c));
+         colors[index] = lx.hsb((i*22.5), saturation(c), brightness(c));
       }
     }*/
   }
@@ -105,7 +105,7 @@ class BlendFrames extends SCEffect {
        frames[i] = new int[model.points.size()];       
     }
   }
-  public void doApply(int[] colors) {
+  public void apply(int[] colors) {
     if(fcount<maxfbuf){
       for(int i=0; i<colors.length; i++){
         frames[(maxfbuf-1)-fcount][i]=colors[i];
@@ -173,7 +173,7 @@ class OSC_Balls extends OSCPattern {
     balls[ballnum].y = msg.get(1).floatValue();    
   }
   
-  void run(int deltaMs){
+  void run(double deltaMs){
     for(Point p: model.points){ colors[p.index]=0; }
     for(int i=1; i<balls.length; i++){
       if(millis() - balls[i].lastSeen < 1000) {
@@ -199,7 +199,7 @@ import processing.serial.*;
     pret = new PImage(8, 128, ARGB);
     ss = new ScreenShot();
   }
-  void run(int deltaMs){
+  void run(double deltaMs){
      int x=(1366/2)+516;
      int y=768-516;
      int w=8;
@@ -213,56 +213,3 @@ import processing.serial.*;
   }
 }*/
 
-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(); }
-  }
-  
-  
-}
-