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.pattern.*;
11 import glucose.transition.*;
12 import glucose.model.*;
13 import heronarts.lx.*;
14 import heronarts.lx.control.*;
15 import heronarts.lx.effect.*;
16 import heronarts.lx.pattern.*;
17 import heronarts.lx.modulator.*;
18 import heronarts.lx.transition.*;
20 import ddf.minim.analysis.*;
21 import processing.opengl.*;
22 import java.lang.reflect.*;
25 final int VIEWPORT_WIDTH = 900;
26 final int VIEWPORT_HEIGHT = 700;
27 final int TARGET_FRAMERATE = 45;
29 int startMillis, lastMillis;
33 LXTransition[] transitions;
38 startMillis = lastMillis = millis();
40 // Initialize the Processing graphics environment
41 size(VIEWPORT_WIDTH, VIEWPORT_HEIGHT, OPENGL);
42 frameRate(TARGET_FRAMERATE);
44 // hint(ENABLE_OPENGL_4X_SMOOTH); // no discernable improvement?
45 logTime("Created viewport");
47 // Create the GLucose engine to run the cubes
48 glucose = new GLucose(this);
50 logTime("Built GLucose engine");
53 glucose.lx.setPatterns(patterns = patterns(glucose));
54 logTime("Built patterns");
55 glucose.lx.addEffects(effects = effects(glucose));
56 logTime("Built effects");
57 transitions = transitions(glucose);
58 logTime("Built transitions");
62 logTime("Built overlay UI");
65 SCMidiDevices.initializeStandardDevices(glucose, ui.patternKnobs, ui.transitionKnobs, ui.effectKnobs);
66 logTime("Setup MIDI devices");
68 println("Total setup: " + (millis() - startMillis) + "ms");
71 void logTime(String evt) {
73 println(evt + ": " + (now - lastMillis) + "ms");
78 // The glucose engine deals with the core simulation here, we don't need
79 // to do anything specific. This method just needs to exist.
92 boolean knobsOn = true;