# HG changeset patch # User Chris Cannam # Date 1371119043 -3600 # Node ID 413c4582824a983d810acc975a8c698055109dfc # Parent 1ec0e28238919a11a6d54ea088678f3fe0eedf4a Sample rates unrelated to 44.1KHz give non-power-of-two blocksizes: pick next power of two up, in that situation. Also remove some printouts diff -r 1ec0e2823891 -r 413c4582824a segmentino/Segmentino.cpp --- a/segmentino/Segmentino.cpp Thu Jun 13 10:25:24 2013 +0100 +++ b/segmentino/Segmentino.cpp Thu Jun 13 11:24:03 2013 +0100 @@ -466,10 +466,9 @@ // Return the BlockSize for Chroma Extractor size_t Segmentino::getPreferredBlockSize() const { - size_t theoretical = getPreferredStepSize() * 2; + int theoretical = getPreferredStepSize() * 2; theoretical *= m_chromaFramesizeFactor; - - return theoretical; + return MathUtilities::nextPowerOfTwo(theoretical); } @@ -944,7 +943,7 @@ calculate a tuned log-frequency spectrogram (f2): use the tuning estimated above (kinda f0) to perform linear interpolation on the existing log-frequency spectrogram (kinda f1). **/ - cerr << endl << "[NNLS Chroma Plugin] Tuning Log-Frequency Spectrogram ... "; +// cerr << endl << "[NNLS Chroma Plugin] Tuning Log-Frequency Spectrogram ... "; float tempValue = 0; @@ -1005,7 +1004,7 @@ tunedlogfreqspec.push_back(f2); count++; } - cerr << "done." << endl; +// cerr << "done." << endl; /** Semitone spectrum and chromagrams Semitone-spaced log-frequency spectrum derived from the tuned log-freq spectrum above. the spectrum @@ -1013,12 +1012,13 @@ Three different kinds of chromagram are calculated, "treble", "bass", and "both" (which means bass and treble stacked onto each other). **/ +/* if (m_chromadata->useNNLS == 0) { cerr << "[NNLS Chroma Plugin] Mapping to semitone spectrum and chroma ... "; } else { cerr << "[NNLS Chroma Plugin] Performing NNLS and mapping to chroma ... "; } - +*/ vector oldchroma = vector(12,0); vector oldbasschroma = vector(12,0); count = 0; @@ -1106,7 +1106,7 @@ returnFeatureList.push_back(bothchroma); count++; } - cerr << "done." << endl; +// cerr << "done." << endl; return returnFeatureList; }