Mercurial > hg > beatroot-vamp
comparison BeatRootProcessor.h @ 24:3a5840de4d5f mirex2013
Fix failure to initialise processor!
author | Chris Cannam |
---|---|
date | Tue, 03 Sep 2013 17:55:50 +0100 |
parents | 633ec097fa56 |
children | b9c2f444cdaa |
comparison
equal
deleted
inserted
replaced
23:633ec097fa56 | 24:3a5840de4d5f |
---|---|
100 fftTime(0.04644), | 100 fftTime(0.04644), |
101 agentParameters(parameters) | 101 agentParameters(parameters) |
102 { | 102 { |
103 hopSize = lrint(sampleRate * hopTime); | 103 hopSize = lrint(sampleRate * hopTime); |
104 fftSize = lrint(pow(2, lrint( log(fftTime * sampleRate) / log(2)))); | 104 fftSize = lrint(pow(2, lrint( log(fftTime * sampleRate) / log(2)))); |
105 init(); | |
105 } // constructor | 106 } // constructor |
106 | 107 |
107 void reset() { | 108 void reset() { |
108 init(); | 109 init(); |
109 } | 110 } |
118 /** Tracks beats once all frames have been processed by processFrame | 119 /** Tracks beats once all frames have been processed by processFrame |
119 */ | 120 */ |
120 EventList beatTrack(); | 121 EventList beatTrack(); |
121 | 122 |
122 protected: | 123 protected: |
123 /** Allocates memory for arrays, based on parameter settings */ | 124 /** Allocates or re-allocates memory for arrays, based on parameter settings */ |
124 void init() { | 125 void init() { |
125 #ifdef DEBUG_BEATROOT | 126 #ifdef DEBUG_BEATROOT |
126 std::cerr << "BeatRootProcessor::init()" << std::endl; | 127 std::cerr << "BeatRootProcessor::init()" << std::endl; |
127 #endif | 128 #endif |
128 makeFreqMap(fftSize, sampleRate); | 129 makeFreqMap(fftSize, sampleRate); |