Changeset df53936
- Timestamp:
- Mar 18, 2013, 4:49:02 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:
- 78a42e2
- Parents:
- 93e3463
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/onset/onset.c
r93e3463 rdf53936 1 1 /* 2 Copyright (C) 2006-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2006-2013 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 31 31 struct _aubio_onset_t { 32 32 aubio_pvoc_t * pv; /**< phase vocoder */ 33 aubio_specdesc_t * od; /**< onset description function*/33 aubio_specdesc_t * od; /**< spectral descriptor */ 34 34 aubio_peakpicker_t * pp; /**< peak picker */ 35 35 cvec_t * fftgrain; /**< phase vocoder output */ 36 fvec_t * of; /**< onset detection function */36 fvec_t * desc; /**< spectral description */ 37 37 smpl_t threshold; /**< onset peak picking threshold */ 38 38 smpl_t silence; /**< silence threhsold */ … … 51 51 smpl_t isonset = 0; 52 52 aubio_pvoc_do (o->pv,input, o->fftgrain); 53 aubio_specdesc_do (o->od, o->fftgrain, o->of);54 aubio_peakpicker_do(o->pp, o-> of, onset);53 aubio_specdesc_do (o->od, o->fftgrain, o->desc); 54 aubio_peakpicker_do(o->pp, o->desc, onset); 55 55 isonset = onset->data[0]; 56 56 if (isonset > 0.) { 57 57 if (aubio_silence_detection(input, o->silence)==1) { 58 //AUBIO_DBG ("silent onset, not marking as onset\n"); 58 59 isonset = 0; 59 60 } else { 60 61 uint_t new_onset = o->total_frames + isonset * o->hop_size; 61 62 if (o->last_onset + o->minioi < new_onset) { 63 //AUBIO_DBG ("accepted detection, marking as onset\n"); 62 64 o->last_onset = new_onset; 63 65 } else { 66 //AUBIO_DBG ("doubled onset, not marking as onset\n"); 64 67 isonset = 0; 65 68 } … … 155 158 156 159 smpl_t aubio_onset_get_descriptor(aubio_onset_t * o) { 157 return o-> of->data[0];160 return o->desc->data[0]; 158 161 } 159 162 … … 182 185 o->od = new_aubio_specdesc(onset_mode,buf_size); 183 186 o->fftgrain = new_cvec(buf_size); 184 o-> of= new_fvec(1);187 o->desc = new_fvec(1); 185 188 return o; 186 189 } … … 191 194 del_aubio_peakpicker(o->pp); 192 195 del_aubio_pvoc(o->pv); 193 del_fvec(o-> of);196 del_fvec(o->desc); 194 197 del_cvec(o->fftgrain); 195 198 AUBIO_FREE(o);
Note: See TracChangeset
for help on using the changeset viewer.