13
0

fix aubio-onset detection parameters

This commit is contained in:
Robin Gareus 2016-05-01 18:47:14 +02:00
parent 5f65964ee9
commit 9d50074a99
3 changed files with 17 additions and 0 deletions

View File

@ -37,6 +37,7 @@ public:
void set_silence_threshold (float);
void set_peak_threshold (float);
void set_minioi (float);
void set_function (int);
int run (const std::string& path, Readable*, uint32_t channel, AnalysisFeatureList& results);

View File

@ -92,6 +92,16 @@ OnsetDetector::set_peak_threshold (float val)
}
}
void
OnsetDetector::set_minioi (float val)
{
#ifdef HAVE_AUBIO4
if (plugin) {
plugin->setParameter ("minioi", val);
}
#endif
}
void
OnsetDetector::set_function (int val)
{

View File

@ -166,6 +166,12 @@ Onset::reset()
lrintf(m_inputSampleRate));
m_lastOnset = Vamp::RealTime::zeroTime - m_delay - m_delay;
#else
if (m_onsetdet) aubio_onsetdetection_free(m_onsetdet);
if (m_peakpick) del_aubio_peakpicker(m_peakpick);
m_peakpick = new_aubio_peakpicker(m_threshold);
m_onsetdet = new_aubio_onsetdetection(m_onsettype, m_blockSize, m_channelCount);
#endif
}