comparison Chordino.cpp @ 89:7af5312e66f8 matthiasm-plugin

new boost N parameter in chordino, chord dictionary loaded on initialisation (not construction) of plugin
author Matthias Mauch <mail@matthiasmauch.net>
date Wed, 01 Dec 2010 23:08:55 +0900
parents e5c16976513d
children b56dde3417d4
comparison
equal deleted inserted replaced
88:fc28c50caace 89:7af5312e66f8
35 m_chordnotes(0), 35 m_chordnotes(0),
36 m_chordnames(0) 36 m_chordnames(0)
37 { 37 {
38 if (debug_on) cerr << "--> Chordino" << endl; 38 if (debug_on) cerr << "--> Chordino" << endl;
39 // get the *chord* dictionary from file (if the file exists) 39 // get the *chord* dictionary from file (if the file exists)
40 m_chordnames = chordDictionary(&m_chorddict, &m_chordnotes);
41 40
42 } 41 }
43 42
44 Chordino::~Chordino() 43 Chordino::~Chordino()
45 { 44 {
144 d3.maxValue = 0.9; 143 d3.maxValue = 0.9;
145 d3.defaultValue = 0.7; 144 d3.defaultValue = 0.7;
146 d3.isQuantized = false; 145 d3.isQuantized = false;
147 list.push_back(d3); 146 list.push_back(d3);
148 147
149 // ParameterDescriptor d4; 148 ParameterDescriptor boostn;
150 // d4.identifier = "chromanormalize"; 149 boostn.identifier = "boostn";
151 // d4.name = "chroma normalization"; 150 boostn.name = "boost N";
152 // d4.description = "How shall the chroma vector be normalized?"; 151 boostn.description = "Relative weight of the N label.";
153 // d4.unit = ""; 152 boostn.unit = "";
154 // d4.minValue = 0; 153 boostn.minValue = 1.0;
155 // d4.maxValue = 3; 154 boostn.maxValue = 2.0;
156 // d4.defaultValue = 0; 155 boostn.defaultValue = 1.0;
157 // d4.isQuantized = true; 156 boostn.isQuantized = false;
158 // d4.valueNames.push_back("none"); 157 list.push_back(boostn);
159 // d4.valueNames.push_back("maximum norm");
160 // d4.valueNames.push_back("L1 norm");
161 // d4.valueNames.push_back("L2 norm");
162 // d4.quantizeStep = 1.0;
163 // list.push_back(d4);
164 158
165 return list; 159 return list;
166 } 160 }
167 161
168 Chordino::OutputList 162 Chordino::OutputList
234 } 228 }
235 229
236 if (!NNLSBase::initialise(channels, stepSize, blockSize)) { 230 if (!NNLSBase::initialise(channels, stepSize, blockSize)) {
237 return false; 231 return false;
238 } 232 }
239 233 m_chordnames = chordDictionary(&m_chorddict, &m_chordnotes, m_boostN);
240 return true; 234 return true;
241 } 235 }
242 236
243 void 237 void
244 Chordino::reset() 238 Chordino::reset()
258 } 252 }
259 253
260 Chordino::FeatureSet 254 Chordino::FeatureSet
261 Chordino::getRemainingFeatures() 255 Chordino::getRemainingFeatures()
262 { 256 {
263 cerr << hw[0] << hw[1] << endl; 257 // cerr << hw[0] << hw[1] << endl;
264 if (debug_on) cerr << "--> getRemainingFeatures" << endl; 258 if (debug_on) cerr << "--> getRemainingFeatures" << endl;
265 FeatureSet fsOut; 259 FeatureSet fsOut;
266 if (m_logSpectrum.size() == 0) return fsOut; 260 if (m_logSpectrum.size() == 0) return fsOut;
267 int nChord = m_chordnames.size(); 261 int nChord = m_chordnames.size();
268 // 262 //
269 /** Calculate Tuning 263 /** Calculate Tuning