Chris@9: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@9: Chris@9: /* Chris@9: pYIN - A fundamental frequency estimator for monophonic audio Chris@9: Centre for Digital Music, Queen Mary, University of London. Chris@9: Chris@9: This program is free software; you can redistribute it and/or Chris@9: modify it under the terms of the GNU General Public License as Chris@9: published by the Free Software Foundation; either version 2 of the Chris@9: License, or (at your option) any later version. See the file Chris@9: COPYING included with this distribution for more information. Chris@9: */ Chris@9: matthiasm@0: #ifndef _MONONOTE_H_ matthiasm@0: #define _MONONOTE_H_ matthiasm@0: matthiasm@0: #include "MonoNoteHMM.h" matthiasm@0: #include "MonoNoteParameters.h" matthiasm@0: matthiasm@0: #include matthiasm@0: #include matthiasm@0: #include matthiasm@0: matthiasm@0: using std::vector; matthiasm@0: using std::pair; matthiasm@0: matthiasm@0: class MonoNote { matthiasm@0: public: Chris@150: MonoNote(bool fixedLag); matthiasm@0: virtual ~MonoNote(); matthiasm@0: matthiasm@0: struct FrameOutput { matthiasm@0: size_t frameNumber; matthiasm@0: double pitch; matthiasm@0: size_t noteState; // unvoiced, attack, stable, release, inter matthiasm@0: FrameOutput() : frameNumber(0), pitch(-1.0), noteState(0) { } matthiasm@0: FrameOutput(size_t _frameNumber, double _pitch, size_t _noteState) : matthiasm@0: frameNumber(_frameNumber), pitch(_pitch), noteState(_noteState) { } matthiasm@0: }; matthiasm@0: // pitchProb is a frame-wise vector carrying a vector of pitch-probability pairs matthiasm@0: const vector process(const vector > > pitchProb); Chris@150: matthiasm@0: private: Chris@150: bool m_fixedLag; matthiasm@0: MonoNoteHMM hmm; matthiasm@0: }; matthiasm@0: Chris@9: #endif