# HG changeset patch # User matthiasm # Date 1390746289 0 # Node ID 8e50e88417e626c547498184be20137ee834d72a # Parent 5d43ce0eeeb8e4918ce70ddf5ace94e6c41bbdb1 rename VampYin to YinVamp diff -r 5d43ce0eeeb8 -r 8e50e88417e6 Makefile.inc --- a/Makefile.inc Fri Jan 24 13:16:49 2014 +0000 +++ b/Makefile.inc Sun Jan 26 14:24:49 2014 +0000 @@ -10,7 +10,7 @@ PLUGIN := pyin$(PLUGIN_EXT) SOURCES := PYIN.cpp \ - VampYin.cpp \ + YinVamp.cpp \ LocalCandidatePYIN.cpp \ Yin.cpp \ YinUtil.cpp \ @@ -65,7 +65,7 @@ # DO NOT DELETE PYIN.o: PYIN.h -VampYin.o: VampYin.h +YinVamp.o: YinVamp.h LocalCandidatePYIN.o: LocalCandidatePYIN.h Yin.o: Yin.h MonoNoteParameters.o: MonoNoteParameters.h @@ -74,7 +74,7 @@ MonoPitchHMM.o: MonoPitchHMM.h SparseHMM.o: SparseHMM.h MonoNoteHMM.o: MonoNoteHMM.h -libmain.o: PYIN.h VampYin.h LocalCandidatePYIN.h +libmain.o: PYIN.h YinVamp.h LocalCandidatePYIN.h test/TestMeanFilter.o: MeanFilter.h test/TestYin.o: Yin.h diff -r 5d43ce0eeeb8 -r 8e50e88417e6 VampYin.cpp --- a/VampYin.cpp Fri Jan 24 13:16:49 2014 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,379 +0,0 @@ -/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ - -/* - pYIN - A fundamental frequency estimator for monophonic audio - Centre for Digital Music, Queen Mary, University of London. - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. See the file - COPYING included with this distribution for more information. -*/ - -#include "VampYin.h" -#include "MonoNote.h" - -#include "vamp-sdk/FFT.h" - -#include -#include - -#include -#include -#include - -using std::string; -using std::vector; -using Vamp::RealTime; - - -VampYin::VampYin(float inputSampleRate) : - Plugin(inputSampleRate), - m_channels(0), - m_stepSize(256), - m_blockSize(2048), - m_fmin(40), - m_fmax(1000), - m_yin(2048, inputSampleRate, 0.0), - m_outNoF0(0), - m_outNoPeriodicity(0), - m_outNoRms(0), - m_outNoSalience(0), - m_yinParameter(0.15f), - m_outputUnvoiced(2.0f) -{ -} - -VampYin::~VampYin() -{ -} - -string -VampYin::getIdentifier() const -{ - return "yin"; -} - -string -VampYin::getName() const -{ - return "Yin"; -} - -string -VampYin::getDescription() const -{ - return "A vamp implementation of the Yin algorithm for monophonic frequency estimation."; -} - -string -VampYin::getMaker() const -{ - return "Matthias Mauch"; -} - -int -VampYin::getPluginVersion() const -{ - // Increment this each time you release a version that behaves - // differently from the previous one - return 1; -} - -string -VampYin::getCopyright() const -{ - return "GPL"; -} - -VampYin::InputDomain -VampYin::getInputDomain() const -{ - return TimeDomain; -} - -size_t -VampYin::getPreferredBlockSize() const -{ - return 2048; -} - -size_t -VampYin::getPreferredStepSize() const -{ - return 256; -} - -size_t -VampYin::getMinChannelCount() const -{ - return 1; -} - -size_t -VampYin::getMaxChannelCount() const -{ - return 1; -} - -VampYin::ParameterList -VampYin::getParameterDescriptors() const -{ - ParameterList list; - - ParameterDescriptor d; - d.identifier = "yinThreshold"; - d.name = "Yin threshold"; - d.description = "The greedy Yin search for a low value difference function is done once a dip lower than this threshold is reached."; - d.unit = ""; - d.minValue = 0.025f; - d.maxValue = 1.0f; - d.defaultValue = 0.15f; - d.isQuantized = true; - d.quantizeStep = 0.025f; - - list.push_back(d); - - // d.identifier = "removeunvoiced"; - // d.name = "Remove pitches classified as unvoiced."; - // d.description = "If ticked, then the pitch estimator will return the most likely pitch, even if it 'thinks' there isn't any."; - // d.unit = ""; - // d.minValue = 0.0f; - // d.maxValue = 1.0f; - // d.defaultValue = 0.0f; - // d.isQuantized = true; - // d.quantizeStep = 1.0f; - // d.valueNames.clear(); - // list.push_back(d); - - d.identifier = "outputunvoiced"; - d.valueNames.clear(); - d.name = "Output estimates classified as unvoiced?"; - d.description = "."; - d.unit = ""; - d.minValue = 0.0f; - d.maxValue = 2.0f; - d.defaultValue = 2.0f; - d.isQuantized = true; - d.quantizeStep = 1.0f; - d.valueNames.push_back("No"); - d.valueNames.push_back("Yes"); - d.valueNames.push_back("Yes, as negative frequencies"); - list.push_back(d); - - return list; -} - -float -VampYin::getParameter(string identifier) const -{ - if (identifier == "yinThreshold") { - return m_yinParameter; - } - if (identifier == "outputunvoiced") { - return m_outputUnvoiced; - } - return 0.f; -} - -void -VampYin::setParameter(string identifier, float value) -{ - if (identifier == "yinThreshold") - { - m_yinParameter = value; - } - if (identifier == "outputunvoiced") - { - m_outputUnvoiced = value; - } -} - -VampYin::ProgramList -VampYin::getPrograms() const -{ - ProgramList list; - return list; -} - -string -VampYin::getCurrentProgram() const -{ - return ""; // no programs -} - -void -VampYin::selectProgram(string name) -{ -} - -VampYin::OutputList -VampYin::getOutputDescriptors() const -{ - OutputList outputs; - - OutputDescriptor d; - - int outputNumber = 0; - - d.identifier = "f0"; - d.name = "Estimated f0"; - d.description = "Estimated fundamental frequency"; - d.unit = "Hz"; - d.hasFixedBinCount = true; - d.binCount = 1; - d.hasKnownExtents = true; - d.minValue = m_fmin; - d.maxValue = 500; - d.isQuantized = false; - d.sampleType = OutputDescriptor::FixedSampleRate; - d.sampleRate = (m_inputSampleRate / m_stepSize); - d.hasDuration = false; - outputs.push_back(d); - m_outNoF0 = outputNumber++; - - d.identifier = "periodicity"; - d.name = "Periodicity"; - d.description = "by-product of Yin f0 estimation"; - d.unit = ""; - d.hasFixedBinCount = true; - d.binCount = 1; - d.hasKnownExtents = true; - d.minValue = 0; - d.maxValue = 1; - d.isQuantized = false; - d.sampleType = OutputDescriptor::FixedSampleRate; - d.sampleRate = (m_inputSampleRate / m_stepSize); - d.hasDuration = false; - outputs.push_back(d); - m_outNoPeriodicity = outputNumber++; - - d.identifier = "rms"; - d.name = "Root mean square"; - d.description = "Root mean square of the waveform."; - d.unit = ""; - d.hasFixedBinCount = true; - d.binCount = 1; - d.hasKnownExtents = true; - d.minValue = 0; - d.maxValue = 1; - d.isQuantized = false; - d.sampleType = OutputDescriptor::FixedSampleRate; - d.sampleRate = (m_inputSampleRate / m_stepSize); - d.hasDuration = false; - outputs.push_back(d); - m_outNoRms = outputNumber++; - - d.identifier = "salience"; - d.name = "Salience"; - d.description = "Yin Salience"; - d.hasFixedBinCount = true; - d.binCount = m_blockSize / 2; - d.hasKnownExtents = true; - d.minValue = 0; - d.maxValue = 1; - d.isQuantized = false; - d.sampleType = OutputDescriptor::FixedSampleRate; - d.sampleRate = (m_inputSampleRate / m_stepSize); - d.hasDuration = false; - outputs.push_back(d); - m_outNoSalience = outputNumber++; - - return outputs; -} - -bool -VampYin::initialise(size_t channels, size_t stepSize, size_t blockSize) -{ - if (channels < getMinChannelCount() || - channels > getMaxChannelCount()) return false; - -/* - std::cerr << "VampYin::initialise: channels = " << channels - << ", stepSize = " << stepSize << ", blockSize = " << blockSize - << std::endl; -*/ - m_channels = channels; - m_stepSize = stepSize; - m_blockSize = blockSize; - - reset(); - - return true; -} - -void -VampYin::reset() -{ - m_yin.setThreshold(m_yinParameter); - m_yin.setFrameSize(m_blockSize); -/* - std::cerr << "VampYin::reset: yin threshold set to " << (m_yinParameter) - << ", blockSize = " << m_blockSize - << std::endl; -*/ -} - -VampYin::FeatureSet -VampYin::process(const float *const *inputBuffers, RealTime timestamp) -{ - timestamp = timestamp + Vamp::RealTime::frame2RealTime(m_blockSize/4, lrintf(m_inputSampleRate)); - FeatureSet fs; - - double *dInputBuffers = new double[m_blockSize]; - for (size_t i = 0; i < m_blockSize; ++i) dInputBuffers[i] = inputBuffers[0][i]; - - Yin::YinOutput yo = m_yin.process(dInputBuffers); - // std::cerr << "f0 in VampYin: " << yo.f0 << std::endl; - Feature f; - f.hasTimestamp = true; - f.timestamp = timestamp; - if (m_outputUnvoiced == 0.0f) - { - // std::cerr << "f0 in VampYin: " << yo.f0 << std::endl; - if (yo.f0 > 0 && yo.f0 < m_fmax && yo.f0 > m_fmin) { - f.values.push_back(yo.f0); - fs[m_outNoF0].push_back(f); - } - } else if (m_outputUnvoiced == 1.0f) - { - if (fabs(yo.f0) < m_fmax && fabs(yo.f0) > m_fmin) { - f.values.push_back(fabs(yo.f0)); - fs[m_outNoF0].push_back(f); - } - } else - { - if (fabs(yo.f0) < m_fmax && fabs(yo.f0) > m_fmin) { - f.values.push_back(yo.f0); - fs[m_outNoF0].push_back(f); - } - } - - f.values.clear(); - f.values.push_back(yo.rms); - fs[m_outNoRms].push_back(f); - - f.values.clear(); - for (size_t iBin = 0; iBin < yo.salience.size(); ++iBin) - { - f.values.push_back(yo.salience[iBin]); - } - fs[m_outNoSalience].push_back(f); - - f.values.clear(); - // f.values[0] = yo.periodicity; - f.values.push_back(yo.periodicity); - fs[m_outNoPeriodicity].push_back(f); - - delete [] dInputBuffers; - - return fs; -} - -VampYin::FeatureSet -VampYin::getRemainingFeatures() -{ - FeatureSet fs; - return fs; -} diff -r 5d43ce0eeeb8 -r 8e50e88417e6 VampYin.h --- a/VampYin.h Fri Jan 24 13:16:49 2014 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ -/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ - -/* - pYIN - A fundamental frequency estimator for monophonic audio - Centre for Digital Music, Queen Mary, University of London. - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. See the file - COPYING included with this distribution for more information. -*/ - -#ifndef _VAMPYIN_H_ -#define _VAMPYIN_H_ - -#include - -#include "Yin.h" - -class VampYin : public Vamp::Plugin -{ -public: - VampYin(float inputSampleRate); - virtual ~VampYin(); - - std::string getIdentifier() const; - std::string getName() const; - std::string getDescription() const; - std::string getMaker() const; - int getPluginVersion() const; - std::string getCopyright() const; - - InputDomain getInputDomain() const; - size_t getPreferredBlockSize() const; - size_t getPreferredStepSize() const; - size_t getMinChannelCount() const; - size_t getMaxChannelCount() const; - - ParameterList getParameterDescriptors() const; - float getParameter(std::string identifier) const; - void setParameter(std::string identifier, float value); - - ProgramList getPrograms() const; - std::string getCurrentProgram() const; - void selectProgram(std::string name); - - OutputList getOutputDescriptors() const; - - bool initialise(size_t channels, size_t stepSize, size_t blockSize); - void reset(); - - FeatureSet process(const float *const *inputBuffers, - Vamp::RealTime timestamp); - - FeatureSet getRemainingFeatures(); - -protected: - size_t m_channels; - size_t m_stepSize; - size_t m_blockSize; - float m_fmin; - float m_fmax; - Yin m_yin; - - mutable int m_outNoF0; - mutable int m_outNoPeriodicity; - mutable int m_outNoRms; - mutable int m_outNoSalience; - - float m_yinParameter; - float m_outputUnvoiced; -}; - -#endif diff -r 5d43ce0eeeb8 -r 8e50e88417e6 YinVamp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/YinVamp.cpp Sun Jan 26 14:24:49 2014 +0000 @@ -0,0 +1,379 @@ +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +/* + pYIN - A fundamental frequency estimator for monophonic audio + Centre for Digital Music, Queen Mary, University of London. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. See the file + COPYING included with this distribution for more information. +*/ + +#include "YinVamp.h" +#include "MonoNote.h" + +#include "vamp-sdk/FFT.h" + +#include +#include + +#include +#include +#include + +using std::string; +using std::vector; +using Vamp::RealTime; + + +YinVamp::YinVamp(float inputSampleRate) : + Plugin(inputSampleRate), + m_channels(0), + m_stepSize(256), + m_blockSize(2048), + m_fmin(40), + m_fmax(1000), + m_yin(2048, inputSampleRate, 0.0), + m_outNoF0(0), + m_outNoPeriodicity(0), + m_outNoRms(0), + m_outNoSalience(0), + m_yinParameter(0.15f), + m_outputUnvoiced(2.0f) +{ +} + +YinVamp::~YinVamp() +{ +} + +string +YinVamp::getIdentifier() const +{ + return "yin"; +} + +string +YinVamp::getName() const +{ + return "Yin"; +} + +string +YinVamp::getDescription() const +{ + return "A vamp implementation of the Yin algorithm for monophonic frequency estimation."; +} + +string +YinVamp::getMaker() const +{ + return "Matthias Mauch"; +} + +int +YinVamp::getPluginVersion() const +{ + // Increment this each time you release a version that behaves + // differently from the previous one + return 1; +} + +string +YinVamp::getCopyright() const +{ + return "GPL"; +} + +YinVamp::InputDomain +YinVamp::getInputDomain() const +{ + return TimeDomain; +} + +size_t +YinVamp::getPreferredBlockSize() const +{ + return 2048; +} + +size_t +YinVamp::getPreferredStepSize() const +{ + return 256; +} + +size_t +YinVamp::getMinChannelCount() const +{ + return 1; +} + +size_t +YinVamp::getMaxChannelCount() const +{ + return 1; +} + +YinVamp::ParameterList +YinVamp::getParameterDescriptors() const +{ + ParameterList list; + + ParameterDescriptor d; + d.identifier = "yinThreshold"; + d.name = "Yin threshold"; + d.description = "The greedy Yin search for a low value difference function is done once a dip lower than this threshold is reached."; + d.unit = ""; + d.minValue = 0.025f; + d.maxValue = 1.0f; + d.defaultValue = 0.15f; + d.isQuantized = true; + d.quantizeStep = 0.025f; + + list.push_back(d); + + // d.identifier = "removeunvoiced"; + // d.name = "Remove pitches classified as unvoiced."; + // d.description = "If ticked, then the pitch estimator will return the most likely pitch, even if it 'thinks' there isn't any."; + // d.unit = ""; + // d.minValue = 0.0f; + // d.maxValue = 1.0f; + // d.defaultValue = 0.0f; + // d.isQuantized = true; + // d.quantizeStep = 1.0f; + // d.valueNames.clear(); + // list.push_back(d); + + d.identifier = "outputunvoiced"; + d.valueNames.clear(); + d.name = "Output estimates classified as unvoiced?"; + d.description = "."; + d.unit = ""; + d.minValue = 0.0f; + d.maxValue = 2.0f; + d.defaultValue = 2.0f; + d.isQuantized = true; + d.quantizeStep = 1.0f; + d.valueNames.push_back("No"); + d.valueNames.push_back("Yes"); + d.valueNames.push_back("Yes, as negative frequencies"); + list.push_back(d); + + return list; +} + +float +YinVamp::getParameter(string identifier) const +{ + if (identifier == "yinThreshold") { + return m_yinParameter; + } + if (identifier == "outputunvoiced") { + return m_outputUnvoiced; + } + return 0.f; +} + +void +YinVamp::setParameter(string identifier, float value) +{ + if (identifier == "yinThreshold") + { + m_yinParameter = value; + } + if (identifier == "outputunvoiced") + { + m_outputUnvoiced = value; + } +} + +YinVamp::ProgramList +YinVamp::getPrograms() const +{ + ProgramList list; + return list; +} + +string +YinVamp::getCurrentProgram() const +{ + return ""; // no programs +} + +void +YinVamp::selectProgram(string name) +{ +} + +YinVamp::OutputList +YinVamp::getOutputDescriptors() const +{ + OutputList outputs; + + OutputDescriptor d; + + int outputNumber = 0; + + d.identifier = "f0"; + d.name = "Estimated f0"; + d.description = "Estimated fundamental frequency"; + d.unit = "Hz"; + d.hasFixedBinCount = true; + d.binCount = 1; + d.hasKnownExtents = true; + d.minValue = m_fmin; + d.maxValue = 500; + d.isQuantized = false; + d.sampleType = OutputDescriptor::FixedSampleRate; + d.sampleRate = (m_inputSampleRate / m_stepSize); + d.hasDuration = false; + outputs.push_back(d); + m_outNoF0 = outputNumber++; + + d.identifier = "periodicity"; + d.name = "Periodicity"; + d.description = "by-product of Yin f0 estimation"; + d.unit = ""; + d.hasFixedBinCount = true; + d.binCount = 1; + d.hasKnownExtents = true; + d.minValue = 0; + d.maxValue = 1; + d.isQuantized = false; + d.sampleType = OutputDescriptor::FixedSampleRate; + d.sampleRate = (m_inputSampleRate / m_stepSize); + d.hasDuration = false; + outputs.push_back(d); + m_outNoPeriodicity = outputNumber++; + + d.identifier = "rms"; + d.name = "Root mean square"; + d.description = "Root mean square of the waveform."; + d.unit = ""; + d.hasFixedBinCount = true; + d.binCount = 1; + d.hasKnownExtents = true; + d.minValue = 0; + d.maxValue = 1; + d.isQuantized = false; + d.sampleType = OutputDescriptor::FixedSampleRate; + d.sampleRate = (m_inputSampleRate / m_stepSize); + d.hasDuration = false; + outputs.push_back(d); + m_outNoRms = outputNumber++; + + d.identifier = "salience"; + d.name = "Salience"; + d.description = "Yin Salience"; + d.hasFixedBinCount = true; + d.binCount = m_blockSize / 2; + d.hasKnownExtents = true; + d.minValue = 0; + d.maxValue = 1; + d.isQuantized = false; + d.sampleType = OutputDescriptor::FixedSampleRate; + d.sampleRate = (m_inputSampleRate / m_stepSize); + d.hasDuration = false; + outputs.push_back(d); + m_outNoSalience = outputNumber++; + + return outputs; +} + +bool +YinVamp::initialise(size_t channels, size_t stepSize, size_t blockSize) +{ + if (channels < getMinChannelCount() || + channels > getMaxChannelCount()) return false; + +/* + std::cerr << "YinVamp::initialise: channels = " << channels + << ", stepSize = " << stepSize << ", blockSize = " << blockSize + << std::endl; +*/ + m_channels = channels; + m_stepSize = stepSize; + m_blockSize = blockSize; + + reset(); + + return true; +} + +void +YinVamp::reset() +{ + m_yin.setThreshold(m_yinParameter); + m_yin.setFrameSize(m_blockSize); +/* + std::cerr << "YinVamp::reset: yin threshold set to " << (m_yinParameter) + << ", blockSize = " << m_blockSize + << std::endl; +*/ +} + +YinVamp::FeatureSet +YinVamp::process(const float *const *inputBuffers, RealTime timestamp) +{ + timestamp = timestamp + Vamp::RealTime::frame2RealTime(m_blockSize/4, lrintf(m_inputSampleRate)); + FeatureSet fs; + + double *dInputBuffers = new double[m_blockSize]; + for (size_t i = 0; i < m_blockSize; ++i) dInputBuffers[i] = inputBuffers[0][i]; + + Yin::YinOutput yo = m_yin.process(dInputBuffers); + // std::cerr << "f0 in YinVamp: " << yo.f0 << std::endl; + Feature f; + f.hasTimestamp = true; + f.timestamp = timestamp; + if (m_outputUnvoiced == 0.0f) + { + // std::cerr << "f0 in YinVamp: " << yo.f0 << std::endl; + if (yo.f0 > 0 && yo.f0 < m_fmax && yo.f0 > m_fmin) { + f.values.push_back(yo.f0); + fs[m_outNoF0].push_back(f); + } + } else if (m_outputUnvoiced == 1.0f) + { + if (fabs(yo.f0) < m_fmax && fabs(yo.f0) > m_fmin) { + f.values.push_back(fabs(yo.f0)); + fs[m_outNoF0].push_back(f); + } + } else + { + if (fabs(yo.f0) < m_fmax && fabs(yo.f0) > m_fmin) { + f.values.push_back(yo.f0); + fs[m_outNoF0].push_back(f); + } + } + + f.values.clear(); + f.values.push_back(yo.rms); + fs[m_outNoRms].push_back(f); + + f.values.clear(); + for (size_t iBin = 0; iBin < yo.salience.size(); ++iBin) + { + f.values.push_back(yo.salience[iBin]); + } + fs[m_outNoSalience].push_back(f); + + f.values.clear(); + // f.values[0] = yo.periodicity; + f.values.push_back(yo.periodicity); + fs[m_outNoPeriodicity].push_back(f); + + delete [] dInputBuffers; + + return fs; +} + +YinVamp::FeatureSet +YinVamp::getRemainingFeatures() +{ + FeatureSet fs; + return fs; +} diff -r 5d43ce0eeeb8 -r 8e50e88417e6 YinVamp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/YinVamp.h Sun Jan 26 14:24:49 2014 +0000 @@ -0,0 +1,75 @@ +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +/* + pYIN - A fundamental frequency estimator for monophonic audio + Centre for Digital Music, Queen Mary, University of London. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. See the file + COPYING included with this distribution for more information. +*/ + +#ifndef _YINVAMP_H_ +#define _YINVAMP_H_ + +#include + +#include "Yin.h" + +class YinVamp : public Vamp::Plugin +{ +public: + YinVamp(float inputSampleRate); + virtual ~YinVamp(); + + std::string getIdentifier() const; + std::string getName() const; + std::string getDescription() const; + std::string getMaker() const; + int getPluginVersion() const; + std::string getCopyright() const; + + InputDomain getInputDomain() const; + size_t getPreferredBlockSize() const; + size_t getPreferredStepSize() const; + size_t getMinChannelCount() const; + size_t getMaxChannelCount() const; + + ParameterList getParameterDescriptors() const; + float getParameter(std::string identifier) const; + void setParameter(std::string identifier, float value); + + ProgramList getPrograms() const; + std::string getCurrentProgram() const; + void selectProgram(std::string name); + + OutputList getOutputDescriptors() const; + + bool initialise(size_t channels, size_t stepSize, size_t blockSize); + void reset(); + + FeatureSet process(const float *const *inputBuffers, + Vamp::RealTime timestamp); + + FeatureSet getRemainingFeatures(); + +protected: + size_t m_channels; + size_t m_stepSize; + size_t m_blockSize; + float m_fmin; + float m_fmax; + Yin m_yin; + + mutable int m_outNoF0; + mutable int m_outNoPeriodicity; + mutable int m_outNoRms; + mutable int m_outNoSalience; + + float m_yinParameter; + float m_outputUnvoiced; +}; + +#endif diff -r 5d43ce0eeeb8 -r 8e50e88417e6 libmain.cpp --- a/libmain.cpp Fri Jan 24 13:16:49 2014 +0000 +++ b/libmain.cpp Sun Jan 26 14:24:49 2014 +0000 @@ -15,11 +15,11 @@ #include #include "PYIN.h" -#include "VampYin.h" +#include "YinVamp.h" #include "LocalCandidatePYIN.h" static Vamp::PluginAdapter pyinPluginAdapter; -static Vamp::PluginAdapter vampyinPluginAdapter; +static Vamp::PluginAdapter yinvampPluginAdapter; static Vamp::PluginAdapter localCandidatePYINPluginAdapter; const VampPluginDescriptor * @@ -29,7 +29,7 @@ switch (index) { case 0: return pyinPluginAdapter.getDescriptor(); - case 1: return vampyinPluginAdapter.getDescriptor(); + case 1: return yinvampPluginAdapter.getDescriptor(); case 2: return localCandidatePYINPluginAdapter.getDescriptor(); default: return 0; }