Changeset b4f5967
- 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
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/aubiotrack.c
r27fa522 rb4f5967 81 81 82 82 out = new_fvec(2,channels); 83 bt = new_aubio_tempo( type_onset,buffer_size,overlap_size,channels);83 bt = new_aubio_tempo(onset_mode,buffer_size,overlap_size,channels); 84 84 85 85 examples_common_process(aubio_process,process_print); -
examples/utils.c
r27fa522 rb4f5967 46 46 47 47 /* energy,specdiff,hfc,complexdomain,phase */ 48 aubio_onsetdetection_type type_onset = aubio_onset_kl; 49 aubio_onsetdetection_type type_onset2 = aubio_onset_complex; 48 char_t * onset_mode = "default"; 50 49 smpl_t threshold = 0.3; 51 50 smpl_t silence = -90.; … … 92 91 93 92 /* badly redeclare some things */ 94 aubio_onsetdetection_type type_onset;95 93 smpl_t threshold; 96 94 smpl_t averaging; … … 164 162 break; 165 163 case 'O': /*onset type */ 166 if (strcmp (optarg, "energy") == 0) 167 type_onset = aubio_onset_energy; 168 else if (strcmp (optarg, "specdiff") == 0) 169 type_onset = aubio_onset_specdiff; 170 else if (strcmp (optarg, "hfc") == 0) 171 type_onset = aubio_onset_hfc; 172 else if (strcmp (optarg, "complexdomain") == 0) 173 type_onset = aubio_onset_complex; 174 else if (strcmp (optarg, "complex") == 0) 175 type_onset = aubio_onset_complex; 176 else if (strcmp (optarg, "phase") == 0) 177 type_onset = aubio_onset_phase; 178 else if (strcmp (optarg, "mkl") == 0) 179 type_onset = aubio_onset_mkl; 180 else if (strcmp (optarg, "kl") == 0) 181 type_onset = aubio_onset_kl; 182 else if (strcmp (optarg, "specflux") == 0) 183 type_onset = aubio_onset_specflux; 184 else { 185 errmsg ("unknown onset type.\n"); 186 abort (); 187 } 188 usedoubled = 0; 164 onset_mode = optarg; 189 165 break; 190 166 case 's': /* threshold value for onset */ … … 332 308 /* onsets */ 333 309 parms = new_aubio_peakpicker (threshold); 334 o = new_aubio_onsetdetection ( type_onset, buffer_size, channels);310 o = new_aubio_onsetdetection (onset_mode, buffer_size, channels); 335 311 onset = new_fvec (1, channels); 336 if (usedoubled) {337 o2 = new_aubio_onsetdetection (type_onset2, buffer_size, channels);338 onset2 = new_fvec (1, channels);339 }340 312 341 313 } -
examples/utils.h
r27fa522 rb4f5967 79 79 80 80 /* energy,specdiff,hfc,complexdomain,phase */ 81 extern aubio_onsetdetection_type type_onset; 82 extern aubio_onsetdetection_type type_onset2; 81 extern char_t * onset_mode; 83 82 extern smpl_t threshold; 84 83 extern smpl_t silence; -
plugins/puredata/aubioonset~.c
r27fa522 rb4f5967 88 88 x->hopsize = x->bufsize / 2; 89 89 90 x->o = new_aubio_onsetdetection( aubio_onset_complex, x->bufsize, 1);90 x->o = new_aubio_onsetdetection("complex", x->bufsize, 1); 91 91 x->vec = (fvec_t *)new_fvec(x->hopsize,1); 92 92 x->pv = (aubio_pvoc_t *)new_aubio_pvoc(x->bufsize, x->hopsize, 1); -
plugins/puredata/aubiotempo~.c
r27fa522 rb4f5967 83 83 x->hopsize = x->bufsize / 2; 84 84 85 x->t = new_aubio_tempo ( aubio_onset_complex, x->bufsize, x->hopsize, 1);85 x->t = new_aubio_tempo ("complex", x->bufsize, x->hopsize, 1); 86 86 aubio_tempo_set_silence(x->t,x->silence); 87 87 aubio_tempo_set_threshold(x->t,x->threshold); -
python/aubio/aubioclass.py
r27fa522 rb4f5967 70 70 class onsetdetection: 71 71 """ class for aubio_onsetdetection """ 72 def __init__(self, type,buf,chan):73 self.od = new_aubio_onsetdetection( type,buf,chan)72 def __init__(self,mode,buf,chan): 73 self.od = new_aubio_onsetdetection(mode,buf,chan) 74 74 def do(self,tc,tf): 75 75 aubio_onsetdetection_do(self.od,tc(),tf()) … … 94 94 self.pv = pvoc(bufsize,hopsize,channels) 95 95 if mode in ['dual'] : 96 self.myod = onsetdetection( aubio_onset_hfc,bufsize,channels)97 self.myod2 = onsetdetection( aubio_onset_mkl,bufsize,channels)96 self.myod = onsetdetection("hfc",bufsize,channels) 97 self.myod2 = onsetdetection("mkl",bufsize,channels) 98 98 self.myonset = fvec(1,channels) 99 99 self.myonset2 = fvec(1,channels) -
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 -
swig/aubio.i
r27fa522 rb4f5967 188 188 189 189 /* onset detection */ 190 typedef enum { 191 aubio_onset_energy, 192 aubio_onset_specdiff, 193 aubio_onset_hfc, 194 aubio_onset_complex, 195 aubio_onset_phase, 196 aubio_onset_kl, 197 aubio_onset_mkl, 198 aubio_onset_specflux, 199 } aubio_onsetdetection_type; 200 aubio_onsetdetection_t * new_aubio_onsetdetection(aubio_onsetdetection_type type, uint_t size, uint_t channels); 190 aubio_onsetdetection_t * new_aubio_onsetdetection(char * onset_mode, uint_t size, uint_t channels); 201 191 void aubio_onsetdetection_do (aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset); 202 192 void del_aubio_onsetdetection(aubio_onsetdetection_t *o); -
tests/src/test-onset.c
r27fa522 rb4f5967 7 7 fvec_t * in = new_fvec (win_s/4, channels); /* input buffer */ 8 8 fvec_t * out = new_fvec (2, channels); /* input buffer */ 9 aubio_onset_t * onset = new_aubio_onset( aubio_onset_complex, win_s, win_s/4, channels);9 aubio_onset_t * onset = new_aubio_onset("complex", win_s, win_s/4, channels); 10 10 uint_t i = 0; 11 11 -
tests/src/test-onsetdetection.c
r27fa522 rb4f5967 12 12 aubio_onsetdetection_t *o; 13 13 14 o = new_aubio_onsetdetection ( aubio_onset_energy, win_s, channels);14 o = new_aubio_onsetdetection ("energy", win_s, channels); 15 15 aubio_onsetdetection_do (o, in, out); 16 16 del_aubio_onsetdetection (o); 17 17 18 o = new_aubio_onsetdetection ( aubio_onset_specdiff, win_s, channels);18 o = new_aubio_onsetdetection ("energy", win_s, channels); 19 19 aubio_onsetdetection_do (o, in, out); 20 20 del_aubio_onsetdetection (o); 21 21 22 o = new_aubio_onsetdetection ( aubio_onset_hfc, win_s, channels);22 o = new_aubio_onsetdetection ("hfc", win_s, channels); 23 23 aubio_onsetdetection_do (o, in, out); 24 24 del_aubio_onsetdetection (o); 25 25 26 o = new_aubio_onsetdetection ( aubio_onset_complex, win_s, channels);26 o = new_aubio_onsetdetection ("complex", win_s, channels); 27 27 aubio_onsetdetection_do (o, in, out); 28 28 del_aubio_onsetdetection (o); 29 29 30 o = new_aubio_onsetdetection ( aubio_onset_phase, win_s, channels);30 o = new_aubio_onsetdetection ("phase", win_s, channels); 31 31 aubio_onsetdetection_do (o, in, out); 32 32 del_aubio_onsetdetection (o); 33 33 34 o = new_aubio_onsetdetection ( aubio_onset_kl, win_s, channels);34 o = new_aubio_onsetdetection ("kl", win_s, channels); 35 35 aubio_onsetdetection_do (o, in, out); 36 36 del_aubio_onsetdetection (o); 37 37 38 o = new_aubio_onsetdetection ( aubio_onset_mkl, win_s, channels);38 o = new_aubio_onsetdetection ("mkl", win_s, channels); 39 39 aubio_onsetdetection_do (o, in, out); 40 40 del_aubio_onsetdetection (o); -
tests/src/test-tempo.c
r27fa522 rb4f5967 8 8 fvec_t * in = new_fvec (win_s, channels); /* input buffer */ 9 9 fvec_t * out = new_fvec (2, channels); /* input buffer */ 10 aubio_tempo_t * o = new_aubio_tempo( aubio_onset_complex, win_s, win_s/4, channels);10 aubio_tempo_t * o = new_aubio_tempo("complex", win_s, win_s/4, channels); 11 11 uint_t i = 0; 12 12
Note: See TracChangeset
for help on using the changeset viewer.