# HG changeset patch # User Chris Cannam # Date 1400670929 -3600 # Node ID 26d054291412e197eb22a813d8e9677dc66452c9 # Parent 06d19c847a414a7d29a15fc15f48dcd259764f24 In draft mode, make the CQ transform one octave shorter (bottom octave empty) diff -r 06d19c847a41 -r 26d054291412 src/Silvet.cpp --- a/src/Silvet.cpp Wed May 21 12:10:02 2014 +0100 +++ b/src/Silvet.cpp Wed May 21 12:15:29 2014 +0100 @@ -317,8 +317,16 @@ m_resampler = 0; } + double minFreq = 27.5; + + if (!m_hqMode) { + // We don't actually return any notes from the bottom octave, + // so we can just pad with zeros + minFreq *= 2; + } + CQParameters params(processingSampleRate, - 27.5, + minFreq, processingSampleRate / 3, processingBPO); @@ -364,6 +372,16 @@ } Grid cqout = m_cq->process(data); + + if (!m_hqMode) { + // Our CQ is one octave shorter in draft mode, so pad with + // zeros + vector octave(m_cq->getBinsPerOctave(), 0.0); + for (int i = 0; i < int(cqout.size()); ++i) { + cqout[i].insert(cqout[i].end(), octave.begin(), octave.end()); + } + } + FeatureSet fs = transcribe(cqout); return fs; }