projects
/
vamp-aubio-plugins.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implement reset functions (fixes #498)
[vamp-aubio-plugins.git]
/
plugins
/
Tempo.cpp
diff --git
a/plugins/Tempo.cpp
b/plugins/Tempo.cpp
index
82c38f8
..
ac106c3
100644
(file)
--- a/
plugins/Tempo.cpp
+++ b/
plugins/Tempo.cpp
@@
-94,23
+94,26
@@
Tempo::initialise(size_t channels, size_t stepSize, size_t blockSize)
m_delay = Vamp::RealTime::frame2RealTime(3 * stepSize,
lrintf(m_inputSampleRate));
m_delay = Vamp::RealTime::frame2RealTime(3 * stepSize,
lrintf(m_inputSampleRate));
+ reset();
+
+ return true;
+}
+
+void
+Tempo::reset()
+{
+ if (m_tempo) del_aubio_tempo(m_tempo);
+
m_lastBeat = Vamp::RealTime::zeroTime - m_delay - m_delay;
m_tempo = new_aubio_tempo
(const_cast<char *>(getAubioNameForOnsetType(m_onsettype)),
m_lastBeat = Vamp::RealTime::zeroTime - m_delay - m_delay;
m_tempo = new_aubio_tempo
(const_cast<char *>(getAubioNameForOnsetType(m_onsettype)),
- blockSize,
- stepSize,
+
m_
blockSize,
+
m_
stepSize,
lrintf(m_inputSampleRate));
aubio_tempo_set_silence(m_tempo, m_silence);
aubio_tempo_set_threshold(m_tempo, m_threshold);
lrintf(m_inputSampleRate));
aubio_tempo_set_silence(m_tempo, m_silence);
aubio_tempo_set_threshold(m_tempo, m_threshold);
-
- return true;
-}
-
-void
-Tempo::reset()
-{
}
size_t
}
size_t