From a2fe68dfed91e362404ea1171cc8f0b313956cc3 Mon Sep 17 00:00:00 2001 From: Comment Date: Wed, 26 Feb 2014 17:01:43 +0000 Subject: thank fuk --- basedProject/src/ofApp.cpp | 47 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 7 deletions(-) (limited to 'basedProject/src/ofApp.cpp') diff --git a/basedProject/src/ofApp.cpp b/basedProject/src/ofApp.cpp index 0dc6b46..1b2a074 100644 --- a/basedProject/src/ofApp.cpp +++ b/basedProject/src/ofApp.cpp @@ -13,27 +13,49 @@ void ofApp::setup() { ///ofSetVerticalSync(true); //some model / light stuff + /* glEnable (GL_DEPTH_TEST); glShadeModel (GL_SMOOTH); glColorMaterial (GL_FRONT_AND_BACK, GL_DIFFUSE); glEnable (GL_COLOR_MATERIAL); ofDisableLighting(); - ofSetGlobalAmbientColor(ofColor(255,255,255)); + //ofSetGlobalAmbientColor(ofColor(255,255,255)); + */ fullscreen=false; activeView=0; xhair.loadImage("crosshairs.png"); + + int bufferSize= 512; //should be based on the size of glitch buffer + + soundStream.listDevices(); + //nb all you have to do to make audio work is to turn off pulseaudio in configuration + soundStream.setup(this, 0, 1, 44100, bufferSize, 1); + samples.resize(bufferSize); + + glitch.setup(512,384,&samples); + glitch.set_interp(ofRandom(30)+2,ofRandom(22)+2); } //-------------------------------------------------------------- void ofApp::update() { ofSetWindowTitle(ofToString(ofGetFrameRate())); + + glitch.update(); +} + +void ofApp::audioIn(float * input, int bufferSize, int nChannels){ + for (int i=0;i