Mercurial > hg > drum-timing-analyser
annotate DrumTimingLoader_OF/ofxAubioOnsetDetection/PreciseOnsetLocator.h @ 3:303edbbcf1bd tip
updated ofxAubioOnsetDetection file
author | Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk> |
---|---|
date | Sun, 24 Nov 2013 08:15:17 +0000 |
parents | 82352cfc0b23 |
children |
rev | line source |
---|---|
andrew@0 | 1 /* |
andrew@0 | 2 * PreciseOnsetLocator.h |
andrew@0 | 3 * peakOnsetDetector |
andrew@0 | 4 * |
andrew@0 | 5 * Created by Andrew on 21/09/2012. |
andrew@0 | 6 * Copyright 2012 QMUL. All rights reserved. |
andrew@0 | 7 * |
andrew@0 | 8 */ |
andrew@0 | 9 |
andrew@0 | 10 |
andrew@0 | 11 #ifndef PRECISE_ONSET_LOCATOR |
andrew@0 | 12 #define PRECISE_ONSET_LOCATOR |
andrew@0 | 13 |
andrew@0 | 14 #include <vector.h> |
andrew@0 | 15 |
andrew@0 | 16 class PreciseOnsetLocator{ |
andrew@0 | 17 public: |
andrew@0 | 18 |
andrew@0 | 19 PreciseOnsetLocator(); |
andrew@0 | 20 ~PreciseOnsetLocator(); |
andrew@0 | 21 |
andrew@0 | 22 int bufferSize; |
andrew@0 | 23 bool printInfo; |
andrew@0 | 24 |
andrew@0 | 25 vector <double> onsetSamples;//holds the audio samples when onset is found |
andrew@0 | 26 vector <double> recentBufferSamples; |
andrew@0 | 27 |
andrew@0 | 28 double getLastEnergySum(const int& startIndex, const int& vectorSize); |
andrew@0 | 29 int findExactOnset(double* frame, const int& framesize); |
andrew@0 | 30 int findExactOnset(float* frame, const int& framesize); |
andrew@0 | 31 |
andrew@0 | 32 int exactOnsetIndex; |
andrew@0 | 33 |
andrew@0 | 34 void setup(const int& size); |
andrew@0 | 35 |
andrew@0 | 36 void storeSamples(double* newSamples); |
andrew@0 | 37 void storeSamples(float* newSamples); |
andrew@0 | 38 |
andrew@0 | 39 |
andrew@0 | 40 }; |
andrew@0 | 41 #endif |