view src/testApp.h @ 8:184a7c232049 tip

changed files since updating computer
author Venetian
date Thu, 14 Aug 2014 17:53:57 +0100
parents 3dcbd77efc94
children
line wrap: on
line source
#ifndef _TEST_APP
#define _TEST_APP


#include "ofMain.h"

#include "OnsetDetectionFunction.h"
#include "PeakProcessor.h"
#include "PreciseOnsetLocator.h"

class testApp : public ofBaseApp{
	
	public:
		
		void setup();
		void update();
		void draw();
		
		void keyPressed(int key);
		void keyReleased(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(int x, int y, int button);
		void windowResized(int w, int h);
		void dragEvent(ofDragInfo dragInfo);
		void gotMessage(ofMessage msg);
				
		void audioIn(float * input, int bufferSize, int nChannels); 
	
		vector <float> left;
		vector <float> right;
		vector <float> volHistory;
		
		int 	bufferCounter;
		int 	drawCounter;
		
		float smoothedVol;
		float scaledVol;
		
		ofSoundStream soundStream;
	
		OnsetDetectionFunction odf;
	
	PeakProcessor peakProcess;
	
	PreciseOnsetLocator precisionLocator;
	
	bool holdOn;
	int bufferSize;
	int exactOnsetIndex;
	vector <double> onsetSamples;//holds the audio samples when onset is found
//	vector <double> recentBufferSamples;
	
/*
 //peak processing requires
		static const int vectorSize = 512/6; 
		vector<double> recentDFsamples; 
		vector<bool> recentDFonsetFound;
		vector<double> recentDFslopeValues;
	
	int numberOfDetectionValuesToTest;
	bool peakProcessing(const double& newDFval);
	double getBestSlopeValue(const float& dfvalue);
	bool checkForSlopeOnset(const float& bestValue);
	int currentFrame, lastSlopeOnsetFrame, cutoffForRepeatOnsetsFrames;
	void updateDetectionTriggerThreshold(const float& val);
	float detectionTriggerThreshold, detectionTriggerRatio;
	float bestSlopeMedian, thresholdRelativeToMedian;
	bool newOnsetFound, slopeFallenBelowMedian;
 */
/*	


	
	double getLastEnergySum(const int& startIndex, const int& vectorSize);
	int findExactOnset();

 */
};


#endif