cannam@0
|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
|
cannam@0
|
2
|
cannam@0
|
3 /*
|
cannam@0
|
4 Vamp feature extraction plugins using Paul Brossier's Aubio library.
|
cannam@0
|
5
|
cannam@0
|
6 Centre for Digital Music, Queen Mary, University of London.
|
cannam@0
|
7 This file copyright 2006 Chris Cannam.
|
cannam@0
|
8
|
piem@112
|
9 This file is part of vamp-aubio-plugins.
|
piem@112
|
10
|
piem@112
|
11 vamp-aubio is free software: you can redistribute it and/or modify
|
piem@112
|
12 it under the terms of the GNU General Public License as published by
|
piem@112
|
13 the Free Software Foundation, either version 3 of the License, or
|
piem@112
|
14 (at your option) any later version.
|
piem@112
|
15
|
piem@112
|
16 vamp-aubio is distributed in the hope that it will be useful,
|
piem@112
|
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
|
piem@112
|
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
piem@112
|
19 GNU General Public License for more details.
|
piem@112
|
20
|
piem@112
|
21 You should have received a copy of the GNU General Public License
|
piem@112
|
22 along with aubio. If not, see <http://www.gnu.org/licenses/>.
|
cannam@0
|
23
|
cannam@0
|
24 */
|
cannam@0
|
25
|
cannam@0
|
26 #ifndef _PITCH_PLUGIN_H_
|
cannam@0
|
27 #define _PITCH_PLUGIN_H_
|
cannam@0
|
28
|
cannam@0
|
29 #include <vamp-sdk/Plugin.h>
|
piem@51
|
30 #include <aubio/aubio.h>
|
cannam@0
|
31
|
cannam@31
|
32 #include "Types.h"
|
cannam@31
|
33
|
cannam@0
|
34 class Pitch : public Vamp::Plugin
|
cannam@0
|
35 {
|
cannam@0
|
36 public:
|
cannam@0
|
37 Pitch(float inputSampleRate);
|
cannam@0
|
38 virtual ~Pitch();
|
cannam@0
|
39
|
cannam@0
|
40 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
|
cannam@0
|
41 void reset();
|
cannam@0
|
42
|
cannam@0
|
43 InputDomain getInputDomain() const { return TimeDomain; }
|
cannam@0
|
44
|
cannam@13
|
45 std::string getIdentifier() const;
|
cannam@0
|
46 std::string getName() const;
|
cannam@0
|
47 std::string getDescription() const;
|
cannam@0
|
48 std::string getMaker() const;
|
cannam@0
|
49 int getPluginVersion() const;
|
cannam@0
|
50 std::string getCopyright() const;
|
cannam@0
|
51
|
cannam@0
|
52 ParameterList getParameterDescriptors() const;
|
cannam@0
|
53 float getParameter(std::string) const;
|
cannam@0
|
54 void setParameter(std::string, float);
|
cannam@0
|
55
|
cannam@0
|
56 size_t getPreferredStepSize() const;
|
cannam@0
|
57 size_t getPreferredBlockSize() const;
|
cannam@0
|
58
|
cannam@0
|
59 OutputList getOutputDescriptors() const;
|
cannam@0
|
60
|
cannam@12
|
61 FeatureSet process(const float *const *inputBuffers,
|
cannam@12
|
62 Vamp::RealTime timestamp);
|
cannam@0
|
63
|
cannam@0
|
64 FeatureSet getRemainingFeatures();
|
cannam@0
|
65
|
cannam@0
|
66 protected:
|
cannam@0
|
67 fvec_t *m_ibuf;
|
cannam@33
|
68 fvec_t *m_obuf;
|
cannam@30
|
69 aubio_pitch_t *m_pitchdet;
|
cannam@30
|
70 PitchType m_pitchtype;
|
cannam@23
|
71 float m_minfreq;
|
cannam@23
|
72 float m_maxfreq;
|
cannam@23
|
73 float m_silence;
|
cannam@23
|
74 bool m_wrapRange;
|
cannam@23
|
75
|
cannam@0
|
76 size_t m_stepSize;
|
cannam@0
|
77 size_t m_blockSize;
|
cannam@0
|
78 };
|
cannam@0
|
79
|
cannam@0
|
80
|
cannam@0
|
81 #endif
|