Chris@23
|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
|
matthiasm@0
|
2
|
matthiasm@0
|
3 // Remember to use a different guard symbol in each header!
|
matthiasm@0
|
4 #ifndef _NNLS_CHROMA_
|
matthiasm@0
|
5 #define _NNLS_CHROMA_
|
matthiasm@0
|
6
|
matthiasm@0
|
7 #include <vamp-sdk/Plugin.h>
|
matthiasm@0
|
8 #include <list>
|
matthiasm@0
|
9 // #include "FFT.h"
|
matthiasm@0
|
10 using namespace std;
|
matthiasm@0
|
11
|
matthiasm@0
|
12 using std::string;
|
matthiasm@0
|
13
|
matthiasm@0
|
14 class ChordTranscriberData;
|
matthiasm@0
|
15
|
matthiasm@0
|
16
|
matthiasm@0
|
17
|
matthiasm@0
|
18 class NNLSChroma : public Vamp::Plugin
|
matthiasm@0
|
19 {
|
matthiasm@0
|
20 public:
|
matthiasm@0
|
21 NNLSChroma(float inputSampleRate);
|
matthiasm@0
|
22 virtual ~NNLSChroma();
|
matthiasm@0
|
23
|
matthiasm@0
|
24 string getIdentifier() const;
|
matthiasm@0
|
25 string getName() const;
|
matthiasm@0
|
26 string getDescription() const;
|
matthiasm@0
|
27 string getMaker() const;
|
matthiasm@0
|
28 int getPluginVersion() const;
|
matthiasm@0
|
29 string getCopyright() const;
|
matthiasm@0
|
30
|
matthiasm@0
|
31 InputDomain getInputDomain() const;
|
matthiasm@0
|
32 size_t getPreferredBlockSize() const;
|
matthiasm@0
|
33 size_t getPreferredStepSize() const;
|
matthiasm@0
|
34 size_t getMinChannelCount() const;
|
matthiasm@0
|
35 size_t getMaxChannelCount() const;
|
matthiasm@0
|
36
|
matthiasm@0
|
37 ParameterList getParameterDescriptors() const;
|
matthiasm@0
|
38 float getParameter(string identifier) const;
|
matthiasm@0
|
39 void setParameter(string identifier, float value);
|
matthiasm@0
|
40
|
matthiasm@0
|
41 ProgramList getPrograms() const;
|
matthiasm@0
|
42 string getCurrentProgram() const;
|
matthiasm@0
|
43 void selectProgram(string name);
|
matthiasm@0
|
44
|
matthiasm@0
|
45 OutputList getOutputDescriptors() const;
|
matthiasm@0
|
46
|
matthiasm@0
|
47 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
|
matthiasm@0
|
48 void reset();
|
matthiasm@0
|
49
|
matthiasm@0
|
50 FeatureSet process(const float *const *inputBuffers,
|
matthiasm@0
|
51 Vamp::RealTime timestamp);
|
matthiasm@0
|
52
|
matthiasm@0
|
53 FeatureSet getRemainingFeatures();
|
matthiasm@0
|
54
|
matthiasm@0
|
55 protected:
|
matthiasm@0
|
56 // plugin-specific data and methods go here
|
Chris@23
|
57 int frameCount;
|
matthiasm@0
|
58 FeatureList m_fl;
|
matthiasm@0
|
59 size_t m_blockSize;
|
matthiasm@0
|
60 size_t m_stepSize;
|
matthiasm@0
|
61 int m_lengthOfNoteIndex;
|
Chris@23
|
62 float m_meanTuning0;
|
Chris@23
|
63 float m_meanTuning1;
|
Chris@23
|
64 float m_meanTuning2;
|
matthiasm@0
|
65 float m_localTuning0;
|
matthiasm@0
|
66 float m_localTuning1;
|
matthiasm@0
|
67 float m_localTuning2;
|
matthiasm@0
|
68 float m_paling;
|
Chris@23
|
69 float m_preset;
|
matthiasm@0
|
70 vector<float> m_localTuning;
|
Chris@23
|
71 vector<float> m_kernelValue;
|
Chris@23
|
72 vector<int> m_kernelFftIndex;
|
Chris@23
|
73 vector<int> m_kernelNoteIndex;
|
Chris@23
|
74 float *m_dict;
|
matthiasm@0
|
75 bool m_tuneLocal;
|
matthiasm@0
|
76 int m_dictID;
|
Chris@23
|
77 vector<float> m_chorddict;
|
Chris@23
|
78 vector<string> m_chordnames;
|
Chris@23
|
79 float m_doNormalizeChroma;
|
Chris@23
|
80 float m_rollon;
|
matthiasm@3
|
81 // list< vector< float > > *logfreqSpecList;
|
matthiasm@0
|
82 };
|
matthiasm@0
|
83
|
matthiasm@0
|
84
|
matthiasm@0
|
85
|
matthiasm@0
|
86 #endif
|