Changes in / [67b6618:155cc10]
- Location:
- src
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/aubio.h
r67b6618 r155cc10 188 188 #include "spectral/mfcc.h" 189 189 #include "spectral/specdesc.h" 190 #include "spectral/awhitening.h" 190 191 #include "spectral/tss.h" 191 192 #include "pitch/pitch.h" -
src/onset/onset.c
r67b6618 r155cc10 24 24 #include "spectral/specdesc.h" 25 25 #include "spectral/phasevoc.h" 26 #include "spectral/awhitening.h" 26 27 #include "onset/peakpicker.h" 27 28 #include "mathutils.h" 28 29 #include "onset/onset.h" 30 31 void aubio_onset_default_parameters (aubio_onset_t *o, char_t * method); 29 32 30 33 /** structure to store object state */ … … 43 46 uint_t total_frames; /**< total number of frames processed since the beginning */ 44 47 uint_t last_onset; /**< last detected onset location, in frames */ 48 49 uint_t apply_adaptive_whitening; 50 aubio_spectral_whitening_t *spectral_whitening; 45 51 }; 46 52 … … 50 56 smpl_t isonset = 0; 51 57 aubio_pvoc_do (o->pv,input, o->fftgrain); 58 /* 59 if (apply_filtering) { 60 } 61 if (apply_compression) { 62 } 63 */ 64 if (o->apply_adaptive_whitening) { 65 aubio_spectral_whitening_do(o->spectral_whitening, o->fftgrain); 66 } 52 67 aubio_specdesc_do (o->od, o->fftgrain, o->desc); 53 68 aubio_peakpicker_do(o->pp, o->desc, onset); … … 100 115 } 101 116 117 uint_t aubio_onset_set_adaptive_whitening (aubio_onset_t *o, uint_t apply_adaptive_whitening) 118 { 119 o->apply_adaptive_whitening = apply_adaptive_whitening; 120 return AUBIO_OK; 121 } 122 123 uint_t aubio_onset_get_adaptive_whitening (aubio_onset_t *o) 124 { 125 return o->apply_adaptive_whitening; 126 } 127 102 128 uint_t aubio_onset_set_silence(aubio_onset_t * o, smpl_t silence) { 103 129 o->silence = silence; … … 210 236 o->desc = new_fvec(1); 211 237 212 /* set some default parameter */ 213 aubio_onset_set_threshold (o, 0.3); 214 aubio_onset_set_delay(o, 4.3 * hop_size); 215 aubio_onset_set_minioi_ms(o, 20.); 216 aubio_onset_set_silence(o, -70.); 238 o->spectral_whitening = new_aubio_spectral_whitening(buf_size, hop_size, samplerate); 239 240 aubio_onset_default_parameters (o, onset_mode); 217 241 218 242 /* initialize internal variables */ … … 229 253 } 230 254 255 void aubio_onset_default_parameters (aubio_onset_t * o, char_t * onset_mode) 256 { 257 /* set some default parameter */ 258 aubio_onset_set_threshold (o, 0.3); 259 aubio_onset_set_delay (o, 4.3 * o->hop_size); 260 aubio_onset_set_minioi_ms (o, 50.); 261 aubio_onset_set_silence (o, -70.); 262 aubio_onset_set_adaptive_whitening (o, 1); 263 264 /* method specific optimisations */ 265 if (strcmp (onset_mode, "energy") == 0) { 266 } else if (strcmp (onset_mode, "hfc") == 0 || strcmp (onset_mode, "default") == 0) { 267 aubio_onset_set_adaptive_whitening (o, 0); 268 } else if (strcmp (onset_mode, "complexdomain") == 0 269 || strcmp (onset_mode, "complex") == 0) { 270 aubio_onset_set_delay (o, 4.6 * o->hop_size); 271 aubio_onset_set_threshold (o, 0.15); 272 } else if (strcmp (onset_mode, "phase") == 0) { 273 aubio_onset_set_adaptive_whitening (o, 0); 274 } else if (strcmp (onset_mode, "mkl") == 0) { 275 aubio_onset_set_threshold (o, 0.05); 276 } else if (strcmp (onset_mode, "kl") == 0) { 277 aubio_onset_set_threshold (o, 0.35); 278 } else if (strcmp (onset_mode, "specflux") == 0) { 279 aubio_onset_set_threshold (o, 0.4); 280 } else if (strcmp (onset_mode, "specdiff") == 0) { 281 } else { 282 AUBIO_ERR ("onset: unknown spectral descriptor type %s, " 283 "using default parameters.\n", onset_mode); 284 } 285 } 286 231 287 void del_aubio_onset (aubio_onset_t *o) 232 288 { 289 del_aubio_spectral_whitening(o->spectral_whitening); 233 290 del_aubio_specdesc(o->od); 234 291 del_aubio_peakpicker(o->pp); -
src/onset/onset.h
r67b6618 r155cc10 118 118 smpl_t aubio_onset_get_last_ms (const aubio_onset_t *o); 119 119 120 /** set onset detection adaptive whitening 121 122 \param o onset detection object as returned by new_aubio_onset() 123 \param apply_adaptive_whitening 1 to enable, 0 to disable 124 125 */ 126 uint_t aubio_onset_set_adaptive_whitening(aubio_onset_t * o, uint_t apply_adaptive_whitening); 127 128 /** get onset detection silence threshold 129 130 \param o onset detection object as returned by new_aubio_onset() 131 132 \return adaptive whitening mode, 1 if enabled, 0 otherwise 133 134 */ 135 uint_t aubio_onset_get_adaptive_whitening(aubio_onset_t * o); 136 120 137 /** set onset detection silence threshold 121 138
Note: See TracChangeset
for help on using the changeset viewer.