comparison VampYin.cpp @ 9:5945b8905d1f

README, copyrights
author Chris Cannam
date Fri, 06 Dec 2013 10:49:00 +0000
parents 3cf34d0effed
children 177f76df473a
comparison
equal deleted inserted replaced
8:97918c7d7529 9:5945b8905d1f
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 pYIN - A fundamental frequency estimator for monophonic audio
5 Centre for Digital Music, Queen Mary, University of London.
6
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License as
9 published by the Free Software Foundation; either version 2 of the
10 License, or (at your option) any later version. See the file
11 COPYING included with this distribution for more information.
12 */
2 13
3 #include "VampYin.h" 14 #include "VampYin.h"
4 #include "MonoNote.h" 15 #include "MonoNote.h"
5 16
6 #include "vamp-sdk/FFT.h" 17 #include "vamp-sdk/FFT.h"
276 VampYin::initialise(size_t channels, size_t stepSize, size_t blockSize) 287 VampYin::initialise(size_t channels, size_t stepSize, size_t blockSize)
277 { 288 {
278 if (channels < getMinChannelCount() || 289 if (channels < getMinChannelCount() ||
279 channels > getMaxChannelCount()) return false; 290 channels > getMaxChannelCount()) return false;
280 291
292 /*
281 std::cerr << "VampYin::initialise: channels = " << channels 293 std::cerr << "VampYin::initialise: channels = " << channels
282 << ", stepSize = " << stepSize << ", blockSize = " << blockSize 294 << ", stepSize = " << stepSize << ", blockSize = " << blockSize
283 << std::endl; 295 << std::endl;
284 296 */
285 m_channels = channels; 297 m_channels = channels;
286 m_stepSize = stepSize; 298 m_stepSize = stepSize;
287 m_blockSize = blockSize; 299 m_blockSize = blockSize;
288 300
289 reset(); 301 reset();
294 void 306 void
295 VampYin::reset() 307 VampYin::reset()
296 { 308 {
297 m_yin.setThreshold(m_yinParameter); 309 m_yin.setThreshold(m_yinParameter);
298 m_yin.setFrameSize(m_blockSize); 310 m_yin.setFrameSize(m_blockSize);
299 311 /*
300 std::cerr << "VampYin::reset: yin threshold set to " << (m_yinParameter) 312 std::cerr << "VampYin::reset: yin threshold set to " << (m_yinParameter)
301 << ", blockSize = " << m_blockSize 313 << ", blockSize = " << m_blockSize
302 << std::endl; 314 << std::endl;
315 */
303 } 316 }
304 317
305 VampYin::FeatureSet 318 VampYin::FeatureSet
306 VampYin::process(const float *const *inputBuffers, RealTime timestamp) 319 VampYin::process(const float *const *inputBuffers, RealTime timestamp)
307 { 320 {