//-------------------------------------------------------------- void testApp::setup(){ player.setFile(ofToDataPath("Willow Beats - TAWK TAKEOUT (Tawk Tomahawk Remixed) - 08 Ocelot (Willow Beats Remix).mp3")); sampler = ofxAudioUnitSampler('aumu', 'dls ', 'appl'); delay = ofxAudioUnit('aufx', 'dely', 'appl'); delay.printParameterList(); // [1] delay time [0.0001 : 2 : 1] // [2] feedback [-99.9 : 99.9 : 50] delay.setParameter(1, kAudioUnitScope_Global, 2); delay.setParameter(2, kAudioUnitScope_Global, 99.9); filter = ofxAudioUnit('aufx', 'filt', 'appl'); player.connectTo(filter); input.connectTo(delay); mixer.setInputBusCount(3); sampler.connectTo(mixer, 0); filter.connectTo(mixer, 1); delay.connectTo(mixer, 2); mixer.connectTo(output); input.start(); output.start(); player.loop(); }
//------------- void ofApp::setupAutioUnit(OSType type, OSType subType, OSType manufacturer){ dac.stop(); audio.reset(); audio = ofxAudioUnitSampler(type, subType, manufacturer); audio.connectTo(mixer, 0); mixer.connectTo(dac); dac.start(); output.setupAudioUnit(&audio); aumc.setupAudioUnit(&audio); }
void AudioUnitController::setup(string name, OSType type, OSType subType, OSType manufacturer) { this->name = name; this->type = type; this->subType = subType; this->manufacturer = manufacturer; color = ofColor(ofRandom(255), ofRandom(255), ofRandom(255)); synth = ofxAudioUnitSampler(type, subType, manufacturer); loadParameterGroups(); AUEventListenerCreate(&AudioUnitController::audioUnitParameterChanged, this, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode, 0.005, // minimum callback interval (seconds) 0.005, // callback granularity (for rate-limiting) &auEventListener); }
//-------------------------------------------------------------- void testApp::setup(){ setupComplete = false; //graphics ofSetFrameRate(60); ofSetVerticalSync(true); ofEnableAlphaBlending(); bUseFbo = false; bFlip = true; //leap setup leap.open(); cam.setOrientation(ofPoint(-20, 0, 0)); l1.setPosition(200, 300, 50); l2.setPosition(-200, -200, 50); glEnable(GL_DEPTH_TEST); glEnable(GL_NORMALIZE); ofSetFullscreen(true); fadesFbo.allocate(ofGetWidth(), ofGetHeight(), GL_RGBA32F_ARB); fadesFbo.begin(); ofClear(255,255,255, 20); fadesFbo.end(); //audio synth = ofxAudioUnitSampler('aumu', 'CaC2', 'CamA'); synth.getParameters(false, false); synth.setBank(0, 0); prog = 0; synth.setProgram(prog); limiter = ofxAudioUnit('aufx', 'mcmp', 'appl'); limiter.setParameter(kMultibandCompressorParam_Threshold1, kAudioUnitScope_Global, -10.0); limiter.setParameter(kMultibandCompressorParam_Headroom1, kAudioUnitScope_Global, 0.1); limiter.setParameter(kMultibandCompressorParam_Threshold2, kAudioUnitScope_Global, -10.0); limiter.setParameter(kMultibandCompressorParam_Headroom2, kAudioUnitScope_Global, 0.1); limiter.setParameter(kMultibandCompressorParam_Threshold3, kAudioUnitScope_Global, -10.0); limiter.setParameter(kMultibandCompressorParam_Headroom3, kAudioUnitScope_Global, 0.1); limiter.setParameter(kMultibandCompressorParam_Threshold4, kAudioUnitScope_Global, -10.0); limiter.setParameter(kMultibandCompressorParam_Headroom4, kAudioUnitScope_Global, 0.1); synth >> tap >> limiter >> output; output.start(); tap.getSamples(samples); bufferSize = samples.size(); buffer = new float[bufferSize]; spectrum = new float[bufferSize/2]; ofSoundStreamSetup(2, 0, 44100, bufferSize, 4); fftCalc.setup(bufferSize, bufferSize/8, 44100); int DorianScaleDegrees[] = {0, 2, 3, 5, 7, 9, 10}; dorian.assign(DorianScaleDegrees, DorianScaleDegrees+7); //postproc post.init(1920, 1080); post.createPass<FxaaPass>()->setEnabled(true); post.createPass<BloomPass>()->setEnabled(true); post.createPass<KaleidoscopePass>()->setEnabled(true); //gui gui = new ofxUICanvas(0,0,320,640); gui->addWidgetDown(new ofxUILabel("LEAP HACK DAY", OFX_UI_FONT_LARGE)); gui->addSpacer(304, 2); gui->addWidgetDown(new ofxUISlider(304,16,0.0,255.0,100.0,"BACKGROUND VALUE")); gui->addWidgetDown(new ofxUIToggle(32, 32, false, "FULLSCREEN")); gui->addSpacer(304, 2); gui->addWidgetDown(new ofxUIButton("LAST PATCH", false, 16, 16)); gui->addWidgetDown(new ofxUIButton("NEXT PATCH", false, 16, 16)); gui->addSlider("PROGRAM", 0, 127, &prog, 95, 16); gui->addSlider("XyPad1x", 0.0,1.0, &XyPad1x, 304, 16); gui->addSlider("XyPad1y", 0.0,1.0, &XyPad1y, 304, 16); gui->addSlider("XyPad2x", 0.0,1.0, &XyPad2x, 304, 16); gui->addSlider("XyPad2y", 0.0,1.0, &XyPad2y, 304, 16); gui->addSpacer(304, 2); gui->addWidgetDown(new ofxUILabel("WAVEFORM DISPLAY", OFX_UI_FONT_MEDIUM)); gui->addWidgetDown(new ofxUIWaveform(304, 64, buffer, bufferSize, -1.0, 1.0, "WAVEFORM")); gui->addWidgetDown(new ofxUILabel("SPECTRUM DISPLAY", OFX_UI_FONT_MEDIUM)); gui->addWidgetDown(new ofxUISpectrum(304, 64, spectrum, bufferSize/2, 0.0, 1.0, "SPECTRUM")); gui->addSpacer(304, 2); gui->addSlider("fade amnt", 1.0, 200.0, &fadeAmnt, 304, 16); gui->addToggle("kaleidascope", bKaleidoscope); ofAddListener(gui->newGUIEvent, this, &testApp::guiEvent); gui->loadSettings("GUI/guiSettings.xml"); setupComplete = true; }