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"
|
matthiasm@0
|
20
|
matthiasm@36
|
21 class PYinVamp : public Vamp::Plugin
|
matthiasm@0
|
22 {
|
matthiasm@0
|
23 public:
|
matthiasm@36
|
24 PYinVamp(float inputSampleRate);
|
matthiasm@36
|
25 virtual ~PYinVamp();
|
matthiasm@0
|
26
|
matthiasm@0
|
27 std::string getIdentifier() const;
|
matthiasm@0
|
28 std::string getName() const;
|
matthiasm@0
|
29 std::string getDescription() const;
|
matthiasm@0
|
30 std::string getMaker() const;
|
matthiasm@0
|
31 int getPluginVersion() const;
|
matthiasm@0
|
32 std::string getCopyright() const;
|
matthiasm@0
|
33
|
matthiasm@0
|
34 InputDomain getInputDomain() const;
|
matthiasm@0
|
35 size_t getPreferredBlockSize() const;
|
matthiasm@0
|
36 size_t getPreferredStepSize() const;
|
matthiasm@0
|
37 size_t getMinChannelCount() const;
|
matthiasm@0
|
38 size_t getMaxChannelCount() const;
|
matthiasm@0
|
39
|
matthiasm@0
|
40 ParameterList getParameterDescriptors() const;
|
matthiasm@0
|
41 float getParameter(std::string identifier) const;
|
matthiasm@0
|
42 void setParameter(std::string identifier, float value);
|
matthiasm@0
|
43
|
matthiasm@0
|
44 ProgramList getPrograms() const;
|
matthiasm@0
|
45 std::string getCurrentProgram() const;
|
matthiasm@0
|
46 void selectProgram(std::string name);
|
matthiasm@0
|
47
|
matthiasm@0
|
48 OutputList getOutputDescriptors() const;
|
matthiasm@0
|
49
|
matthiasm@0
|
50 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
|
matthiasm@0
|
51 void reset();
|
matthiasm@0
|
52
|
matthiasm@0
|
53 FeatureSet process(const float *const *inputBuffers,
|
matthiasm@0
|
54 Vamp::RealTime timestamp);
|
matthiasm@0
|
55
|
matthiasm@0
|
56 FeatureSet getRemainingFeatures();
|
matthiasm@0
|
57
|
matthiasm@0
|
58 protected:
|
matthiasm@0
|
59 size_t m_channels;
|
matthiasm@0
|
60 size_t m_stepSize;
|
matthiasm@0
|
61 size_t m_blockSize;
|
matthiasm@0
|
62 float m_fmin;
|
matthiasm@0
|
63 float m_fmax;
|
matthiasm@0
|
64 Yin m_yin;
|
matthiasm@0
|
65
|
matthiasm@0
|
66 mutable int m_oF0Candidates;
|
matthiasm@0
|
67 mutable int m_oF0Probs;
|
matthiasm@0
|
68 mutable int m_oVoicedProb;
|
matthiasm@0
|
69 mutable int m_oCandidateSalience;
|
matthiasm@0
|
70 mutable int m_oSmoothedPitchTrack;
|
matthiasm@0
|
71 mutable int m_oNotes;
|
Chris@2
|
72
|
Chris@2
|
73 float m_threshDistr;
|
Chris@2
|
74 float m_outputUnvoiced;
|
matthiasm@70
|
75 float m_preciseTime;
|
matthiasm@72
|
76 float m_lowAmp;
|
matthiasm@107
|
77 float m_onsetSensitivity;
|
matthiasm@108
|
78 float m_pruneThresh;
|
Chris@2
|
79 vector<vector<pair<double, double> > > m_pitchProb;
|
Chris@2
|
80 vector<Vamp::RealTime> m_timestamp;
|
matthiasm@103
|
81 vector<float> m_level;
|
matthiasm@0
|
82 };
|
matthiasm@0
|
83
|
matthiasm@0
|
84 #endif
|