whitespace, OCD
[SugarCubes.git] / _Internals.pde
index fc06832ba72a9692447bc3111d4ad272419dde8f..a358f1b3202a94fd15c104314d51500a0ddcce80 100644 (file)
@@ -122,8 +122,6 @@ void setup() {
   
   println("Total setup: " + (millis() - startMillis) + "ms");
   println("Hit the 'p' key to toggle Panda Board output");
-  
-  println(glucose.model.bassBox.points.size());
 }
 
 void controllerChangeReceived(rwmidi.Controller cc) {
@@ -206,6 +204,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);