- Timestamp:
- Oct 15, 2009, 5:09:34 PM (15 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:
- cd77c15
- Parents:
- 27fa522
- Location:
- src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/onset/onset.c
r27fa522 rb4f5967 89 89 90 90 /* Allocate memory for an onset detection */ 91 aubio_onset_t * new_aubio_onset ( aubio_onsetdetection_type type_onset,91 aubio_onset_t * new_aubio_onset (char_t * onset_mode, 92 92 uint_t buf_size, uint_t hop_size, uint_t channels) 93 93 { … … 100 100 o->pv = new_aubio_pvoc(buf_size, hop_size, channels); 101 101 o->pp = new_aubio_peakpicker(o->threshold); 102 o->od = new_aubio_onsetdetection( type_onset,buf_size,channels);102 o->od = new_aubio_onsetdetection(onset_mode,buf_size,channels); 103 103 o->fftgrain = new_cvec(buf_size,channels); 104 104 o->of = new_fvec(1, channels); 105 105 /*if (usedoubled) { 106 o2 = new_aubio_onsetdetection( type_onset2,buffer_size,channels);106 o2 = new_aubio_onsetdetection(onset_type2,buffer_size,channels); 107 107 onset2 = new_fvec(1 , channels); 108 108 }*/ -
src/onset/onset.h
r27fa522 rb4f5967 52 52 53 53 */ 54 aubio_onset_t * new_aubio_onset ( aubio_onsetdetection_type type_onset,54 aubio_onset_t * new_aubio_onset (char_t * onset_mode, 55 55 uint_t buf_size, uint_t hop_size, uint_t channels); 56 56 -
src/onset/onsetdetection.c
r27fa522 rb4f5967 124 124 void aubio_onsetdetection_specflux(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset); 125 125 126 /** onsetdetection types */ 127 typedef enum { 128 aubio_onset_energy, /**< energy based */ 129 aubio_onset_specdiff, /**< spectral diff */ 130 aubio_onset_hfc, /**< high frequency content */ 131 aubio_onset_complex, /**< complex domain */ 132 aubio_onset_phase, /**< phase fast */ 133 aubio_onset_kl, /**< Kullback Liebler */ 134 aubio_onset_mkl, /**< modified Kullback Liebler */ 135 aubio_onset_specflux, /**< spectral flux */ 136 } aubio_onsetdetection_type; 137 126 138 /** structure to store object state */ 127 139 struct _aubio_onsetdetection_t { 128 aubio_onsetdetection_type type; /**< onset detection type */140 aubio_onsetdetection_type onset_type; /**< onset detection type */ 129 141 /** Pointer to aubio_onsetdetection_<type> function */ 130 142 void (*funcpointer)(aubio_onsetdetection_t *o, … … 305 317 */ 306 318 aubio_onsetdetection_t * 307 new_aubio_onsetdetection ( aubio_onsetdetection_type type,319 new_aubio_onsetdetection (char_t * onset_mode, 308 320 uint_t size, uint_t channels){ 309 321 aubio_onsetdetection_t * o = AUBIO_NEW(aubio_onsetdetection_t); 310 322 uint_t rsize = size/2+1; 311 switch(type) { 323 aubio_onsetdetection_type onset_type; 324 if (strcmp (onset_mode, "energy") == 0) 325 onset_type = aubio_onset_energy; 326 else if (strcmp (onset_mode, "specdiff") == 0) 327 onset_type = aubio_onset_specdiff; 328 else if (strcmp (onset_mode, "hfc") == 0) 329 onset_type = aubio_onset_hfc; 330 else if (strcmp (onset_mode, "complexdomain") == 0) 331 onset_type = aubio_onset_complex; 332 else if (strcmp (onset_mode, "complex") == 0) 333 onset_type = aubio_onset_complex; 334 else if (strcmp (onset_mode, "phase") == 0) 335 onset_type = aubio_onset_phase; 336 else if (strcmp (onset_mode, "mkl") == 0) 337 onset_type = aubio_onset_mkl; 338 else if (strcmp (onset_mode, "kl") == 0) 339 onset_type = aubio_onset_kl; 340 else if (strcmp (onset_mode, "specflux") == 0) 341 onset_type = aubio_onset_specflux; 342 else { 343 AUBIO_ERR("unknown onset type.\n"); 344 return NULL; 345 } 346 switch(onset_type) { 312 347 /* for both energy and hfc, only fftgrain->norm is required */ 313 348 case aubio_onset_energy: … … 348 383 * above and always allocate all the structure */ 349 384 350 switch( type) {385 switch(onset_type) { 351 386 case aubio_onset_energy: 352 387 o->funcpointer = aubio_onsetdetection_energy; … … 376 411 break; 377 412 } 378 o-> type =type;413 o->onset_type = onset_type; 379 414 return o; 380 415 } 381 416 382 417 void del_aubio_onsetdetection (aubio_onsetdetection_t *o){ 383 switch(o-> type) {418 switch(o->onset_type) { 384 419 /* for both energy and hfc, only fftgrain->norm is required */ 385 420 case aubio_onset_energy: -
src/onset/onsetdetection.h
r27fa522 rb4f5967 39 39 #endif 40 40 41 /** onsetdetection types */42 typedef enum {43 aubio_onset_energy, /**< energy based */44 aubio_onset_specdiff, /**< spectral diff */45 aubio_onset_hfc, /**< high frequency content */46 aubio_onset_complex, /**< complex domain */47 aubio_onset_phase, /**< phase fast */48 aubio_onset_kl, /**< Kullback Liebler */49 aubio_onset_mkl, /**< modified Kullback Liebler */50 aubio_onset_specflux, /**< spectral flux */51 } aubio_onsetdetection_type;52 53 41 /** onsetdetection structure */ 54 42 typedef struct _aubio_onsetdetection_t aubio_onsetdetection_t; … … 70 58 71 59 */ 72 aubio_onsetdetection_t * new_aubio_onsetdetection( aubio_onsetdetection_type type, uint_tsize, uint_t channels);60 aubio_onsetdetection_t * new_aubio_onsetdetection(char_t * onset_mode, uint_t buf_size, uint_t channels); 73 61 /** deletion of an onset detection object 74 62 -
src/tempo/tempo.c
r27fa522 rb4f5967 99 99 100 100 /* Allocate memory for an tempo detection */ 101 aubio_tempo_t * new_aubio_tempo ( aubio_onsetdetection_type type_onset,101 aubio_tempo_t * new_aubio_tempo (char_t * onset_mode, 102 102 uint_t buf_size, uint_t hop_size, uint_t channels) 103 103 { … … 114 114 o->pv = new_aubio_pvoc(buf_size, hop_size, channels); 115 115 o->pp = new_aubio_peakpicker(o->threshold); 116 o->od = new_aubio_onsetdetection( type_onset,buf_size,channels);116 o->od = new_aubio_onsetdetection(onset_mode,buf_size,channels); 117 117 o->of = new_fvec(1, channels); 118 118 o->bt = new_aubio_beattracking(o->winlen,channels); -
src/tempo/tempo.h
r27fa522 rb4f5967 38 38 39 39 /** create tempo detection object */ 40 aubio_tempo_t * new_aubio_tempo ( aubio_onsetdetection_type type_onset,40 aubio_tempo_t * new_aubio_tempo (char_t * mode, 41 41 uint_t buf_size, uint_t hop_size, uint_t channels); 42 42
Note: See TracChangeset
for help on using the changeset viewer.