Mercurial > hg > nnls-chroma
changeset 163:59b26f52550d
Make some more debug output dependent on debug_on
author | Chris Cannam |
---|---|
date | Fri, 04 Sep 2015 12:22:09 +0100 |
parents | c585c95f2d86 |
children | 3c731acad404 |
files | Chordino.cpp NNLSChroma.cpp chromamethods.cpp |
diffstat | 3 files changed, 18 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/Chordino.cpp Tue Jan 27 09:47:37 2015 +0000 +++ b/Chordino.cpp Fri Sep 04 12:22:09 2015 +0100 @@ -295,7 +295,7 @@ calculate a tuned log-frequency spectrogram (currentTunedSpec): use the tuning estimated above (kinda f0) to perform linear interpolation on the existing log-frequency spectrogram (kinda currentLogSpectrum). **/ - cerr << endl << "[Chordino Plugin] Tuning Log-Frequency Spectrogram ... "; + if (debug_on) cerr << endl << "[Chordino Plugin] Tuning Log-Frequency Spectrogram ... "; int count = 0; @@ -346,7 +346,7 @@ tunedSpec.push_back(currentTunedSpec); count++; } - cerr << "done." << endl; + if (debug_on) cerr << "done." << endl; /** Semitone spectrum and chromagrams Semitone-spaced log-frequency spectrum derived from the tuned log-freq spectrum above. the spectrum @@ -355,9 +355,9 @@ bass and treble stacked onto each other). **/ if (m_useNNLS == 0) { - cerr << "[Chordino Plugin] Mapping to semitone spectrum and chroma ... "; + if (debug_on) cerr << "[Chordino Plugin] Mapping to semitone spectrum and chroma ... "; } else { - cerr << "[Chordino Plugin] Performing NNLS and mapping to chroma ... "; + if (debug_on) cerr << "[Chordino Plugin] Performing NNLS and mapping to chroma ... "; } @@ -511,11 +511,11 @@ count++; } - cerr << "done." << endl; + if (debug_on) cerr << "done." << endl; vector<Feature> oldnotes; - cerr << "[Chordino Plugin] HMM Chord Estimation ... "; + if (debug_on) cerr << "[Chordino Plugin] HMM Chord Estimation ... "; int oldchord = nChord-1; double selftransprob = 0.99; @@ -594,7 +594,7 @@ fsOut[m_outputChordnotes].push_back(oldnotes[iNote]); } - cerr << "done." << endl; + if (debug_on) cerr << "done." << endl; for (int iFrame = 0; iFrame < nFrame; iFrame++) { Feature chordchange_feature;
--- a/NNLSChroma.cpp Tue Jan 27 09:47:37 2015 +0000 +++ b/NNLSChroma.cpp Fri Sep 04 12:22:09 2015 +0100 @@ -244,7 +244,7 @@ calculate a tuned log-frequency spectrogram (f2): use the tuning estimated above (kinda f0) to perform linear interpolation on the existing log-frequency spectrogram (kinda f1). **/ - cerr << endl << "[NNLS Chroma Plugin] Tuning Log-Frequency Spectrogram ... "; + if (debug_on) cerr << endl << "[NNLS Chroma Plugin] Tuning Log-Frequency Spectrogram ... "; float tempValue = 0; @@ -294,7 +294,7 @@ fsOut[m_outputTunedlogfreqspec].push_back(f2); count++; } - cerr << "done." << endl; + if (debug_on) cerr << "done." << endl; /** Semitone spectrum and chromagrams Semitone-spaced log-frequency spectrum derived from the tuned log-freq spectrum above. the spectrum @@ -303,9 +303,9 @@ bass and treble stacked onto each other). **/ if (m_useNNLS == 0) { - cerr << "[NNLS Chroma Plugin] Mapping to semitone spectrum and chroma ... "; + if (debug_on) cerr << "[NNLS Chroma Plugin] Mapping to semitone spectrum and chroma ... "; } else { - cerr << "[NNLS Chroma Plugin] Performing NNLS and mapping to chroma ... "; + if (debug_on) cerr << "[NNLS Chroma Plugin] Performing NNLS and mapping to chroma ... "; } @@ -471,7 +471,7 @@ fsOut[m_outputBothchroma].push_back(f6); count++; } - cerr << "done." << endl; + if (debug_on) cerr << "done." << endl; return fsOut;
--- a/chromamethods.cpp Tue Jan 27 09:47:37 2015 +0000 +++ b/chromamethods.cpp Fri Sep 04 12:22:09 2015 +0100 @@ -373,18 +373,19 @@ int ppathsize = static_cast<int>(ppath.size()); for (int i = 0; i < ppathsize; ++i) { chordDictFilename = ppath[i] + "/" + chordDictBase; - cerr << "Looking for chord.dict in " << chordDictFilename << "..." ; +// cerr << "Looking for chord.dict in " << chordDictFilename << "..." ; fstream fin; fin.open(chordDictFilename.c_str(),ios::in); if( fin.is_open() ) { fin.close(); - cerr << " success." << endl; +// cerr << " success." << endl; break; } else { - if (i+1 < ppathsize) cerr << " (not found yet) ..." << endl; - else { - cerr << "* WARNING: failed to find chord dictionary, using default chord dictionary." << endl; + if (i+1 < ppathsize) { +// cerr << " (not found yet) ..." << endl; + } else { +// cerr << "* WARNING: failed to find chord dictionary, using default chord dictionary." << endl; hasExternalDictinoary = false; } }