- Timestamp:
- Mar 26, 2017, 4:28:54 PM (8 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, sampler
- Children:
- 40ed6a7
- Parents:
- fa0ef3b
- Location:
- src/onset
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/onset/onset.c
rfa0ef3b rfa3edc6 238 238 o->fftgrain = new_cvec(buf_size); 239 239 o->desc = new_fvec(1); 240 241 240 o->spectral_whitening = new_aubio_spectral_whitening(buf_size, hop_size, samplerate); 242 241 243 aubio_onset_default_parameters (o, onset_mode);244 245 242 /* initialize internal variables */ 246 o->last_onset = 0; 247 o->total_frames = 0; 243 aubio_onset_set_default_parameters (o, onset_mode); 244 245 aubio_onset_reset(o); 248 246 return o; 249 247 … … 256 254 } 257 255 258 void aubio_onset_default_parameters (aubio_onset_t * o, const char_t * onset_mode) 259 { 256 void aubio_onset_reset (aubio_onset_t *o) { 257 o->last_onset = 0; 258 o->total_frames = 0; 259 } 260 261 uint_t aubio_onset_set_default_parameters (aubio_onset_t * o, const char_t * onset_mode) 262 { 263 uint_t ret = AUBIO_OK; 260 264 /* set some default parameter */ 261 265 aubio_onset_set_threshold (o, 0.3); … … 294 298 AUBIO_WRN("onset: unknown spectral descriptor type %s, " 295 299 "using default parameters.\n", onset_mode); 296 } 300 ret = AUBIO_FAIL; 301 } 302 return ret; 297 303 } 298 304 -
src/onset/onset.h
rfa0ef3b rfa3edc6 292 292 smpl_t aubio_onset_get_threshold(const aubio_onset_t * o); 293 293 294 /** set default parameters 295 296 \param o onset detection object as returned by new_aubio_onset() 297 \param onset_mode detection mode to adjust 298 299 This function is called at the end of new_aubio_onset(). 300 301 */ 302 uint_t aubio_onset_set_default_parameters (aubio_onset_t * o, const char_t * onset_mode); 303 304 /** reset onset detection 305 306 \param o onset detection object as returned by new_aubio_onset() 307 308 Reset current time and last onset to 0. 309 310 This function is called at the end of new_aubio_onset(). 311 312 */ 313 void aubio_onset_reset(aubio_onset_t * o); 314 294 315 /** delete onset detection object 295 316
Note: See TracChangeset
for help on using the changeset viewer.