X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=_Internals.pde;h=d616264b7bbb73f62f0677a8875b09f8356ef0e2;hb=19d16a168003953f5abcb90d73849673d3d06f16;hp=f6344975954b493b0946414d19893146e0c74b87;hpb=343875e3e4b5ec847f10f72622f4f08bc93f3ee2;p=SugarCubes.git diff --git a/_Internals.pde b/_Internals.pde index f634497..d616264 100644 --- a/_Internals.pde +++ b/_Internals.pde @@ -52,6 +52,7 @@ LXPattern[] patterns; MappingTool mappingTool; PandaDriver[] pandaBoards; MidiEngine midiEngine; +color[] threadColors; // Display configuration mode boolean mappingMode = false; @@ -120,6 +121,7 @@ void setup() { glucose = new GLucose(this, buildModel()); lx = glucose.lx; lx.enableKeyboardTempo(); + threadColors = new color[lx.total]; logTime("Built GLucose engine"); // Set the patterns @@ -196,16 +198,19 @@ void setup() { void draw() { // Draws the simulation and the 2D UI overlay background(40); - color[] colors = glucose.getColors(); + color[] simulationColors; + color[] sendColors; + simulationColors = sendColors = glucose.getColors(); String displayMode = uiCrossfader.getDisplayMode(); if (displayMode == "A") { - colors = lx.engine.getDeck(0).getColors(); + simulationColors = lx.engine.getDeck(0).getColors(); } else if (displayMode == "B") { - colors = lx.engine.getDeck(1).getColors(); + simulationColors = lx.engine.getDeck(1).getColors(); } if (debugMode) { - debugUI.maskColors(colors); + debugUI.maskColors(simulationColors); + debugUI.maskColors(sendColors); } camera( @@ -251,7 +256,7 @@ void draw() { strokeWeight(2); beginShape(POINTS); for (Point p : glucose.model.points) { - stroke(colors[p.index]); + stroke(simulationColors[p.index]); vertex(p.x, p.y, p.z); } endShape(); @@ -259,12 +264,6 @@ void draw() { // 2D Overlay UI drawUI(); - // Send output colors - color[] sendColors = glucose.getColors(); - if (debugMode) { - debugUI.maskColors(sendColors); - } - // Gamma correction here. Apply a cubic to the brightness // for better representation of dynamic range for (int i = 0; i < sendColors.length; ++i) { @@ -458,6 +457,11 @@ void keyPressed() { } } break; + case 't': + if (!midiEngine.isQwertyEnabled()) { + lx.engine.setThreaded(!lx.engine.isThreaded()); + } + break; case 'p': for (PandaDriver p : pandaBoards) { p.toggle();