Mercurial > hg > precise-onset-detection
diff src/PreciseOnsetLocator.cpp @ 8:184a7c232049 tip
changed files since updating computer
author | Venetian |
---|---|
date | Thu, 14 Aug 2014 17:53:57 +0100 |
parents | eb29c6b6dff8 |
children |
line wrap: on
line diff
--- a/src/PreciseOnsetLocator.cpp Thu Aug 14 16:27:52 2014 +0100 +++ b/src/PreciseOnsetLocator.cpp Thu Aug 14 17:53:57 2014 +0100 @@ -38,13 +38,25 @@ } +int PreciseOnsetLocator::findExactOnset(float* frame){ + //store the samples - mainly for viewing actually + onsetSamples.clear(); + for (int i = 0; i < bufferSize;i++){ + onsetSamples.push_back(frame[i]); + } + return findExactOnset(); +} + int PreciseOnsetLocator::findExactOnset(double* frame){ //store the samples - mainly for viewing actually onsetSamples.clear(); for (int i = 0; i < bufferSize;i++){ onsetSamples.push_back(frame[i]); } - + return findExactOnset(); +} + +int PreciseOnsetLocator::findExactOnset(){ double energySum = 0; double lastEnergySum, hopsizeLastEnergySum; double energyDifference;