- Timestamp:
- Apr 9, 2013, 7:49:36 PM (12 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, pitchshift, sampler, timestretch, yinfft+
- Children:
- 483b883
- Parents:
- dee4164
- Location:
- src/onset
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/onset/onset.c
rdee4164 r8b884ef 59 59 isonset = 0; 60 60 } else { 61 uint_t new_onset = o->total_frames + isonset * o->hop_size;61 uint_t new_onset = o->total_frames + (uint_t)ROUND(isonset * o->hop_size); 62 62 if (o->last_onset + o->minioi < new_onset) { 63 63 //AUBIO_DBG ("accepted detection, marking as onset\n"); … … 81 81 } 82 82 83 smpl_t aubio_onset_get_last_onset (aubio_onset_t *o)83 uint_t aubio_onset_get_last (aubio_onset_t *o) 84 84 { 85 85 return o->last_onset - o->delay; 86 86 } 87 87 88 smpl_t aubio_onset_get_last_ onset_s (aubio_onset_t *o)88 smpl_t aubio_onset_get_last_s (aubio_onset_t *o) 89 89 { 90 return aubio_onset_get_last _onset(o) / (smpl_t) (o->samplerate);90 return aubio_onset_get_last (o) / (smpl_t) (o->samplerate); 91 91 } 92 92 93 smpl_t aubio_onset_get_last_ onset_ms (aubio_onset_t *o)93 smpl_t aubio_onset_get_last_ms (aubio_onset_t *o) 94 94 { 95 return aubio_onset_get_last_ onset_s (o) / 1000.;95 return aubio_onset_get_last_s (o) / 1000.; 96 96 } 97 97 -
src/onset/onset.h
rdee4164 r8b884ef 92 92 93 93 */ 94 smpl_t aubio_onset_get_last_onset (aubio_onset_t *o);94 uint_t aubio_onset_get_last (aubio_onset_t *o); 95 95 96 96 /** get the time of the latest onset detected, in seconds … … 99 99 100 100 */ 101 smpl_t aubio_onset_get_last_ onset_s (aubio_onset_t *o);101 smpl_t aubio_onset_get_last_s (aubio_onset_t *o); 102 102 103 103 /** get the time of the latest onset detected, in milliseconds … … 106 106 107 107 */ 108 smpl_t aubio_onset_get_last_ onset_ms (aubio_onset_t *o);108 smpl_t aubio_onset_get_last_ms (aubio_onset_t *o); 109 109 110 110 /** set onset detection silence threshold
Note: See TracChangeset
for help on using the changeset viewer.