comparison 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
comparison
equal deleted inserted replaced
62:2ec37d4afc37 63:1395895f6cdf
125 { 125 {
126 hopSize = hopSize_; 126 hopSize = hopSize_;
127 onsetDFBufferSize = (512*512)/hopSize; // calculate df buffer size 127 onsetDFBufferSize = (512*512)/hopSize; // calculate df buffer size
128 128
129 beatPeriod = round(60/((((double) hopSize)/44100)*tempo)); 129 beatPeriod = round(60/((((double) hopSize)/44100)*tempo));
130 130
131 onsetDF = new double[onsetDFBufferSize]; // create df_buffer 131 // set size of onset detection function buffer
132 cumulativeScore = new double[onsetDFBufferSize]; // create cumscore 132 onsetDF.resize(onsetDFBufferSize);
133 133
134 // set size of cumulative score buffer
135 cumulativeScore.resize(onsetDFBufferSize);
134 136
135 // initialise df_buffer to zeros 137 // initialise df_buffer to zeros
136 for (int i = 0;i < onsetDFBufferSize;i++) 138 for (int i = 0;i < onsetDFBufferSize;i++)
137 { 139 {
138 onsetDF[i] = 0; 140 onsetDF[i] = 0;