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