plugins/Onset.cpp: add default mode
authorPaul Brossier <piem@piem.org>
Fri, 22 Jul 2016 13:41:19 +0000 (15:41 +0200)
committerPaul Brossier <piem@piem.org>
Fri, 22 Jul 2016 13:41:19 +0000 (15:41 +0200)
plugins/Onset.cpp
plugins/Types.cpp
plugins/Types.h

index cb93366..db747b1 100644 (file)
@@ -36,7 +36,7 @@ Onset::Onset(float inputSampleRate) :
     m_ibuf(0),
     m_onset(0),
     m_onsetdet(0),
-    m_onsettype(OnsetComplex),
+    m_onsettype(OnsetDefault),
     m_threshold(0.3),
     m_silence(-70),
     m_minioi(4)
@@ -149,7 +149,7 @@ Onset::getParameterDescriptors() const
     desc.description = "Type of onset detection function to use";
     desc.minValue = 0;
     desc.maxValue = 7;
-    desc.defaultValue = (int)OnsetComplex;
+    desc.defaultValue = (int)OnsetDefault;
     desc.isQuantized = true;
     desc.quantizeStep = 1;
     desc.valueNames.push_back("Energy Based");
@@ -160,6 +160,7 @@ Onset::getParameterDescriptors() const
     desc.valueNames.push_back("Kullback-Liebler");
     desc.valueNames.push_back("Modified Kullback-Liebler");
     desc.valueNames.push_back("Spectral Flux");
+    desc.valueNames.push_back("Default");
     list.push_back(desc);
 
     desc = ParameterDescriptor();
index 1af71f9..13bddf6 100644 (file)
@@ -29,7 +29,7 @@ const char *getAubioNameForOnsetType(OnsetType t)
 {
     // In the same order as the enum elements in the header
     static const char *const names[] = {
-        "energy", "specdiff", "hfc", "complex", "phase", "kl", "mkl", "specflux"
+        "energy", "specdiff", "hfc", "complex", "phase", "kl", "mkl", "specflux", "default"
     };
     return names[(int)t];
 }
index ed04bb0..4fcd6fe 100644 (file)
@@ -5,7 +5,7 @@
 
     Centre for Digital Music, Queen Mary, University of London.
     This file copyright 2012 Queen Mary, University of London.
-    
+
     This file is part of vamp-aubio-plugins.
 
     vamp-aubio is free software: you can redistribute it and/or modify
@@ -47,7 +47,8 @@ enum OnsetType {
     OnsetPhase,
     OnsetKL,
     OnsetMKL,
-    OnsetSpecFlux // new in 0.4!
+    OnsetSpecFlux, // new in 0.4!
+    OnsetDefault   // new in 0.5
 };
 
 extern const char *getAubioNameForOnsetType(OnsetType t);
@@ -74,8 +75,6 @@ enum PitchType {
 };
 
 extern const char *getAubioNameForPitchType(PitchType t);
-    
 
 #endif
 
-