Mercurial > hg > precise-onset-detection
view src/testApp.h @ 0:3dcbd77efc94
added files for OF project
author | Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk> |
---|---|
date | Fri, 21 Sep 2012 16:35:17 +0100 |
parents | |
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