changeset 5:2150607d4726

minor fixes
author Chris Cannam
date Mon, 19 Sep 2011 15:58:12 +0100
parents c06cf6f7cb04
children 02d388f98c23
files BeatRootProcessor.h
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/BeatRootProcessor.h	Mon Sep 19 15:48:26 2011 +0100
+++ b/BeatRootProcessor.h	Mon Sep 19 15:58:12 2011 +0100
@@ -284,8 +284,8 @@
         double hop = hopTime;
         Peaks::normalise(spectralFlux);
         vector<int> peaks = Peaks::findPeaks(spectralFlux, (int)lrint(0.06 / hop), 0.35, 0.84, true);
-        onsets = new double[peaks.size()];
-        double[] y2 = new double[onsets.length];
+        onsets.clear();
+        onsets.resize(peaks.size(), 0);
         vector<int>::iterator it = peaks.begin();
         onsetList = new EventList();
         double minSalience = Peaks.min(spectralFlux);
@@ -293,7 +293,6 @@
             int index = *it;
             ++it;
             onsets[i] = index * hop;
-            y2[i] = spectralFlux[index];
             Event e = BeatTrackDisplay.newBeat(onsets[i], 0);
 //			if (debug)
 //				System.err.printf("Onset: %8.3f  %8.3f  %8.3f\n",