comparison audio/AudioGenerator.cpp @ 650:ed9cb577eb7c single-point

Use matching-event search in tone generator
author Chris Cannam
date Wed, 20 Mar 2019 11:19:44 +0000
parents 284cb118368e
children 161063152ddd
comparison
equal deleted inserted replaced
649:284cb118368e 650:ed9cb577eb7c
725 725
726 // if there is no such frequency and the next point is further 726 // if there is no such frequency and the next point is further
727 // away than twice the model resolution, go silent (same 727 // away than twice the model resolution, go silent (same
728 // criterion TimeValueLayer uses for ending a discrete curve 728 // criterion TimeValueLayer uses for ending a discrete curve
729 // segment) 729 // segment)
730 /*!!! todo: restore
731 if (f0 == 0.f) { 730 if (f0 == 0.f) {
732 EventVector nextPoints = 731 Event nextP;
733 stvm->getNextPoints(reqStart + m_processingBlockSize); 732 if (!stvm->getNearestEventMatching(reqStart + m_processingBlockSize,
734 if (nextPoints.empty() || 733 [](Event) { return true; },
735 nextPoints.begin()->frame > reqStart + 2 * stvm->getResolution()) { 734 EventSeries::Forward,
735 nextP) ||
736 nextP.getFrame() > reqStart + 2 * stvm->getResolution()) {
736 f0 = -1.f; 737 f0 = -1.f;
737 } 738 }
738 } 739 }
739 */ 740
740 // cerr << "f0 = " << f0 << endl; 741 // cerr << "f0 = " << f0 << endl;
741 742
742 synth->mix(bufferIndexes, 743 synth->mix(bufferIndexes,
743 gain, 744 gain,
744 pan, 745 pan,