view 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
line wrap: on
line source
/*
 *  PreciseOnsetLocator.h
 *  peakOnsetDetector
 *
 *  Created by Andrew on 21/09/2012.
 *  Copyright 2012 QMUL. All rights reserved.
 *
 */


#ifndef PRECISE_ONSET_LOCATOR
#define PRECISE_ONSET_LOCATOR

#include <vector.h>

class PreciseOnsetLocator{
	public:
	
	PreciseOnsetLocator();
	~PreciseOnsetLocator();
	
	int bufferSize;
	bool printInfo;
	
	vector <double> onsetSamples;//holds the audio samples when onset is found
	vector <double> recentBufferSamples;
	
	double getLastEnergySum(const int& startIndex, const int& vectorSize);
	int findExactOnset(double* frame, const int& framesize);
	int findExactOnset(float* frame, const int& framesize);

	int exactOnsetIndex;
	
	void setup(const int& size);
	
	void storeSamples(double* newSamples);
	void storeSamples(float* newSamples);

		
};
#endif