diff options
| author | Tim <tim@Admins-Mac-Pro-2.local> | 2013-06-19 20:03:17 +0100 |
|---|---|---|
| committer | Tim <tim@Admins-Mac-Pro-2.local> | 2013-06-19 20:03:17 +0100 |
| commit | cdd0e0b630bd3a5a8ba15dbce7f5e03221b72f92 (patch) | |
| tree | 4ada26f9bf3d4e0bdb97889472e95729433518a6 /06_performance/src/testApp.h | |
| parent | 4fdd082d9a5657b0f9c613d47c2c58cea366a2e6 (diff) | |
working on performance version
Diffstat (limited to '06_performance/src/testApp.h')
| -rw-r--r-- | 06_performance/src/testApp.h | 163 |
1 files changed, 163 insertions, 0 deletions
diff --git a/06_performance/src/testApp.h b/06_performance/src/testApp.h new file mode 100644 index 0000000..cca9e20 --- /dev/null +++ b/06_performance/src/testApp.h @@ -0,0 +1,163 @@ +#ifndef _TEST_APP +#define _TEST_APP + +#include "ofMain.h" +#include "fft.h" +#include "FFTOctaveAnalyzer.h" + +#define BUFFER_SIZE 1024 +#define BUFFER_FRAMES 512 + +/* +ok seriously lets make this good + +recording - storage for a bunch of fft + +average them on the fly? seems likely + +*/ + +#define OF_ADDON_USING_OFXMIDIIN + +#include "ofxMidi.h" + +#define FFT_AVG 1 +#define FFT_RAW 2 +#define WAVEFORM 3 + +#define PICTURE 1 +#define GRABBER 2 + + +class testApp : public ofBaseApp, public ofxMidiListener{ + + public: + + void setup(); + void update(); + void draw(); + + void keyPressed (int key); + void mouseMoved(int x, int y ); + void mouseDragged(int x, int y, int button); + void mousePressed(int x, int y, int button); + void mouseReleased(); + + void audioIn(float * input, int bufferSize, int nChannels); + + FFTOctaveAnalyzer lFFTanalyzer; + FFTOctaveAnalyzer rFFTanalyzer; + + ofxMidiIn midiIn; + ofxMidiOut midiOut; + void newMidiMessage(ofxMidiEventArgs& eventArgs); + + void setMidiState(); + + + private: + + float * left; + float * right; + int bufferCounter; + fft myfft; + + float FFTbuffer[2][BUFFER_SIZE][BUFFER_FRAMES]; + + int thisFFTbuffer; + + float lmagnitude[BUFFER_SIZE]; + float lphase[BUFFER_SIZE]; + float lpower[BUFFER_SIZE]; + float lfreq[BUFFER_SIZE/2]; + + float rmagnitude[BUFFER_SIZE]; + float rphase[BUFFER_SIZE]; + float rpower[BUFFER_SIZE]; + float rfreq[BUFFER_SIZE/2]; + + ofSoundStream soundStream; + + ofImage fbImage; + + //ofImage blendImage; + + ofVideoPlayer blendImage; + + ofFbo renderImage; + ofShader maskShader; + + bool showFPS; + bool fullScreen; + + ofImage testImage; + + //controllable variables + float F_scale; + float F_drawFrames; + float F_drawStep; + + float F_drawDecay; + float F_lineWidth; + float F_drawAxis; + + float F_xRotation; + float F_yRotation; + float F_zRotation; + + float F_xRotate; + float F_yRotate; + float F_zRotate; + + float lastFrameTime; + + bool draworder; + bool B_vSync; + bool B_fill; + + int visMode; + int inputMode; + + int I_fade1; + int I_fade2; + + int I_movieSource; + int I_moviePlaying; + + bool B_glitch; + + + + unsigned char *gammamap; + unsigned char *line1; + unsigned char *line2; + unsigned char *outBuffer; + + float F_particleAmount; + float F_particleLife; + float F_particleX; + float F_particleY; + float F_particleZ; + + + + float whitePt; + float blackPt; + float gamma; + + bool field2; //flag that there is a 2nd field waiting to be processed + bool use2fields; + int frameTime,grabTime; //keep track of field timing + + + bool deInterlace; + ofTexture outTexture; + + float F_movieSpeed; + + + ofImage blanker; +}; + +#endif + |
