comparison Chordino.cpp @ 76:d398e73b46e0 matthiasm-plugin

it's broken at the moment, work in progress (makeing bins per semitone variable, ie not necessarily 3)
author Matthias Mauch <mail@matthiasmauch.net>
date Wed, 10 Nov 2010 22:52:46 +0900
parents 9a1f83057e84
children ba930176df5b
comparison
equal deleted inserted replaced
75:ec5b599fbabc 76:d398e73b46e0
26 #include <cmath> 26 #include <cmath>
27 27
28 #include <algorithm> 28 #include <algorithm>
29 29
30 const bool debug_on = false; 30 const bool debug_on = false;
31
32 const vector<float> hw(hammingwind, hammingwind+19);
33 31
34 Chordino::Chordino(float inputSampleRate) : 32 Chordino::Chordino(float inputSampleRate) :
35 NNLSBase(inputSampleRate) 33 NNLSBase(inputSampleRate)
36 { 34 {
37 if (debug_on) cerr << "--> Chordino" << endl; 35 if (debug_on) cerr << "--> Chordino" << endl;
97 d0.identifier = "rollon"; 95 d0.identifier = "rollon";
98 d0.name = "spectral roll-on"; 96 d0.name = "spectral roll-on";
99 d0.description = "Consider the cumulative energy spectrum (from low to high frequencies). All bins below the first bin whose cumulative energy exceeds the quantile [spectral roll on] x [total energy] will be set to 0. A value of 0 means that no bins will be changed."; 97 d0.description = "Consider the cumulative energy spectrum (from low to high frequencies). All bins below the first bin whose cumulative energy exceeds the quantile [spectral roll on] x [total energy] will be set to 0. A value of 0 means that no bins will be changed.";
100 d0.unit = "%"; 98 d0.unit = "%";
101 d0.minValue = 0; 99 d0.minValue = 0;
102 d0.maxValue = 0.05; 100 d0.maxValue = 5;
103 d0.defaultValue = 0; 101 d0.defaultValue = 0;
104 d0.isQuantized = true; 102 d0.isQuantized = true;
105 d0.quantizeStep = 0.005; 103 d0.quantizeStep = 0.5;
106 list.push_back(d0); 104 list.push_back(d0);
107 105
108 ParameterDescriptor d1; 106 ParameterDescriptor d1;
109 d1.identifier = "tuningmode"; 107 d1.identifier = "tuningmode";
110 d1.name = "tuning mode"; 108 d1.name = "tuning mode";
208 Chordino::initialise(size_t channels, size_t stepSize, size_t blockSize) 206 Chordino::initialise(size_t channels, size_t stepSize, size_t blockSize)
209 { 207 {
210 if (debug_on) { 208 if (debug_on) {
211 cerr << "--> initialise"; 209 cerr << "--> initialise";
212 } 210 }
213 211
214 if (!NNLSBase::initialise(channels, stepSize, blockSize)) { 212 if (!NNLSBase::initialise(channels, stepSize, blockSize)) {
215 return false; 213 return false;
216 } 214 }
217 215
218 return true; 216 return true;
236 } 234 }
237 235
238 Chordino::FeatureSet 236 Chordino::FeatureSet
239 Chordino::getRemainingFeatures() 237 Chordino::getRemainingFeatures()
240 { 238 {
239 cerr << hw[0] << hw[1] << endl;
241 if (debug_on) cerr << "--> getRemainingFeatures" << endl; 240 if (debug_on) cerr << "--> getRemainingFeatures" << endl;
242 FeatureSet fsOut; 241 FeatureSet fsOut;
243 if (m_logSpectrum.size() == 0) return fsOut; 242 if (m_logSpectrum.size() == 0) return fsOut;
244 int nChord = m_chordnames.size(); 243 int nChord = m_chordnames.size();
245 // 244 //