Mercurial > hg > btrack
diff src/BTrack.cpp @ 63:1395895f6cdf
Replaced the pointers to arrays in BTrack with vectors
author | Adam Stark <adamstark@users.noreply.github.com> |
---|---|
date | Mon, 27 Jan 2014 23:54:18 +0000 |
parents | bf256abf1dd4 |
children | 105999275c2e |
line wrap: on
line diff
--- a/src/BTrack.cpp Mon Jan 27 23:20:13 2014 +0000 +++ b/src/BTrack.cpp Mon Jan 27 23:54:18 2014 +0000 @@ -127,10 +127,12 @@ onsetDFBufferSize = (512*512)/hopSize; // calculate df buffer size beatPeriod = round(60/((((double) hopSize)/44100)*tempo)); - - onsetDF = new double[onsetDFBufferSize]; // create df_buffer - cumulativeScore = new double[onsetDFBufferSize]; // create cumscore - + + // set size of onset detection function buffer + onsetDF.resize(onsetDFBufferSize); + + // set size of cumulative score buffer + cumulativeScore.resize(onsetDFBufferSize); // initialise df_buffer to zeros for (int i = 0;i < onsetDFBufferSize;i++)