Mercurial > hg > silvet
diff src/Silvet.cpp @ 183:59e3cca75b8d
Add some further parameters to the instrument pack
author | Chris Cannam |
---|---|
date | Fri, 23 May 2014 18:17:59 +0100 |
parents | 825193ef09d2 |
children | 78212f764251 ec19a15bee82 |
line wrap: on
line diff
--- a/src/Silvet.cpp Thu May 22 15:06:37 2014 +0100 +++ b/src/Silvet.cpp Fri May 23 18:17:59 2014 +0100 @@ -480,6 +480,8 @@ EM em(&pack, m_hqMode); + em.setPitchSparsity(pack.pitchSparsity); + for (int j = 0; j < iterations; ++j) { em.iterate(filtered.at(i).data()); } @@ -633,19 +635,13 @@ // Threshold for level and reduce number of candidate pitches - int polyphony = 5; - - //!!! make this a parameter (was 4.8, try adjusting, compare levels against matlab code) - double threshold = 6; -// double threshold = 4.8; - typedef std::multimap<double, int> ValueIndexMap; ValueIndexMap strengths; for (int j = 0; j < pack.templateNoteCount; ++j) { double strength = filtered[j]; - if (strength < threshold) continue; + if (strength < pack.levelThreshold) continue; strengths.insert(ValueIndexMap::value_type(strength, j)); } @@ -654,7 +650,7 @@ map<int, double> active; map<int, int> activeShifts; - while (int(active.size()) < polyphony && si != strengths.begin()) { + while (int(active.size()) < pack.maxPolyphony && si != strengths.begin()) { --si;