summaryrefslogtreecommitdiff
path: root/06_performance/src/testApp.h
diff options
context:
space:
mode:
Diffstat (limited to '06_performance/src/testApp.h')
-rw-r--r--06_performance/src/testApp.h163
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
+