matthiasm@0
|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
|
Chris@9
|
2
|
matthiasm@0
|
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.
|
matthiasm@0
|
12 */
|
matthiasm@0
|
13
|
matthiasm@36
|
14 #ifndef _PYINVAMP_H_
|
matthiasm@36
|
15 #define _PYINVAMP_H_
|
matthiasm@0
|
16
|
matthiasm@0
|
17 #include <vamp-sdk/Plugin.h>
|
matthiasm@0
|
18
|
matthiasm@0
|
19 #include "Yin.h"
|
mail@131
|
20 #include "MonoPitchHMM.h"
|
matthiasm@0
|
21
|
matthiasm@36
|
22 class PYinVamp : public Vamp::Plugin
|
matthiasm@0
|
23 {
|
matthiasm@0
|
24 public:
|
matthiasm@36
|
25 PYinVamp(float inputSampleRate);
|
matthiasm@36
|
26 virtual ~PYinVamp();
|
matthiasm@0
|
27
|
matthiasm@0
|
28 std::string getIdentifier() const;
|
matthiasm@0
|
29 std::string getName() const;
|
matthiasm@0
|
30 std::string getDescription() const;
|
matthiasm@0
|
31 std::string getMaker() const;
|
matthiasm@0
|
32 int getPluginVersion() const;
|
matthiasm@0
|
33 std::string getCopyright() const;
|
matthiasm@0
|
34
|
matthiasm@0
|
35 InputDomain getInputDomain() const;
|
matthiasm@0
|
36 size_t getPreferredBlockSize() const;
|
matthiasm@0
|
37 size_t getPreferredStepSize() const;
|
matthiasm@0
|
38 size_t getMinChannelCount() const;
|
matthiasm@0
|
39 size_t getMaxChannelCount() const;
|
matthiasm@0
|
40
|
matthiasm@0
|
41 ParameterList getParameterDescriptors() const;
|
matthiasm@0
|
42 float getParameter(std::string identifier) const;
|
matthiasm@0
|
43 void setParameter(std::string identifier, float value);
|
matthiasm@0
|
44
|
matthiasm@0
|
45 ProgramList getPrograms() const;
|
matthiasm@0
|
46 std::string getCurrentProgram() const;
|
matthiasm@0
|
47 void selectProgram(std::string name);
|
matthiasm@0
|
48
|
matthiasm@0
|
49 OutputList getOutputDescriptors() const;
|
matthiasm@0
|
50
|
matthiasm@0
|
51 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
|
matthiasm@0
|
52 void reset();
|
matthiasm@0
|
53
|
matthiasm@0
|
54 FeatureSet process(const float *const *inputBuffers,
|
matthiasm@0
|
55 Vamp::RealTime timestamp);
|
matthiasm@0
|
56
|
matthiasm@0
|
57 FeatureSet getRemainingFeatures();
|
matthiasm@0
|
58
|
matthiasm@0
|
59 protected:
|
matthiasm@0
|
60 size_t m_channels;
|
matthiasm@0
|
61 size_t m_stepSize;
|
matthiasm@0
|
62 size_t m_blockSize;
|
matthiasm@0
|
63 float m_fmin;
|
matthiasm@0
|
64 float m_fmax;
|
matthiasm@0
|
65 Yin m_yin;
|
matthiasm@0
|
66
|
matthiasm@0
|
67 mutable int m_oF0Candidates;
|
matthiasm@0
|
68 mutable int m_oF0Probs;
|
matthiasm@0
|
69 mutable int m_oVoicedProb;
|
matthiasm@0
|
70 mutable int m_oCandidateSalience;
|
matthiasm@0
|
71 mutable int m_oSmoothedPitchTrack;
|
matthiasm@0
|
72 mutable int m_oNotes;
|
Chris@2
|
73
|
Chris@2
|
74 float m_threshDistr;
|
mail@130
|
75 float m_fixedLag;
|
Chris@2
|
76 float m_outputUnvoiced;
|
matthiasm@70
|
77 float m_preciseTime;
|
matthiasm@72
|
78 float m_lowAmp;
|
matthiasm@107
|
79 float m_onsetSensitivity;
|
matthiasm@108
|
80 float m_pruneThresh;
|
mail@131
|
81
|
mail@131
|
82 MonoPitchHMM m_pitchHmm;
|
mail@131
|
83
|
mail@132
|
84 deque<vector<pair<double, double> > > m_pitchProb;
|
mail@132
|
85 deque<Vamp::RealTime> m_timestamp;
|
matthiasm@103
|
86 vector<float> m_level;
|
mail@133
|
87 vector<float> m_pitchTrack;
|
mail@133
|
88
|
Chris@146
|
89 void addNoteFeatures(FeatureSet &fs);
|
matthiasm@0
|
90 };
|
matthiasm@0
|
91
|
matthiasm@0
|
92 #endif
|