m_pitchmode);
m_count = 0;
+ m_delay = Vamp::RealTime::frame2RealTime((4 + m_median) * m_stepSize,
+ lrintf(m_inputSampleRate));
m_currentOnset = Vamp::RealTime::zeroTime;
m_haveCurrent = false;
Feature feature;
feature.hasTimestamp = true;
- feature.timestamp = m_currentOnset -
- Vamp::RealTime::frame2RealTime((4 + m_median) * m_stepSize,
- m_inputSampleRate);
+ if (m_currentOnset < m_delay) m_currentOnset = m_delay;
+ feature.timestamp = m_currentOnset - m_delay;
feature.values.push_back(median);
// feature.values.push_back(FLOOR(aubio_freqtomidi(median) + 0.5));
feature.values.push_back
size_t m_channelCount;
std::deque<float> m_notebuf;
size_t m_count;
+ Vamp::RealTime m_delay;
Vamp::RealTime m_currentOnset;
Vamp::RealTime m_lastTimeStamp;
float m_currentLevel;
if (timestamp - m_lastOnset >= m_delay) {
Feature onsettime;
onsettime.hasTimestamp = true;
+ if (timestamp < m_delay) timestamp = m_delay;
onsettime.timestamp = timestamp - m_delay;
returnFeatures[0].push_back(onsettime);
m_lastOnset = timestamp;