- Timestamp:
- Nov 3, 2009, 6:23:04 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:
- bf2e7a7
- Parents:
- bafe71d
- Location:
- src
- Files:
-
- 5 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
src/Makefile.am
rbafe71d r31907fd 23 23 spectral/fft.h \ 24 24 spectral/tss.h \ 25 spectral/specdesc.h \ 25 26 spectral/spectral_centroid.h \ 26 27 pitch/pitch.h \ … … 31 32 pitch/pitchyinfft.h \ 32 33 onset/onset.h \ 33 onset/onsetdetection.h \34 34 onset/peakpick.h \ 35 35 tempo/tempo.h \ -
src/aubio.h
rbafe71d r31907fd 166 166 #include "spectral/phasevoc.h" 167 167 #include "spectral/mfcc.h" 168 #include "spectral/specdesc.h" 168 169 #include "pitch/pitch.h" 169 170 #include "onset/onset.h" … … 183 184 #include "pitch/pitchschmitt.h" 184 185 #include "pitch/pitchfcomb.h" 185 #include "onset/onsetdetection.h"186 186 #include "spectral/spectral_centroid.h" 187 187 #include "onset/peakpick.h" -
src/onset/onset.c
rbafe71d r31907fd 22 22 #include "fvec.h" 23 23 #include "cvec.h" 24 #include " onset/onsetdetection.h"24 #include "spectral/specdesc.h" 25 25 #include "spectral/phasevoc.h" 26 26 #include "onset/peakpick.h" … … 31 31 struct _aubio_onset_t { 32 32 aubio_pvoc_t * pv; /**< phase vocoder */ 33 aubio_ onsetdetection_t * od; /**< onset detection */33 aubio_specdesc_t * od; /**< onset detection */ 34 34 aubio_peakpicker_t * pp; /**< peak picker */ 35 35 cvec_t * fftgrain; /**< phase vocoder output */ … … 49 49 uint_t i; 50 50 aubio_pvoc_do (o->pv,input, o->fftgrain); 51 aubio_ onsetdetection_do (o->od,o->fftgrain, o->of);51 aubio_specdesc_do (o->od,o->fftgrain, o->of); 52 52 /*if (usedoubled) { 53 aubio_ onsetdetection_do (o2,fftgrain, onset2);53 aubio_specdesc_do (o2,fftgrain, onset2); 54 54 onset->data[0][0] *= onset2->data[0][0]; 55 55 }*/ … … 109 109 o->pp = new_aubio_peakpicker(channels); 110 110 aubio_peakpicker_set_threshold (o->pp, o->threshold); 111 o->od = new_aubio_ onsetdetection(onset_mode,buf_size,channels);111 o->od = new_aubio_specdesc(onset_mode,buf_size,channels); 112 112 o->fftgrain = new_cvec(buf_size,channels); 113 113 o->of = new_fvec(1, channels); 114 114 /*if (usedoubled) { 115 o2 = new_aubio_ onsetdetection(onset_type2,buffer_size,channels);115 o2 = new_aubio_specdesc(onset_type2,buffer_size,channels); 116 116 onset2 = new_fvec(1 , channels); 117 117 }*/ … … 121 121 void del_aubio_onset (aubio_onset_t *o) 122 122 { 123 del_aubio_ onsetdetection(o->od);123 del_aubio_specdesc(o->od); 124 124 del_aubio_peakpicker(o->pp); 125 125 del_aubio_pvoc(o->pv); -
src/onset/onset.h
rbafe71d r31907fd 47 47 /** create onset detection object 48 48 49 \param onset_mode onset detection type as specified in onsetdetection.h49 \param onset_mode onset detection type as specified in specdesc.h 50 50 \param buf_size buffer size for phase vocoder 51 51 \param hop_size hop size for phase vocoder -
src/spectral/specdesc.c
rbafe71d r31907fd 23 23 #include "cvec.h" 24 24 #include "spectral/fft.h" 25 #include "spectral/specdesc.h" 25 26 #include "mathutils.h" 26 27 #include "utils/hist.h" 27 #include "onset/onsetdetection.h"28 28 29 29 /** Energy based onset detection function … … 31 31 This function calculates the local energy of the input spectral frame. 32 32 33 \param o onset detection object as returned by new_aubio_ onsetdetection()34 \param fftgrain input spectral frame 35 \param onset output onset detection function 36 37 */ 38 void aubio_ onsetdetection_energy(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);33 \param o onset detection object as returned by new_aubio_specdesc() 34 \param fftgrain input spectral frame 35 \param onset output onset detection function 36 37 */ 38 void aubio_specdesc_energy(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset); 39 39 /** High Frequency Content onset detection function 40 40 … … 45 45 Musical Signal. PhD dissertation, University of Bristol, UK, 1996. 46 46 47 \param o onset detection object as returned by new_aubio_ onsetdetection()48 \param fftgrain input spectral frame 49 \param onset output onset detection function 50 51 */ 52 void aubio_ onsetdetection_hfc(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);47 \param o onset detection object as returned by new_aubio_specdesc() 48 \param fftgrain input spectral frame 49 \param onset output onset detection function 50 51 */ 52 void aubio_specdesc_hfc(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset); 53 53 /** Complex Domain Method onset detection function 54 54 … … 57 57 Effects Conference, DAFx-03, pages 90-93, London, UK, 2003. 58 58 59 \param o onset detection object as returned by new_aubio_ onsetdetection()60 \param fftgrain input spectral frame 61 \param onset output onset detection function 62 63 */ 64 void aubio_ onsetdetection_complex(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);59 \param o onset detection object as returned by new_aubio_specdesc() 60 \param fftgrain input spectral frame 61 \param onset output onset detection function 62 63 */ 64 void aubio_specdesc_complex(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset); 65 65 /** Phase Based Method onset detection function 66 66 … … 70 70 Hong-Kong, 2003. 71 71 72 \param o onset detection object as returned by new_aubio_ onsetdetection()73 \param fftgrain input spectral frame 74 \param onset output onset detection function 75 76 */ 77 void aubio_ onsetdetection_phase(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);72 \param o onset detection object as returned by new_aubio_specdesc() 73 \param fftgrain input spectral frame 74 \param onset output onset detection function 75 76 */ 77 void aubio_specdesc_phase(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset); 78 78 /** Spectral difference method onset detection function 79 79 … … 82 82 (ICME 2001), pages 881884, Tokyo, Japan, August 2001. 83 83 84 \param o onset detection object as returned by new_aubio_ onsetdetection()85 \param fftgrain input spectral frame 86 \param onset output onset detection function 87 88 */ 89 void aubio_ onsetdetection_specdiff(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);84 \param o onset detection object as returned by new_aubio_specdesc() 85 \param fftgrain input spectral frame 86 \param onset output onset detection function 87 88 */ 89 void aubio_specdesc_specdiff(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset); 90 90 /** Kullback-Liebler onset detection function 91 91 … … 94 94 (ICMC), Singapore, 2003. 95 95 96 \param o onset detection object as returned by new_aubio_ onsetdetection()97 \param fftgrain input spectral frame 98 \param onset output onset detection function 99 100 */ 101 void aubio_ onsetdetection_kl(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);96 \param o onset detection object as returned by new_aubio_specdesc() 97 \param fftgrain input spectral frame 98 \param onset output onset detection function 99 100 */ 101 void aubio_specdesc_kl(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset); 102 102 /** Modified Kullback-Liebler onset detection function 103 103 … … 106 106 music, Queen Mary University of London, London, UK, 2006. 107 107 108 \param o onset detection object as returned by new_aubio_ onsetdetection()109 \param fftgrain input spectral frame 110 \param onset output onset detection function 111 112 */ 113 void aubio_ onsetdetection_mkl(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);108 \param o onset detection object as returned by new_aubio_specdesc() 109 \param fftgrain input spectral frame 110 \param onset output onset detection function 111 112 */ 113 void aubio_specdesc_mkl(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset); 114 114 /** Spectral Flux 115 115 … … 118 118 Canada, 2006. 119 119 120 \param o onset detection object as returned by new_aubio_ onsetdetection()121 \param fftgrain input spectral frame 122 \param onset output onset detection function 123 124 */ 125 void aubio_ onsetdetection_specflux(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);120 \param o onset detection object as returned by new_aubio_specdesc() 121 \param fftgrain input spectral frame 122 \param onset output onset detection function 123 124 */ 125 void aubio_specdesc_specflux(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset); 126 126 127 127 /** onsetdetection types */ … … 136 136 aubio_onset_specflux, /**< spectral flux */ 137 137 aubio_onset_default = aubio_onset_hfc, /**< default mode, set to hfc */ 138 } aubio_ onsetdetection_type;138 } aubio_specdesc_type; 139 139 140 140 /** structure to store object state */ 141 struct _aubio_ onsetdetection_t {142 aubio_ onsetdetection_type onset_type; /**< onset detection type */143 /** Pointer to aubio_ onsetdetection_<type> function */144 void (*funcpointer)(aubio_ onsetdetection_t *o,141 struct _aubio_specdesc_t { 142 aubio_specdesc_type onset_type; /**< onset detection type */ 143 /** Pointer to aubio_specdesc_<type> function */ 144 void (*funcpointer)(aubio_specdesc_t *o, 145 145 cvec_t * fftgrain, fvec_t * onset); 146 146 smpl_t threshold; /**< minimum norm threshold for phase and specdiff */ … … 154 154 155 155 /* Energy based onset detection function */ 156 void aubio_ onsetdetection_energy (aubio_onsetdetection_t *o UNUSED,156 void aubio_specdesc_energy (aubio_specdesc_t *o UNUSED, 157 157 cvec_t * fftgrain, fvec_t * onset) { 158 158 uint_t i,j; … … 166 166 167 167 /* High Frequency Content onset detection function */ 168 void aubio_ onsetdetection_hfc(aubio_onsetdetection_t *o UNUSED,168 void aubio_specdesc_hfc(aubio_specdesc_t *o UNUSED, 169 169 cvec_t * fftgrain, fvec_t * onset){ 170 170 uint_t i,j; … … 179 179 180 180 /* Complex Domain Method onset detection function */ 181 void aubio_ onsetdetection_complex (aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset) {181 void aubio_specdesc_complex (aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset) { 182 182 uint_t i, j; 183 183 uint_t nbins = fftgrain->length; … … 204 204 205 205 /* Phase Based Method onset detection function */ 206 void aubio_ onsetdetection_phase(aubio_onsetdetection_t *o,206 void aubio_specdesc_phase(aubio_specdesc_t *o, 207 207 cvec_t * fftgrain, fvec_t * onset){ 208 208 uint_t i, j; … … 236 236 237 237 /* Spectral difference method onset detection function */ 238 void aubio_ onsetdetection_specdiff(aubio_onsetdetection_t *o,238 void aubio_specdesc_specdiff(aubio_specdesc_t *o, 239 239 cvec_t * fftgrain, fvec_t * onset){ 240 240 uint_t i, j; … … 267 267 * note we use ln(1+Xn/(Xn-1+0.0001)) to avoid 268 268 * negative (1.+) and infinite values (+1.e-10) */ 269 void aubio_ onsetdetection_kl(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset){269 void aubio_specdesc_kl(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset){ 270 270 uint_t i,j; 271 271 for (i=0;i<fftgrain->channels;i++) { … … 283 283 * note we use ln(1+Xn/(Xn-1+0.0001)) to avoid 284 284 * negative (1.+) and infinite values (+1.e-10) */ 285 void aubio_ onsetdetection_mkl(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset){285 void aubio_specdesc_mkl(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset){ 286 286 uint_t i,j; 287 287 for (i=0;i<fftgrain->channels;i++) { … … 296 296 297 297 /* Spectral flux */ 298 void aubio_ onsetdetection_specflux(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset){298 void aubio_specdesc_specflux(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset){ 299 299 uint_t i, j; 300 300 for (i=0;i<fftgrain->channels;i++) { … … 310 310 /* Generic function pointing to the choosen one */ 311 311 void 312 aubio_ onsetdetection_do (aubio_onsetdetection_t *o, cvec_t * fftgrain,312 aubio_specdesc_do (aubio_specdesc_t *o, cvec_t * fftgrain, 313 313 fvec_t * onset) { 314 314 o->funcpointer(o,fftgrain,onset); … … 318 318 * depending on the choosen type, allocate memory as needed 319 319 */ 320 aubio_ onsetdetection_t *321 new_aubio_ onsetdetection(char_t * onset_mode,320 aubio_specdesc_t * 321 new_aubio_specdesc (char_t * onset_mode, 322 322 uint_t size, uint_t channels){ 323 aubio_ onsetdetection_t * o = AUBIO_NEW(aubio_onsetdetection_t);323 aubio_specdesc_t * o = AUBIO_NEW(aubio_specdesc_t); 324 324 uint_t rsize = size/2+1; 325 aubio_ onsetdetection_type onset_type;325 aubio_specdesc_type onset_type; 326 326 if (strcmp (onset_mode, "energy") == 0) 327 327 onset_type = aubio_onset_energy; … … 389 389 switch(onset_type) { 390 390 case aubio_onset_energy: 391 o->funcpointer = aubio_ onsetdetection_energy;391 o->funcpointer = aubio_specdesc_energy; 392 392 break; 393 393 case aubio_onset_hfc: 394 o->funcpointer = aubio_ onsetdetection_hfc;394 o->funcpointer = aubio_specdesc_hfc; 395 395 break; 396 396 case aubio_onset_complex: 397 o->funcpointer = aubio_ onsetdetection_complex;397 o->funcpointer = aubio_specdesc_complex; 398 398 break; 399 399 case aubio_onset_phase: 400 o->funcpointer = aubio_ onsetdetection_phase;400 o->funcpointer = aubio_specdesc_phase; 401 401 break; 402 402 case aubio_onset_specdiff: 403 o->funcpointer = aubio_ onsetdetection_specdiff;403 o->funcpointer = aubio_specdesc_specdiff; 404 404 break; 405 405 case aubio_onset_kl: 406 o->funcpointer = aubio_ onsetdetection_kl;406 o->funcpointer = aubio_specdesc_kl; 407 407 break; 408 408 case aubio_onset_mkl: 409 o->funcpointer = aubio_ onsetdetection_mkl;409 o->funcpointer = aubio_specdesc_mkl; 410 410 break; 411 411 case aubio_onset_specflux: 412 o->funcpointer = aubio_ onsetdetection_specflux;412 o->funcpointer = aubio_specdesc_specflux; 413 413 break; 414 414 default: … … 419 419 } 420 420 421 void del_aubio_ onsetdetection (aubio_onsetdetection_t *o){421 void del_aubio_specdesc (aubio_specdesc_t *o){ 422 422 switch(o->onset_type) { 423 423 /* for both energy and hfc, only fftgrain->norm is required */ -
src/spectral/specdesc.h
rbafe71d r31907fd 41 41 42 42 /** onsetdetection structure */ 43 typedef struct _aubio_ onsetdetection_t aubio_onsetdetection_t;43 typedef struct _aubio_specdesc_t aubio_specdesc_t; 44 44 /** execute onset detection function on a spectral frame 45 45 46 46 Generic function to compute onset detection. 47 47 48 \param o onset detection object as returned by new_aubio_ onsetdetection()48 \param o onset detection object as returned by new_aubio_specdesc() 49 49 \param fftgrain input signal spectrum as computed by aubio_pvoc_do 50 50 \param onset output vector (one sample long, to send to the peak picking) 51 51 52 52 */ 53 void aubio_ onsetdetection_do (aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);53 void aubio_specdesc_do (aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset); 54 54 /** creation of an onset detection object 55 55 … … 59 59 60 60 */ 61 aubio_ onsetdetection_t * new_aubio_onsetdetection(char_t * onset_mode, uint_t buf_size, uint_t channels);61 aubio_specdesc_t * new_aubio_specdesc(char_t * onset_mode, uint_t buf_size, uint_t channels); 62 62 /** deletion of an onset detection object 63 63 64 \param o onset detection object as returned by new_aubio_ onsetdetection()64 \param o onset detection object as returned by new_aubio_specdesc() 65 65 66 66 */ 67 void del_aubio_ onsetdetection(aubio_onsetdetection_t *o);67 void del_aubio_specdesc(aubio_specdesc_t *o); 68 68 69 69 #ifdef __cplusplus -
src/tempo/tempo.c
rbafe71d r31907fd 22 22 #include "fvec.h" 23 23 #include "cvec.h" 24 #include " onset/onsetdetection.h"24 #include "spectral/specdesc.h" 25 25 #include "tempo/beattracking.h" 26 26 #include "spectral/phasevoc.h" … … 31 31 /* structure to store object state */ 32 32 struct _aubio_tempo_t { 33 aubio_ onsetdetection_t * od; /** onset detection */33 aubio_specdesc_t * od; /** onset detection */ 34 34 aubio_pvoc_t * pv; /** phase vocoder */ 35 35 aubio_peakpicker_t * pp; /** peak picker */ … … 56 56 uint_t step = o->step; 57 57 aubio_pvoc_do (o->pv, input, o->fftgrain); 58 aubio_ onsetdetection_do (o->od, o->fftgrain, o->of);58 aubio_specdesc_do (o->od, o->fftgrain, o->of); 59 59 /*if (usedoubled) { 60 aubio_ onsetdetection_do(o2,fftgrain, onset2);60 aubio_specdesc_do(o2,fftgrain, onset2); 61 61 onset->data[0][0] *= onset2->data[0][0]; 62 62 }*/ … … 121 121 o->pp = new_aubio_peakpicker(channels); 122 122 aubio_peakpicker_set_threshold (o->pp, o->threshold); 123 o->od = new_aubio_ onsetdetection(onset_mode,buf_size,channels);123 o->od = new_aubio_specdesc(onset_mode,buf_size,channels); 124 124 o->of = new_fvec(1, channels); 125 125 o->bt = new_aubio_beattracking(o->winlen,channels); … … 127 127 o->peek = new_fvec(3, channels); 128 128 /*if (usedoubled) { 129 o2 = new_aubio_ onsetdetection(type_onset2,buffer_size,channels);129 o2 = new_aubio_specdesc(type_onset2,buffer_size,channels); 130 130 onset2 = new_fvec(1 , channels); 131 131 }*/ … … 143 143 void del_aubio_tempo (aubio_tempo_t *o) 144 144 { 145 del_aubio_ onsetdetection(o->od);145 del_aubio_specdesc(o->od); 146 146 del_aubio_beattracking(o->bt); 147 147 del_aubio_peakpicker(o->pp);
Note: See TracChangeset
for help on using the changeset viewer.