Sketch 2015-07-02
void ofApp::setup(){
ofSetWindowShape(1000, 800);
manager.setup();
manager.toggleDebugUI();
setupAudioUnits();
setupTimeline();
playing = false;
note = 60;
}
void ofApp::setupAudioUnits() {
manager.add(&chain, "tal-one", ofColor::blue);
chain.link(&noiseMaker).toMixer();
manager.loadPresets(&chain);
}
void ofApp::setupTimeline() {
timeline.setup();
timeline.setLoopType(OF_LOOP_NORMAL);
timeline.setDurationInSeconds(30);
timeline.setOffset(ofVec2f(10, 480));
timeline.setWidth(ofGetWidth() - 400);
timeline.addCurves("LFO 1 rate", ofRange(0, 1));
timeline.addCurves("filter cutoff", ofRange(0, 1));
timeline.addBangs("midi events");
ofAddListener(timeline.events().bangFired, this, &ofApp::bang);
}
void ofApp::update(){
noiseMaker.set(TALNoiseMaker_lfo1rate, timeline.getValue("LFO 1 rate"));
noiseMaker.set(TALNoiseMaker_cutoff, timeline.getValue("filter cutoff"));
}
void ofApp::bang(ofxTLBangEventArgs &args) {
if(args.flag == "") {
chain.midi()->sendNoteOn(1, note);
} else {
chain.midi()->sendNoteOn(1, ofToInt(args.flag));
}
}
We are screwing with the LFO and the filter cutoff.