comparison plugins/OnsetDetect.cpp @ 239:855c91bfc912

Further style fixes
author Chris Cannam <cannam@all-day-breakfast.com>
date Wed, 05 Jun 2019 11:23:04 +0100
parents 38502a1595ff
children
comparison
equal deleted inserted replaced
238:6406e46c2f53 239:855c91bfc912
440 ppParams.QuadThresh.c = (100 - m_sensitivity) / 1500.0; 440 ppParams.QuadThresh.c = (100 - m_sensitivity) / 1500.0;
441 441
442 PeakPicking peakPicker(ppParams); 442 PeakPicking peakPicker(ppParams);
443 443
444 double *ppSrc = new double[ppParams.length]; 444 double *ppSrc = new double[ppParams.length];
445 for (unsigned int i = 0; i < ppParams.length; ++i) { 445 for (int i = 0; i < ppParams.length; ++i) {
446 ppSrc[i] = m_d->dfOutput[i]; 446 ppSrc[i] = m_d->dfOutput[i];
447 } 447 }
448 448
449 vector<int> onsets; 449 vector<int> onsets;
450 peakPicker.process(ppSrc, ppParams.length, onsets); 450 peakPicker.process(ppSrc, ppParams.length, onsets);
471 (frame, lrintf(m_inputSampleRate)); 471 (frame, lrintf(m_inputSampleRate));
472 472
473 returnFeatures[0].push_back(feature); // onsets are output 0 473 returnFeatures[0].push_back(feature); // onsets are output 0
474 } 474 }
475 475
476 for (unsigned int i = 0; i < ppParams.length; ++i) { 476 for (int i = 0; i < ppParams.length; ++i) {
477 477
478 Feature feature; 478 Feature feature;
479 // feature.hasTimestamp = false; 479
480 feature.hasTimestamp = true; 480 feature.hasTimestamp = true;
481 size_t frame = i * m_d->dfConfig.stepSize; 481 size_t frame = i * m_d->dfConfig.stepSize;
482 feature.timestamp = m_d->origin + Vamp::RealTime::frame2RealTime 482 feature.timestamp = m_d->origin + Vamp::RealTime::frame2RealTime
483 (frame, lrintf(m_inputSampleRate)); 483 (frame, lrintf(m_inputSampleRate));
484 484