Sketch 2015-07-09
void ofApp::setup(){
ofSetWindowShape(1000, 900);
bpm = 90;
playing = false;
utils.setup();
manager.setup();
manager.toggleDebugUI();
setupAudioUnits();
setupTimeline();
}
void ofApp::setupAudioUnits() {
noiseMaker1.setup('aumu', 'ncut', 'TOGU', AU_TYPE_SYNTH, "TALNoiseMaker");
manager.add(&chain1, "tal-one", ofColor::blue);
chain1.link(&noiseMaker1).toMixer();
manager.loadPresets(&chain1);
}
void ofApp::setupTimeline() {
timeline.setup();
timeline.setLoopType(OF_LOOP_NORMAL);
timeline.setShowBPMGrid(true);
timeline.enableSnapToBPM(true);
timeline.setBPM(bpm);
timeline.setDurationInSeconds(36);
timeline.setOffset(ofVec2f(10, 480));
timeline.setWidth(ofGetWidth() - 400);
timeline.addCurves("filter cutoff");
timeline.addSwitches("midi events");
ofAddListener(timeline.events().switched, this, &ofApp::switchFired);
}
void ofApp::update(){
noiseMaker1.set(TALNoiseMaker_cutoff, timeline.getValue("filter cutoff"));
}
void ofApp::switchFired(ofxTLSwitchEventArgs &args) {
string command = args.switchName + (args.on ? " ON" : " OFF");
cout << endl << ofGetTimestampString() << endl;
cout << "switch fired: " << command << endl;
utils.executeMidiCommand(command, chain1.midi());
}
Weird tubular sound