+void aubio_onset_default_parameters (aubio_onset_t * o, char_t * onset_mode)
+{
+ /* set some default parameter */
+ aubio_onset_set_threshold (o, 0.3);
+ aubio_onset_set_delay (o, 4.3 * o->hop_size);
+ aubio_onset_set_minioi_ms (o, 50.);
+ aubio_onset_set_silence (o, -70.);
+ aubio_onset_set_adaptive_whitening (o, 1);
+
+ /* method specific optimisations */
+ if (strcmp (onset_mode, "energy") == 0) {
+ } else if (strcmp (onset_mode, "hfc") == 0 || strcmp (onset_mode, "default") == 0) {
+ aubio_onset_set_adaptive_whitening (o, 0);
+ } else if (strcmp (onset_mode, "complexdomain") == 0
+ || strcmp (onset_mode, "complex") == 0) {
+ aubio_onset_set_delay (o, 4.6 * o->hop_size);
+ aubio_onset_set_threshold (o, 0.15);
+ } else if (strcmp (onset_mode, "phase") == 0) {
+ aubio_onset_set_adaptive_whitening (o, 0);
+ } else if (strcmp (onset_mode, "mkl") == 0) {
+ aubio_onset_set_threshold (o, 0.05);
+ } else if (strcmp (onset_mode, "kl") == 0) {
+ aubio_onset_set_threshold (o, 0.35);
+ } else if (strcmp (onset_mode, "specflux") == 0) {
+ aubio_onset_set_threshold (o, 0.4);
+ } else if (strcmp (onset_mode, "specdiff") == 0) {
+ } else {
+ AUBIO_ERR ("onset: unknown spectral descriptor type %s, "
+ "using default parameters.\n", onset_mode);
+ }
+}
+