From cd77c150fae93e50164a354587589c231b3f4ddc Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Thu, 15 Oct 2009 18:49:47 +0200 Subject: [PATCH] src/onset/onsetdetection.c: add 'default' method, set it to hfc, set method to default when parsing the string fails --- src/onset/onsetdetection.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/onset/onsetdetection.c b/src/onset/onsetdetection.c index d15e7e26..f88a24f6 100644 --- a/src/onset/onsetdetection.c +++ b/src/onset/onsetdetection.c @@ -133,6 +133,7 @@ typedef enum { aubio_onset_kl, /**< Kullback Liebler */ aubio_onset_mkl, /**< modified Kullback Liebler */ aubio_onset_specflux, /**< spectral flux */ + aubio_onset_default = aubio_onset_hfc, /**< default mode, set to hfc */ } aubio_onsetdetection_type; /** structure to store object state */ @@ -339,9 +340,11 @@ new_aubio_onsetdetection (char_t * onset_mode, onset_type = aubio_onset_kl; else if (strcmp (onset_mode, "specflux") == 0) onset_type = aubio_onset_specflux; + else if (strcmp (onset_mode, "default") == 0) + onset_type = aubio_onset_default; else { AUBIO_ERR("unknown onset type.\n"); - return NULL; + onset_type = aubio_onset_default; } switch(onset_type) { /* for both energy and hfc, only fftgrain->norm is required */ -- 2.26.2