Mercurial > hg > svapp
comparison audioio/AudioGenerator.cpp @ 314:817ad10f91d1 tonioni
Silence playback when nothing is going on
author | Chris Cannam |
---|---|
date | Wed, 08 Jan 2014 13:19:50 +0000 |
parents | 58582119c92a |
children | 65b75e23bbd5 |
comparison
equal
deleted
inserted
replaced
313:58582119c92a | 314:817ad10f91d1 |
---|---|
637 f0 = itr->value; | 637 f0 = itr->value; |
638 break; | 638 break; |
639 } | 639 } |
640 } | 640 } |
641 | 641 |
642 // if we found no such frequency and the next point is further | |
643 // away than twice the model resolution, go silent (same | |
644 // criterion TimeValueLayer uses for ending a discrete curve | |
645 // segment) | |
646 if (f0 == 0.f) { | |
647 SparseTimeValueModel::PointList nextPoints = | |
648 stvm->getNextPoints(reqStart + m_processingBlockSize); | |
649 if (nextPoints.empty() || | |
650 nextPoints.begin()->frame > reqStart + 2 * stvm->getResolution()) { | |
651 f0 = -1.f; | |
652 } | |
653 } | |
654 | |
642 cerr << "f0 = " << f0 << endl; | 655 cerr << "f0 = " << f0 << endl; |
643 | 656 |
644 synth->mix(bufferIndexes, | 657 synth->mix(bufferIndexes, |
645 gain, | 658 gain, |
646 pan, | 659 pan, |