Mercurial > hg > silvet
comparison src/Silvet.cpp @ 62:3e7e3c610fae
Test code
author | Chris Cannam |
---|---|
date | Mon, 28 Apr 2014 13:01:30 +0100 |
parents | d00a6f6c7fc9 |
children | 9c7e6086192d |
comparison
equal
deleted
inserted
replaced
61:3af587be9b8a | 62:3e7e3c610fae |
---|---|
574 --start; | 574 --start; |
575 } | 575 } |
576 ++start; | 576 ++start; |
577 | 577 |
578 int duration = width - start; | 578 int duration = width - start; |
579 cerr << "duration " << duration << " for just-ended note " << note << endl; | 579 // cerr << "duration " << duration << " for just-ended note " << note << endl; |
580 if (duration < durationThreshold) { | 580 if (duration < durationThreshold) { |
581 // spurious | 581 // spurious |
582 continue; | 582 continue; |
583 } | 583 } |
584 | 584 |
585 int velocity = maxStrength * 2; | 585 int velocity = maxStrength * 2; |
586 if (velocity > 127) velocity = 127; | 586 if (velocity > 127) velocity = 127; |
587 | |
588 cerr << "Found a genuine note, starting at " << columnDuration * start << " with duration " << columnDuration * duration << endl; | |
587 | 589 |
588 Feature nf; | 590 Feature nf; |
589 nf.hasTimestamp = true; | 591 nf.hasTimestamp = true; |
590 nf.timestamp = RealTime::fromSeconds(columnDuration * start); | 592 nf.timestamp = RealTime::fromSeconds(columnDuration * start); |
591 nf.hasDuration = true; | 593 nf.hasDuration = true; |
596 noteFeatures.push_back(nf); | 598 noteFeatures.push_back(nf); |
597 } | 599 } |
598 | 600 |
599 m_pianoRoll.push_back(active); | 601 m_pianoRoll.push_back(active); |
600 | 602 |
601 cerr << "returning " << noteFeatures.size() << " complete notes" << endl; | 603 // cerr << "returning " << noteFeatures.size() << " complete note(s) " << endl; |
602 | 604 |
603 return noteFeatures; | 605 return noteFeatures; |
604 } | 606 } |
605 | 607 |