Mercurial > hg > pyin
annotate MonoNote.h @ 85:bf6b9338233d
added script
author | Matthias Mauch <matthias.mauch@eecs.qmul.ac.uk> |
---|---|
date | Thu, 04 Dec 2014 16:37:58 +0000 |
parents | 5945b8905d1f |
children | 729cc1da9b8d |
rev | line source |
---|---|
Chris@9 | 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ |
Chris@9 | 2 |
Chris@9 | 3 /* |
Chris@9 | 4 pYIN - A fundamental frequency estimator for monophonic audio |
Chris@9 | 5 Centre for Digital Music, Queen Mary, University of London. |
Chris@9 | 6 |
Chris@9 | 7 This program is free software; you can redistribute it and/or |
Chris@9 | 8 modify it under the terms of the GNU General Public License as |
Chris@9 | 9 published by the Free Software Foundation; either version 2 of the |
Chris@9 | 10 License, or (at your option) any later version. See the file |
Chris@9 | 11 COPYING included with this distribution for more information. |
Chris@9 | 12 */ |
Chris@9 | 13 |
matthiasm@0 | 14 #ifndef _MONONOTE_H_ |
matthiasm@0 | 15 #define _MONONOTE_H_ |
matthiasm@0 | 16 |
matthiasm@0 | 17 #include "MonoNoteHMM.h" |
matthiasm@0 | 18 #include "MonoNoteParameters.h" |
matthiasm@0 | 19 |
matthiasm@0 | 20 #include <iostream> |
matthiasm@0 | 21 #include <vector> |
matthiasm@0 | 22 #include <exception> |
matthiasm@0 | 23 |
matthiasm@0 | 24 using std::vector; |
matthiasm@0 | 25 using std::pair; |
matthiasm@0 | 26 |
matthiasm@0 | 27 class MonoNote { |
matthiasm@0 | 28 public: |
matthiasm@0 | 29 MonoNote(); |
matthiasm@0 | 30 virtual ~MonoNote(); |
matthiasm@0 | 31 |
matthiasm@0 | 32 struct FrameOutput { |
matthiasm@0 | 33 size_t frameNumber; |
matthiasm@0 | 34 double pitch; |
matthiasm@0 | 35 size_t noteState; // unvoiced, attack, stable, release, inter |
matthiasm@0 | 36 FrameOutput() : frameNumber(0), pitch(-1.0), noteState(0) { } |
matthiasm@0 | 37 FrameOutput(size_t _frameNumber, double _pitch, size_t _noteState) : |
matthiasm@0 | 38 frameNumber(_frameNumber), pitch(_pitch), noteState(_noteState) { } |
matthiasm@0 | 39 }; |
matthiasm@0 | 40 // pitchProb is a frame-wise vector carrying a vector of pitch-probability pairs |
matthiasm@0 | 41 const vector<FrameOutput> process(const vector<vector<pair<double, double> > > pitchProb); |
matthiasm@0 | 42 private: |
matthiasm@0 | 43 MonoNoteHMM hmm; |
matthiasm@0 | 44 }; |
matthiasm@0 | 45 |
Chris@9 | 46 #endif |