# HG changeset patch # User Chris Cannam # Date 1158766295 0 # Node ID 74ce5b481132a69312fdb95a02620d6761ed7b95 # Parent 61c56057ce4aa9feb3975d95e2bf41b6d2452c17 * Fix some step- and block-size related bugs diff -r 61c56057ce4a -r 74ce5b481132 plugins/BeatDetect.cpp --- a/plugins/BeatDetect.cpp Fri May 19 14:22:18 2006 +0000 +++ b/plugins/BeatDetect.cpp Wed Sep 20 15:31:35 2006 +0000 @@ -148,13 +148,13 @@ if (blockSize != getPreferredStepSize() * 2) { std::cerr << "BeatDetector::initialise: Unsupported block size for this sample rate: " - << blockSize << std::endl; + << blockSize << " (wanted " << (getPreferredStepSize() * 2) << ")" << std::endl; return false; } if (stepSize != getPreferredStepSize()) { std::cerr << "BeatDetector::initialise: Unsupported step size for this sample rate: " - << stepSize << std::endl; + << stepSize << " (wanted " << (getPreferredStepSize()) << ")" << std::endl; return false; } diff -r 61c56057ce4a -r 74ce5b481132 plugins/ChromagramPlugin.cpp --- a/plugins/ChromagramPlugin.cpp Fri May 19 14:22:18 2006 +0000 +++ b/plugins/ChromagramPlugin.cpp Wed Sep 20 15:31:35 2006 +0000 @@ -197,13 +197,21 @@ if (channels < getMinChannelCount() || channels > getMaxChannelCount()) return false; - if (stepSize != m_step) return false; - if (blockSize != m_block) return false; - std::cerr << "ChromagramPlugin::initialise: step " << stepSize << ", block " << blockSize << std::endl; m_chromagram = new Chromagram(m_config); + + m_step = m_chromagram->getHopSize(); + m_block = m_chromagram->getFrameSize(); + + if (stepSize != m_step || + blockSize != m_block) { + delete m_chromagram; + m_chromagram = 0; + return false; + } + return true; } diff -r 61c56057ce4a -r 74ce5b481132 plugins/ConstantQSpectrogram.cpp --- a/plugins/ConstantQSpectrogram.cpp Fri May 19 14:22:18 2006 +0000 +++ b/plugins/ConstantQSpectrogram.cpp Wed Sep 20 15:31:35 2006 +0000 @@ -197,15 +197,21 @@ if (channels < getMinChannelCount() || channels > getMaxChannelCount()) return false; - if (stepSize != m_step) return false; - if (blockSize != m_block) return false; - std::cerr << "ConstantQSpectrogram::initialise: step " << stepSize << ", block " << blockSize << std::endl; m_cq = new ConstantQ(m_config); m_bins = (int)ceil(m_bpo * log(m_config.max / m_config.min) / log(2.0)); m_cq->sparsekernel(); + m_step = m_cq->gethop(); + m_block = m_cq->getfftlength(); + + if (stepSize != m_step || + blockSize != m_block) { + delete m_cq; + m_cq = 0; + return false; + } return true; }