Mercurial > hg > nnls-chroma
comparison NNLSBase.h @ 35:cf8898a0174c matthiasm-plugin
* Split out NNLSChroma plugin into three plugins (chroma, chordino, tuning) with a common base class.
There's still quite a lot of duplication between the getRemainingFeatures functions.
Also add copyright / copying headers, etc.
author | Chris Cannam |
---|---|
date | Fri, 22 Oct 2010 11:30:21 +0100 |
parents | NNLSChroma.h@93c836cfb8c5 |
children | d6bb9b43ac1c |
comparison
equal
deleted
inserted
replaced
34:8edcf48f4031 | 35:cf8898a0174c |
---|---|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ | |
2 | |
3 /* | |
4 NNLS-Chroma / Chordino | |
5 | |
6 Audio feature extraction plugins for chromagram and chord | |
7 estimation. | |
8 | |
9 Centre for Digital Music, Queen Mary University of London. | |
10 This file copyright 2008-2010 Matthias Mauch and QMUL. | |
11 | |
12 This program is free software; you can redistribute it and/or | |
13 modify it under the terms of the GNU General Public License as | |
14 published by the Free Software Foundation; either version 2 of the | |
15 License, or (at your option) any later version. See the file | |
16 COPYING included with this distribution for more information. | |
17 */ | |
18 | |
19 #ifndef _NNLS_BASE_ | |
20 #define _NNLS_BASE_ | |
21 | |
22 #include <vamp-sdk/Plugin.h> | |
23 #include <list> | |
24 | |
25 using namespace std; | |
26 | |
27 class NNLSBase : public Vamp::Plugin | |
28 { | |
29 public: | |
30 virtual ~NNLSBase(); | |
31 | |
32 string getMaker() const; | |
33 int getPluginVersion() const; | |
34 string getCopyright() const; | |
35 | |
36 InputDomain getInputDomain() const; | |
37 size_t getPreferredBlockSize() const; | |
38 size_t getPreferredStepSize() const; | |
39 size_t getMinChannelCount() const; | |
40 size_t getMaxChannelCount() const; | |
41 | |
42 ParameterList getParameterDescriptors() const; | |
43 float getParameter(string identifier) const; | |
44 void setParameter(string identifier, float value); | |
45 | |
46 ProgramList getPrograms() const; | |
47 string getCurrentProgram() const; | |
48 void selectProgram(string name); | |
49 | |
50 bool initialise(size_t channels, size_t stepSize, size_t blockSize); | |
51 void reset(); | |
52 | |
53 protected: | |
54 NNLSBase(float inputSampleRate); | |
55 void baseProcess(const float *const *inputBuffers, | |
56 Vamp::RealTime timestamp); | |
57 | |
58 int m_frameCount; | |
59 FeatureList m_logSpectrum; | |
60 size_t m_blockSize; | |
61 size_t m_stepSize; | |
62 int m_lengthOfNoteIndex; | |
63 float m_meanTuning0; | |
64 float m_meanTuning1; | |
65 float m_meanTuning2; | |
66 float m_localTuning0; | |
67 float m_localTuning1; | |
68 float m_localTuning2; | |
69 float m_paling; | |
70 float m_preset; | |
71 vector<float> m_localTuning; | |
72 vector<float> m_kernelValue; | |
73 vector<int> m_kernelFftIndex; | |
74 vector<int> m_kernelNoteIndex; | |
75 float *m_dict; | |
76 bool m_tuneLocal; | |
77 int m_dictID; | |
78 vector<float> m_chorddict; | |
79 vector<string> m_chordnames; | |
80 float m_doNormalizeChroma; | |
81 float m_rollon; | |
82 }; | |
83 | |
84 | |
85 | |
86 #endif |