Apat and added acos to spherycolor, not included in color yet but working
[SugarCubes.git] / DanKaminsky.pde
index 4021d07b34fde920886f88d95d99c5acbdd9f9fe..8e236a2a611d6b43aa9cc5902a65d4c8c587c2a9 100644 (file)
@@ -3,15 +3,15 @@ class GenericController {
     public void RotateKnob(int type, int num, float val){
       LXParameter p = null;
       if(type==0) {
-        p = glucose.patternKnobs.get(num);
+        p = glucose.getPattern().getParameters().get(num);
         if(p!=null) { p.setValue(val); }
       }
       if(type==1) {
-        p = glucose.transitionKnobs.get(num);
+        p = glucose.getSelectedTransition().getParameters().get(num);
         if(p!=null) { p.setValue(val); }
       }
       if(type==2) {
-        p = glucose.effectKnobs.get(num);
+        p = glucose.getSelectedEffect().getParameters().get(num);
         if(p!=null) { p.setValue(val); }
       }
     }
@@ -38,9 +38,9 @@ OscP5 listener;
 //  }
 //  if(cc.getCC()==1){
 //    for(int i=0; i<16; i++){
-//      if(noteState[i] && i<8)  { LXParameter p = glucose.patternKnobs.get(i); p.setValue(cc.getValue()/127.0); }
-//      else if(noteState[i] && i<12) { LXParameter p = glucose.transitionKnobs.get(i-8); p.setValue(cc.getValue()/127.0); }
-//      else if(noteState[i] && i<16) { LXParameter p = glucose.effectKnobs.get(i-12); p.setValue(cc.getValue()/127.0); }
+//      if(noteState[i] && i<8)  { LXParameter p = glucose.getPattern().getParameters().get(i); p.setValue(cc.getValue()/127.0); }
+//      else if(noteState[i] && i<12) { LXParameter p = glucose.getSelectedTransition().getParameters().get(i-8); p.setValue(cc.getValue()/127.0); }
+//      else if(noteState[i] && i<16) { LXParameter p = glucose.getSelectedEffect().getParameters().get(i-12); p.setValue(cc.getValue()/127.0); }
 //    }
 //  }
 //}
@@ -174,10 +174,10 @@ class OSC_Balls extends OSCPattern {
   }
   
   void run(double deltaMs){
-    for(Point p: model.points){ colors[p.index]=0; }
+    for(LXPoint p: model.points){ colors[p.index]=0; }
     for(int i=1; i<balls.length; i++){
       if(millis() - balls[i].lastSeen < 1000) {
-        for(Point p: model.points){
+        for(LXPoint p: model.points){
           int x = int(balls[i].x * 255.0);
           int y = int(balls[i].y * 127.0);
           if(p.x < x+4 && p.x > x-4 && p.y < y+4 && p.y > y-4) { colors[p.index] = #FF0000; } 
@@ -207,7 +207,7 @@ import processing.serial.*;
      pret.pixels = ss.getScreenShotJNI2(x, y, w, h);
      //for(int i=0; i<px.length; i++){ pret.pixels[i] = px[i]; }
      //println(pret.get(10,10));
-     for(Point p: model.points){
+     for(LXPoint p: model.points){
        colors[p.index] = pret.get((int(p.x)/8)*8, 128-int(p.y));
      }     
   }