andrew@0: /* andrew@0: * PreciseOnsetLocator.h andrew@0: * peakOnsetDetector andrew@0: * andrew@2: * Created by Andrew Robertson on 21/09/2012. andrew@0: * Copyright 2012 QMUL. All rights reserved. andrew@0: * andrew@0: */ andrew@0: andrew@0: andrew@0: #ifndef PRECISE_ONSET_LOCATOR andrew@0: #define PRECISE_ONSET_LOCATOR andrew@0: andrew@0: #include andrew@0: andrew@0: class PreciseOnsetLocator{ andrew@0: public: andrew@0: andrew@0: PreciseOnsetLocator(); andrew@0: ~PreciseOnsetLocator(); andrew@0: andrew@0: int bufferSize; andrew@0: andrew@0: vector onsetSamples;//holds the audio samples when onset is found andrew@0: vector recentBufferSamples; andrew@0: andrew@0: double getLastEnergySum(const int& startIndex, const int& vectorSize); Venetian@8: Venetian@8: int findExactOnset(); Venetian@8: int findExactOnset(float* frame); andrew@0: int findExactOnset(double* frame); andrew@0: andrew@0: int exactOnsetIndex; andrew@0: andrew@0: void setup(const int& size); andrew@0: void storeSamples(double* newSamples); andrew@0: andrew@0: }; andrew@0: #endif