Mercurial > hg > qm-dsp
comparison dsp/tempotracking/TempoTrackV2.cpp @ 57:d241e7701c0c
* remove some debug output
author | cannam |
---|---|
date | Fri, 27 Feb 2009 13:07:22 +0000 |
parents | a0f987c06bec |
children | c3cdb404f807 |
comparison
equal
deleted
inserted
replaced
56:a0f987c06bec | 57:d241e7701c0c |
---|---|
327 for (uint j=0; j<step; j++) | 327 for (uint j=0; j<step; j++) |
328 { | 328 { |
329 lastind = i*step+j; | 329 lastind = i*step+j; |
330 beat_period[lastind] = bestpath[i]; | 330 beat_period[lastind] = bestpath[i]; |
331 } | 331 } |
332 std::cerr << "bestpath[" << i << "] = " << bestpath[i] << " (used for beat_periods " << i*step << " to " << i*step+step-1 << ")" << std::endl; | 332 // std::cerr << "bestpath[" << i << "] = " << bestpath[i] << " (used for beat_periods " << i*step << " to " << i*step+step-1 << ")" << std::endl; |
333 } | 333 } |
334 | 334 |
335 //fill in the last values... | 335 //fill in the last values... |
336 for (uint i=lastind; i<beat_period.size(); i++) | 336 for (uint i=lastind; i<beat_period.size(); i++) |
337 { | 337 { |
440 int xx = get_max_ind(scorecands); | 440 int xx = get_max_ind(scorecands); |
441 | 441 |
442 cumscore[i] = alpha*vv + (1.-alpha)*localscore[i]; | 442 cumscore[i] = alpha*vv + (1.-alpha)*localscore[i]; |
443 backlink[i] = i+prange_min+xx; | 443 backlink[i] = i+prange_min+xx; |
444 | 444 |
445 std::cerr << "backlink[" << i << "] <= " << backlink[i] << std::endl; | 445 // std::cerr << "backlink[" << i << "] <= " << backlink[i] << std::endl; |
446 } | 446 } |
447 | 447 |
448 // STARTING POINT, I.E. LAST BEAT.. PICK A STRONG POINT IN cumscore VECTOR | 448 // STARTING POINT, I.E. LAST BEAT.. PICK A STRONG POINT IN cumscore VECTOR |
449 d_vec_t tmp_vec; | 449 d_vec_t tmp_vec; |
450 for (uint i=cumscore.size() - beat_period[beat_period.size()-1] ; i<cumscore.size(); i++) | 450 for (uint i=cumscore.size() - beat_period[beat_period.size()-1] ; i<cumscore.size(); i++) |
459 | 459 |
460 // USE BACKLINK TO GET EACH NEW BEAT (TOWARDS THE BEGINNING OF THE FILE) | 460 // USE BACKLINK TO GET EACH NEW BEAT (TOWARDS THE BEGINNING OF THE FILE) |
461 // BACKTRACKING FROM THE END TO THE BEGINNING.. MAKING SURE NOT TO GO BEFORE SAMPLE 0 | 461 // BACKTRACKING FROM THE END TO THE BEGINNING.. MAKING SURE NOT TO GO BEFORE SAMPLE 0 |
462 i_vec_t ibeats; | 462 i_vec_t ibeats; |
463 ibeats.push_back(startpoint); | 463 ibeats.push_back(startpoint); |
464 std::cerr << "startpoint = " << startpoint << std::endl; | 464 // std::cerr << "startpoint = " << startpoint << std::endl; |
465 while (backlink[ibeats.back()] > 0) | 465 while (backlink[ibeats.back()] > 0) |
466 { | 466 { |
467 std::cerr << "backlink[" << ibeats.back() << "] = " << backlink[ibeats.back()] << std::endl; | 467 // std::cerr << "backlink[" << ibeats.back() << "] = " << backlink[ibeats.back()] << std::endl; |
468 int b = ibeats.back(); | 468 int b = ibeats.back(); |
469 if (backlink[b] == b) break; // shouldn't happen... haha | 469 if (backlink[b] == b) break; // shouldn't happen... haha |
470 ibeats.push_back(backlink[b]); | 470 ibeats.push_back(backlink[b]); |
471 } | 471 } |
472 | 472 |