Mercurial > hg > btrack
comparison src/BTrack.cpp @ 90:b6fc77f471bb
Tidy
author | Adam Stark <adamstark.uk@gmail.com> |
---|---|
date | Tue, 10 May 2016 23:54:33 +0100 |
parents | 5ef334c782f3 |
children | a88d887bd281 |
comparison
equal
deleted
inserted
replaced
89:5ef334c782f3 | 90:b6fc77f471bb |
---|---|
227 newSample = newSample + 0.0001; | 227 newSample = newSample + 0.0001; |
228 | 228 |
229 m0--; | 229 m0--; |
230 beatCounter--; | 230 beatCounter--; |
231 beatDueInFrame = false; | 231 beatDueInFrame = false; |
232 | 232 |
233 // // move all samples back one step | |
234 // for (int i=0;i < (onsetDFBufferSize-1);i++) | |
235 // { | |
236 // onsetDF[i] = onsetDF[i+1]; | |
237 // } | |
238 | |
239 // add new sample at the end | 233 // add new sample at the end |
240 //onsetDF[onsetDFBufferSize-1] = newSample; | |
241 onsetDF.addSampleToEnd(newSample); | 234 onsetDF.addSampleToEnd(newSample); |
242 | 235 |
243 // update cumulative score | 236 // update cumulative score |
244 updateCumulativeScore(newSample); | 237 updateCumulativeScore(newSample); |
245 | 238 |
683 max = wcumscore; | 676 max = wcumscore; |
684 } | 677 } |
685 n++; | 678 n++; |
686 } | 679 } |
687 | 680 |
688 | 681 |
689 // // shift cumulative score back one | |
690 // for (int i = 0;i < (onsetDFBufferSize-1);i++) | |
691 // { | |
692 // cumulativeScore[i] = cumulativeScore[i+1]; | |
693 // } | |
694 | |
695 latestCumulativeScoreValue = ((1-alpha)*odfSample) + (alpha*max); | 682 latestCumulativeScoreValue = ((1-alpha)*odfSample) + (alpha*max); |
696 | 683 |
697 cumulativeScore.addSampleToEnd(latestCumulativeScoreValue); | 684 cumulativeScore.addSampleToEnd(latestCumulativeScoreValue); |
698 | |
699 // add new value to cumulative score | |
700 //cumulativeScore[onsetDFBufferSize-1] = ((1-alpha)*odfSample) + (alpha*max); | |
701 | |
702 //latestCumulativeScoreValue = cumulativeScore[onsetDFBufferSize-1]; | |
703 | |
704 } | 685 } |
705 | 686 |
706 //======================================================================= | 687 //======================================================================= |
707 void BTrack::predictBeat() | 688 void BTrack::predictBeat() |
708 { | 689 { |