Changeset fa3edc6


Ignore:
Timestamp:
Mar 26, 2017, 4:28:54 PM (8 years ago)
Author:
Paul Brossier <piem@piem.org>
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
Message:

src/onset/onset.h: add _reset and _set_default_parameters

Location:
src/onset
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/onset/onset.c

    rfa0ef3b rfa3edc6  
    238238  o->fftgrain = new_cvec(buf_size);
    239239  o->desc = new_fvec(1);
    240 
    241240  o->spectral_whitening = new_aubio_spectral_whitening(buf_size, hop_size, samplerate);
    242241
    243   aubio_onset_default_parameters (o, onset_mode);
    244 
    245242  /* 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);
    248246  return o;
    249247
     
    256254}
    257255
    258 void aubio_onset_default_parameters (aubio_onset_t * o, const char_t * onset_mode)
    259 {
     256void aubio_onset_reset (aubio_onset_t *o) {
     257  o->last_onset = 0;
     258  o->total_frames = 0;
     259}
     260
     261uint_t aubio_onset_set_default_parameters (aubio_onset_t * o, const char_t * onset_mode)
     262{
     263  uint_t ret = AUBIO_OK;
    260264  /* set some default parameter */
    261265  aubio_onset_set_threshold (o, 0.3);
     
    294298    AUBIO_WRN("onset: unknown spectral descriptor type %s, "
    295299               "using default parameters.\n", onset_mode);
    296   }
     300    ret = AUBIO_FAIL;
     301  }
     302  return ret;
    297303}
    298304
  • src/onset/onset.h

    rfa0ef3b rfa3edc6  
    292292smpl_t aubio_onset_get_threshold(const aubio_onset_t * o);
    293293
     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 */
     302uint_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 */
     313void aubio_onset_reset(aubio_onset_t * o);
     314
    294315/** delete onset detection object
    295316
Note: See TracChangeset for help on using the changeset viewer.