New Grizzly code using LXOutput framework
[SugarCubes.git] / _Internals.pde
index 326f6e3eb2ee03bac3997787794a8fd6584a769c..0100c051c82d0b4bc8b6125829c5bff708e664b3 100644 (file)
@@ -45,6 +45,7 @@ int startMillis, lastMillis;
 // Core engine variables
 GLucose glucose;
 LX lx;
+Model model;
 LXPattern[] patterns;
 Effects effects;
 MappingTool mappingTool;
@@ -128,7 +129,7 @@ void setup() {
   logTime("Created viewport");
 
   // Create the GLucose engine to run the cubes
-  glucose = new GLucose(this, buildModel());
+  glucose = new GLucose(this, model = buildModel());
   lx = glucose.lx;
   lx.enableKeyboardTempo();
   logTime("Built GLucose engine");
@@ -152,6 +153,15 @@ void setup() {
   logTime("Setup MIDI devices");
 
   // Build output driver
+  try {
+    GrizzlyOutput[] grizzlies = buildGrizzlies();
+    for (LXOutput output : grizzlies) {
+      lx.addOutput(output);
+    }
+  } catch (Exception x) {
+    x.printStackTrace();
+  }
+  
   PandaMapping[] pandaMappings = buildPandaList();
   pandaBoards = new PandaDriver[pandaMappings.length];
   int pbi = 0;