From fe5929dd9ec43c57d09eb3ec00e6f43f060ac996 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 22 Jul 2016 15:41:19 +0200 Subject: [PATCH 1/1] plugins/Onset.cpp: add default mode --- plugins/Onset.cpp | 5 +++-- plugins/Types.cpp | 2 +- plugins/Types.h | 7 +++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/Onset.cpp b/plugins/Onset.cpp index cb93366..db747b1 100644 --- a/plugins/Onset.cpp +++ b/plugins/Onset.cpp @@ -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(); diff --git a/plugins/Types.cpp b/plugins/Types.cpp index 1af71f9..13bddf6 100644 --- a/plugins/Types.cpp +++ b/plugins/Types.cpp @@ -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]; } diff --git a/plugins/Types.h b/plugins/Types.h index ed04bb0..4fcd6fe 100644 --- a/plugins/Types.h +++ b/plugins/Types.h @@ -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 - -- 2.11.0