Strip noteState stuff from _Internals
[SugarCubes.git] / _Internals.pde
index 580e1730433f070baf019a40e421d19997ac34fc..86c0661db5a43decec397ea751cce66a7468c1f9 100644 (file)
@@ -124,6 +124,7 @@ void setup() {
   println("Hit the 'p' key to toggle Panda Board output");
 }
 
+
 void controllerChangeReceived(rwmidi.Controller cc) {
   if (debugMode) {
     println("CC: " + cc.toString());
@@ -175,10 +176,10 @@ void draw() {
   endShape();
   
   noStroke();
-  drawBassBox(glucose.model.bassBox);
-  for (Speaker s : glucose.model.speakers) {
-    drawSpeaker(s);
-  }
+//  drawBassBox(glucose.model.bassBox);
+//  for (Speaker s : glucose.model.speakers) {
+//    drawSpeaker(s);
+//  }
   for (Cube c : glucose.model.cubes) {
     drawCube(c);
   }
@@ -204,6 +205,17 @@ void draw() {
     debugUI.draw();
   }
   
+  // Gamma correction here. Apply a cubic to the brightness
+  // for better representation of dynamic range
+  for (int i = 0; i < colors.length; ++i) {
+    float b = brightness(colors[i]) / 100.f;
+    colors[i] = color(
+      hue(colors[i]),
+      saturation(colors[i]),
+      (b*b*b) * 100.
+    );
+  }
+  
   // TODO(mcslee): move into GLucose engine
   for (PandaDriver p : pandaBoards) {
     p.send(colors);
@@ -282,8 +294,7 @@ void drawSpeaker(Speaker s) {
   noStroke();
   fill(#393939);  
   drawBox(s.x+in, s.y+in, s.z+in, 0, s.ry, 0, Speaker.EDGE_WIDTH-in*2, Speaker.EDGE_HEIGHT-in*2, Speaker.EDGE_DEPTH-in*2, Cube.CHANNEL_WIDTH-in);
-}  
-
+}
 
 void drawBox(float x, float y, float z, float rx, float ry, float rz, float xd, float yd, float zd, float sw) {
   pushMatrix();
@@ -324,16 +335,22 @@ void drawUI() {
     ui.drawHelpTip();
   }
   ui.drawFPS();
+  ui.drawDanText();
 }
 
 boolean uiOn = true;
 int restoreToIndex = -1;
 
+boolean doDual = false;
+
 void keyPressed() {
   if (mappingMode) {
     mappingTool.keyPressed();
   }
   switch (key) {
+    case 'w':
+       doDual = !doDual;
+       break;
     case '-':
     case '_':
       frameRate(--targetFramerate);
@@ -415,4 +432,3 @@ void mouseWheel(int delta) {
     eyeZ = midZ + eyeR*cos(eyeA);
   }
 }
-