From: Paul Brossier Date: Sun, 26 Mar 2017 15:45:07 +0000 (+0200) Subject: src/onset/onset.h: rename logmag_compression to compression X-Git-Tag: 0.4.5~20^2~8 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=340f5c704fb8bd76e7585723df8e634067e9f892;p=aubio.git src/onset/onset.h: rename logmag_compression to compression --- diff --git a/src/onset/onset.c b/src/onset/onset.c index 867501c7..111ae296 100644 --- a/src/onset/onset.c +++ b/src/onset/onset.c @@ -128,7 +128,7 @@ smpl_t aubio_onset_get_awhitening (aubio_onset_t *o) return o->apply_awhitening; } -uint_t aubio_onset_set_logmag_compression (aubio_onset_t *o, smpl_t lambda) +uint_t aubio_onset_set_compression (aubio_onset_t *o, smpl_t lambda) { if (lambda < 0.) { return AUBIO_FAIL; @@ -138,7 +138,7 @@ uint_t aubio_onset_set_logmag_compression (aubio_onset_t *o, smpl_t lambda) return AUBIO_OK; } -smpl_t aubio_onset_get_logmag_compression (aubio_onset_t *o) +smpl_t aubio_onset_get_compression (aubio_onset_t *o) { return o->apply_compression ? o->lambda_compression : 0; } @@ -284,15 +284,13 @@ uint_t aubio_onset_set_default_parameters (aubio_onset_t * o, const char_t * ons // disable spectral whitening aubio_onset_set_awhitening (o, 0); // disable logarithmic magnitude - aubio_onset_set_logmag_compression (o, 0.); + aubio_onset_set_compression (o, 0.); /* method specific optimisations */ if (strcmp (onset_mode, "energy") == 0) { } else if (strcmp (onset_mode, "hfc") == 0 || strcmp (onset_mode, "default") == 0) { aubio_onset_set_threshold (o, 0.058); - o->apply_compression = 1; - o->lambda_compression = 1.; - aubio_onset_set_adaptive_whitening (o, 0); + aubio_onset_set_compression (o, 1.); } else if (strcmp (onset_mode, "complexdomain") == 0 || strcmp (onset_mode, "complex") == 0) { aubio_onset_set_delay (o, 4.6 * o->hop_size); diff --git a/src/onset/onset.h b/src/onset/onset.h index 4b056578..b115e6aa 100644 --- a/src/onset/onset.h +++ b/src/onset/onset.h @@ -139,16 +139,21 @@ smpl_t aubio_onset_get_awhitening(aubio_onset_t * o); /** set or disable log compression \param o onset detection object as returned by new_aubio_onset() - \param lambda logarithmic compression factor + \param lambda logarithmic compression factor, 0 to disable \return 0 if successful, 1 otherwise */ -uint_t aubio_onset_set_logmag_compression(aubio_onset_t *o, smpl_t lambda); +uint_t aubio_onset_set_compression(aubio_onset_t *o, smpl_t lambda); /** get onset detection log compression + + \param o onset detection object as returned by new_aubio_onset() + + \returns 0 if disabled, compression factor otherwise + */ -smpl_t aubio_onset_get_logmag_compression(aubio_onset_t *o); +smpl_t aubio_onset_get_compression(aubio_onset_t *o); /** set onset detection silence threshold