comparison Chordino.cpp @ 124:a17ff20fb897 darwintunes

made darwintunes branch
author Matthias Mauch <mail@matthiasmauch.net>
date Sat, 11 Jun 2011 17:41:23 +0100
parents 21181297da99
children a5ee5fe71e52
comparison
equal deleted inserted replaced
123:b115fa66c695 124:a17ff20fb897
218 d8.description = "An indication of the likelihood of harmonic change. Depends on the chord dictionary. Calculation is different depending on whether the Viterbi algorithm is used for chord estimation, or the simple chord estimate."; 218 d8.description = "An indication of the likelihood of harmonic change. Depends on the chord dictionary. Calculation is different depending on whether the Viterbi algorithm is used for chord estimation, or the simple chord estimate.";
219 d8.unit = ""; 219 d8.unit = "";
220 d8.hasFixedBinCount = true; 220 d8.hasFixedBinCount = true;
221 d8.binCount = 1; 221 d8.binCount = 1;
222 d8.hasKnownExtents = false; 222 d8.hasKnownExtents = false;
223 // d8.minValue = 0.0;
224 // d8.maxValue = 0.999;
225 d8.isQuantized = false; 223 d8.isQuantized = false;
226 d8.sampleType = OutputDescriptor::FixedSampleRate; 224 d8.sampleType = OutputDescriptor::FixedSampleRate;
227 d8.hasDuration = false; 225 d8.hasDuration = false;
228 // d8.sampleRate = (m_stepSize == 0) ? m_inputSampleRate/2048 : m_inputSampleRate/m_stepSize;
229 list.push_back(d8); 226 list.push_back(d8);
230 m_outputHarmonicChange = index++; 227 m_outputHarmonicChange = index++;
231 228
232 OutputDescriptor loglikelihood; 229 OutputDescriptor loglikelihood;
233 loglikelihood.identifier = "loglikelihood"; 230 loglikelihood.identifier = "loglikelihood";
234 loglikelihood.name = "chord estimate log-likelihood"; 231 loglikelihood.name = "Simple Chord Log-likelihood";
235 loglikelihood.description = "."; 232 loglikelihood.description = "Logarithm of the likelihood value of the simple chord estimate.";
236 loglikelihood.unit = ""; 233 loglikelihood.unit = "";
237 loglikelihood.hasFixedBinCount = true; 234 loglikelihood.hasFixedBinCount = true;
238 loglikelihood.binCount = 1; 235 loglikelihood.binCount = 1;
239 loglikelihood.hasKnownExtents = false; 236 loglikelihood.hasKnownExtents = false;
240 loglikelihood.isQuantized = false; 237 loglikelihood.isQuantized = false;
241 loglikelihood.sampleType = OutputDescriptor::FixedSampleRate; 238 loglikelihood.sampleType = OutputDescriptor::FixedSampleRate;
242 loglikelihood.hasDuration = false; 239 loglikelihood.hasDuration = false;
243 // loglikelihood.sampleRate = (m_stepSize == 0) ? m_inputSampleRate/2048 : m_inputSampleRate/m_stepSize;
244 list.push_back(loglikelihood); 240 list.push_back(loglikelihood);
245 m_outputLoglikelihood = index++; 241 m_outputLoglikelihood = index++;
246 242
247 return list; 243 return list;
248 } 244 }
492 for (int i = 0; i < (int)chroma.size(); i++) { 488 for (int i = 0; i < (int)chroma.size(); i++) {
493 currentChromas.values[i] /= chromanorm[2]; 489 currentChromas.values[i] /= chromanorm[2];
494 } 490 }
495 } 491 }
496 } 492 }
497
498 if (*max_element(origchroma.begin(), origchroma.end()) == 0) {
499 for (int i = 0; i < (int)chroma.size(); i++) {
500 chroma[i] = 1;
501 }
502 }
503 493
504 chromaList.push_back(currentChromas); 494 chromaList.push_back(currentChromas);
505 495
506 // local chord estimation 496 // local chord estimation
507 vector<double> currentChordSalience; 497 vector<double> currentChordSalience;