Adjust includes for subrepo aubio
[vamp-aubio-plugins.git] / plugins / Notes.cpp
index 4c979ff..c8688cd 100644 (file)
@@ -37,7 +37,7 @@ Notes::Notes(float inputSampleRate) :
     m_silence(-70),
     m_minioi(4),
     m_median(6),
-    m_minpitch(27),
+    m_minpitch(32),
     m_maxpitch(95),
     m_wrapRange(false),
     m_avoidLeaps(false),
@@ -105,10 +105,21 @@ Notes::initialise(size_t channels, size_t stepSize, size_t blockSize)
     m_onset = new_fvec(1);
     m_pitch = new_fvec(1);
 
+    reset();
+
+    return true;
+}
+
+void
+Notes::reset()
+{
+    if (m_onsetdet) del_aubio_onset(m_onsetdet);
+    if (m_pitchdet) del_aubio_pitch(m_pitchdet);
+
     m_onsetdet = new_aubio_onset
         (const_cast<char *>(getAubioNameForOnsetType(m_onsettype)),
-         blockSize,
-         stepSize,
+         m_blockSize,
+         m_stepSize,
          lrintf(m_inputSampleRate));
     
     aubio_onset_set_threshold(m_onsetdet, m_threshold);
@@ -117,8 +128,8 @@ Notes::initialise(size_t channels, size_t stepSize, size_t blockSize)
 
     m_pitchdet = new_aubio_pitch
         (const_cast<char *>(getAubioNameForPitchType(m_pitchtype)),
-         blockSize,
-         stepSize,
+         m_blockSize,
+         m_stepSize,
          lrintf(m_inputSampleRate));
 
     aubio_pitch_set_unit(m_pitchdet, const_cast<char *>("freq"));
@@ -129,13 +140,6 @@ Notes::initialise(size_t channels, size_t stepSize, size_t blockSize)
     m_currentOnset = Vamp::RealTime::zeroTime;
     m_haveCurrent = false;
     m_prevPitch = -1;
-
-    return true;
-}
-
-void
-Notes::reset()
-{
 }
 
 size_t
@@ -193,7 +197,7 @@ Notes::getParameterDescriptors() const
     desc.name = "Minimum Pitch";
     desc.minValue = 0;
     desc.maxValue = 127;
-    desc.defaultValue = 27;
+    desc.defaultValue = 32;
     desc.unit = "MIDI units";
     desc.isQuantized = true;
     desc.quantizeStep = 1;