2 * If you are an artist, you may ignore this file! It just sets
3 * up the framework to run the patterns. Should not need modification
4 * for general animation work.
8 import glucose.control.*;
9 import glucose.effect.*;
10 import glucose.model.*;
11 import glucose.pattern.*;
12 import glucose.transform.*;
13 import glucose.transition.*;
14 import heronarts.lx.*;
15 import heronarts.lx.control.*;
16 import heronarts.lx.effect.*;
17 import heronarts.lx.modulator.*;
18 import heronarts.lx.pattern.*;
19 import heronarts.lx.transition.*;
21 import ddf.minim.analysis.*;
22 import processing.opengl.*;
23 import java.lang.reflect.*;
26 final int VIEWPORT_WIDTH = 900;
27 final int VIEWPORT_HEIGHT = 700;
28 final int TARGET_FRAMERATE = 45;
30 int startMillis, lastMillis;
34 LXTransition[] transitions;
39 startMillis = lastMillis = millis();
41 // Initialize the Processing graphics environment
42 size(VIEWPORT_WIDTH, VIEWPORT_HEIGHT, OPENGL);
43 frameRate(TARGET_FRAMERATE);
45 // hint(ENABLE_OPENGL_4X_SMOOTH); // no discernable improvement?
46 logTime("Created viewport");
48 // Create the GLucose engine to run the cubes
49 glucose = new GLucose(this);
51 logTime("Built GLucose engine");
54 glucose.lx.setPatterns(patterns = patterns(glucose));
55 logTime("Built patterns");
56 glucose.lx.addEffects(effects = effects(glucose));
57 logTime("Built effects");
58 transitions = transitions(glucose);
59 logTime("Built transitions");
63 logTime("Built overlay UI");
66 SCMidiDevices.initializeStandardDevices(glucose, ui.patternKnobs, ui.transitionKnobs, ui.effectKnobs);
67 logTime("Setup MIDI devices");
69 println("Total setup: " + (millis() - startMillis) + "ms");
72 void logTime(String evt) {
74 println(evt + ": " + (now - lastMillis) + "ms");
79 // The glucose engine deals with the core simulation here, we don't need
80 // to do anything specific. This method just needs to exist.
93 boolean knobsOn = true;