Changeset 5cf415f
- Timestamp:
- Aug 9, 2005, 8:35:14 PM (19 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:
- b1f723d
- Parents:
- a29ad46
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/utils.c
ra29ad46 r5cf415f 30 30 31 31 /* energy,specdiff,hfc,complexdomain,phase */ 32 aubio_onsetdetection_type type_onset = kl;33 aubio_onsetdetection_type type_onset2 = complexdomain;32 aubio_onsetdetection_type type_onset = aubio_onset_kl; 33 aubio_onsetdetection_type type_onset2 = aubio_onset_complex; 34 34 smpl_t threshold = 0.3; 35 35 smpl_t threshold2 = -90.; … … 140 140 case 'O': /*onset type*/ 141 141 if (strcmp(optarg,"energy") == 0) 142 type_onset = energy;142 type_onset = aubio_onset_energy; 143 143 else if (strcmp(optarg,"specdiff") == 0) 144 type_onset = specdiff;144 type_onset = aubio_onset_specdiff; 145 145 else if (strcmp(optarg,"hfc") == 0) 146 type_onset = hfc;146 type_onset = aubio_onset_hfc; 147 147 else if (strcmp(optarg,"complexdomain") == 0) 148 type_onset = complexdomain; 148 type_onset = aubio_onset_complex; 149 else if (strcmp(optarg,"complex") == 0) 150 type_onset = aubio_onset_complex; 149 151 else if (strcmp(optarg,"phase") == 0) 150 type_onset = phase; 152 type_onset = aubio_onset_phase; 153 else if (strcmp(optarg,"mkl") == 0) 154 type_onset = aubio_onset_mkl; 155 else if (strcmp(optarg,"kl") == 0) 156 type_onset = aubio_onset_kl; 151 157 else { 152 158 debug("could not get onset type.\n"); -
plugins/puredata/aubioonset~.c
ra29ad46 r5cf415f 71 71 x->hopsize = x->bufsize / 2; 72 72 73 x->o = new_aubio_onsetdetection( complexdomain, x->bufsize, 1);73 x->o = new_aubio_onsetdetection(aubio_onset_complex, x->bufsize, 1); 74 74 x->vec = (fvec_t *)new_fvec(x->hopsize,1); 75 75 x->pv = new_aubio_pvoc(x->bufsize, x->hopsize, 1); -
python/aubio/aubioclass.py
ra29ad46 r5cf415f 80 80 self.pv = pvoc(bufsize,hopsize,channels) 81 81 if mode in ['dual'] : 82 self.myod = onsetdetection( hfc,bufsize,channels)83 self.myod2 = onsetdetection( complexdomain,bufsize,channels)82 self.myod = onsetdetection(aubio_onset_hfc,bufsize,channels) 83 self.myod2 = onsetdetection(aubio_onset_complex,bufsize,channels) 84 84 self.myonset = fvec(1,channels) 85 85 self.myonset2 = fvec(1,channels) … … 105 105 else: self.myonset.set(0.,0,0) 106 106 return self.pp.do(self.myonset),self.myonset.get(0,0) 107 108 def check_onset_mode(option, opt, value, parser): 109 nvalue = parser.rargs[0] 110 if nvalue == 'complexdomain' or nvalue == 'complex' : 111 setattr(parser.values, option.dest, aubio_onset_complex) 112 elif nvalue == 'hfc' : 113 setattr(parser.values, option.dest, aubio_onset_hfc) 114 elif nvalue == 'phase' : 115 setattr(parser.values, option.dest, aubio_onset_phase) 116 elif nvalue == 'specdiff' : 117 setattr(parser.values, option.dest, aubio_onset_specdiff) 118 elif nvalue == 'energy' : 119 setattr(parser.values, option.dest, aubio_onset_energy) 120 elif nvalue == 'kl' : 121 setattr(parser.values, option.dest, aubio_onset_kl) 122 elif nvalue == 'mkl' : 123 setattr(parser.values, option.dest, aubio_onset_mkl) 124 elif nvalue == 'dual' : 125 setattr(parser.values, option.dest, 'dual') 126 else: 127 print "unknown detection function selected\n", usage 128 sys.exit(1) 129 130 def check_pitch_mode(option, opt, value, parser): 131 nvalue = parser.rargs[0] 132 if nvalue == 'mcomb' : 133 setattr(parser.values, option.dest, aubio_pitch_mcomb) 134 elif nvalue == 'yin' : 135 setattr(parser.values, option.dest, aubio_pitch_yin) 136 elif nvalue == 'fcomb' : 137 setattr(parser.values, option.dest, aubio_pitch_fcomb) 138 elif nvalue == 'schmitt' : 139 setattr(parser.values, option.dest, aubio_pitch_schmitt) 140 else: 141 print "unknown detection function selected\n", usage 142 sys.exit(1) 143 107 144 108 145 def getonsets(filein,threshold=0.2,silence=-70.,bufsize=1024,hopsize=512, -
python/aubiocut
ra29ad46 r5cf415f 10 10 usage = "usage: %s [options] -i soundfile" % sys.argv[0] 11 11 12 def check_mode(option, opt, value, parser):13 nvalue = parser.rargs[0]14 if nvalue == 'complexdomain' :15 setattr(parser.values, option.dest, complexdomain)16 elif nvalue == 'hfc' :17 setattr(parser.values, option.dest, hfc)18 elif nvalue == 'phase' :19 setattr(parser.values, option.dest, phase)20 elif nvalue == 'specdiff' :21 setattr(parser.values, option.dest, specdiff)22 elif nvalue == 'energy' :23 setattr(parser.values, option.dest, energy)24 elif nvalue == 'kl' :25 setattr(parser.values, option.dest, kl)26 elif nvalue == 'mkl' :27 setattr(parser.values, option.dest, mkl)28 elif nvalue == 'dual' :29 setattr(parser.values, option.dest, 'dual')30 else:31 print "unknown detection function selected\n", usage32 sys.exit(1)33 34 12 def parse_args(): 35 13 from optparse import OptionParser … … 39 17 help="input sound file") 40 18 parser.add_option("-m","--mode", action="callback", 41 callback=check_ mode, dest="mode", default='dual',19 callback=check_onset_mode, dest="mode", default='dual', 42 20 help="onset detection mode [default=dual] \ 43 21 complexdomain|hfc|phase|specdiff|energy|kl|mkl|dual") -
python/aubiopitch
ra29ad46 r5cf415f 11 11 usage = "usage: %s [options] -i soundfile" % sys.argv[0] 12 12 13 def check_mode(option, opt, value, parser):14 nvalue = parser.rargs[0]15 if nvalue == 'mcomb' :16 setattr(parser.values, option.dest, aubio_pitch_mcomb)17 elif nvalue == 'yin' :18 setattr(parser.values, option.dest, aubio_pitch_yin)19 elif nvalue == 'fcomb' :20 setattr(parser.values, option.dest, aubio_pitch_fcomb)21 elif nvalue == 'schmitt' :22 setattr(parser.values, option.dest, aubio_pitch_schmitt)23 24 13 25 14 def parse_args(): … … 30 19 help="input sound file") 31 20 parser.add_option("-m","--mode", action="callback", 32 callback=check_mode, dest="mode", default=aubio_pitch_mcomb, 21 callback=check_pitch_mode, dest="mode", 22 default=aubio_pitch_mcomb, 33 23 help="pitch detection mode [default=mcomb] \ 34 24 mcomb|yin|fcomb|schmitt") -
src/onsetdetection.c
ra29ad46 r5cf415f 208 208 switch(type) { 209 209 /* for both energy and hfc, only fftgrain->norm is required */ 210 case energy:211 break; 212 case hfc:210 case aubio_onset_energy: 211 break; 212 case aubio_onset_hfc: 213 213 break; 214 214 /* the other approaches will need some more memory spaces */ 215 case complexdomain:215 case aubio_onset_complex: 216 216 o->oldmag = new_fvec(rsize,channels); 217 217 /** bug: must be complex array */ … … 221 221 o->theta2 = new_fvec(rsize,channels); 222 222 break; 223 case phase:223 case aubio_onset_phase: 224 224 o->dev1 = new_fvec(rsize,channels); 225 225 o->theta1 = new_fvec(rsize,channels); … … 228 228 o->threshold = 0.1; 229 229 break; 230 case specdiff:230 case aubio_onset_specdiff: 231 231 o->oldmag = new_fvec(rsize,channels); 232 232 o->dev1 = new_fvec(rsize,channels); … … 234 234 o->threshold = 0.1; 235 235 break; 236 case kl:236 case aubio_onset_kl: 237 237 o->oldmag = new_fvec(rsize,channels); 238 238 break; 239 case mkl:239 case aubio_onset_mkl: 240 240 o->oldmag = new_fvec(rsize,channels); 241 241 break; … … 249 249 250 250 switch(type) { 251 case energy:251 case aubio_onset_energy: 252 252 o->funcpointer = aubio_onsetdetection_energy; 253 253 break; 254 case hfc:254 case aubio_onset_hfc: 255 255 o->funcpointer = aubio_onsetdetection_hfc; 256 256 break; 257 case complexdomain:257 case aubio_onset_complex: 258 258 o->funcpointer = aubio_onsetdetection_complex; 259 259 break; 260 case phase:260 case aubio_onset_phase: 261 261 o->funcpointer = aubio_onsetdetection_phase; 262 262 break; 263 case specdiff:263 case aubio_onset_specdiff: 264 264 o->funcpointer = aubio_onsetdetection_specdiff; 265 265 break; 266 case kl:266 case aubio_onset_kl: 267 267 o->funcpointer = aubio_onsetdetection_kl; 268 268 break; 269 case mkl:269 case aubio_onset_mkl: 270 270 o->funcpointer = aubio_onsetdetection_mkl; 271 271 break; … … 281 281 switch(o->type) { 282 282 /* for both energy and hfc, only fftgrain->norm is required */ 283 case energy:284 break; 285 case hfc:283 case aubio_onset_energy: 284 break; 285 case aubio_onset_hfc: 286 286 break; 287 287 /* the other approaches will need some more memory spaces */ 288 case complexdomain:288 case aubio_onset_complex: 289 289 AUBIO_FREE(o->meas); 290 290 del_fvec(o->oldmag); … … 293 293 del_fvec(o->theta2); 294 294 break; 295 case phase:295 case aubio_onset_phase: 296 296 del_fvec(o->dev1); 297 297 del_fvec(o->theta1); … … 299 299 del_aubio_hist(o->histog); 300 300 break; 301 case specdiff:301 case aubio_onset_specdiff: 302 302 del_fvec(o->oldmag); 303 303 del_fvec(o->dev1); -
src/onsetdetection.h
ra29ad46 r5cf415f 50 50 /** onsetdetection types */ 51 51 typedef enum { 52 energy,/**< energy based */53 54 hfc,/**< high frequency content */55 complexdomain,/**< complex domain */56 phase,/**< phase fast */57 kl, /**< Kullback Liebler (Hainsworth et al., Onset detection in musical audio signals) */58 mkl /**< modified Kullback Liebler (Hainsworth et al., Onset detection in musical audio signals) */52 aubio_onset_energy, /**< energy based */ 53 aubio_onset_specdiff, /**< spectral diff */ 54 aubio_onset_hfc, /**< high frequency content */ 55 aubio_onset_complex, /**< complex domain */ 56 aubio_onset_phase, /**< phase fast */ 57 aubio_onset_kl, /**< Kullback Liebler (Hainsworth et al., Onset detection in musical audio signals) */ 58 aubio_onset_mkl /**< modified Kullback Liebler (Hainsworth et al., Onset detection in musical audio signals) */ 59 59 } aubio_onsetdetection_type; 60 60 -
swig/aubio.i
ra29ad46 r5cf415f 139 139 140 140 /* onset detection */ 141 typedef enum { energy, specdiff, hfc, complexdomain, phase, kl, mkl } aubio_onsetdetection_type; 141 typedef enum { 142 aubio_onset_energy, 143 aubio_onset_specdiff, 144 aubio_onset_hfc, 145 aubio_onset_complex, 146 aubio_onset_phase, 147 aubio_onset_kl, 148 aubio_onset_mkl 149 } aubio_onsetdetection_type; 142 150 aubio_onsetdetection_t * new_aubio_onsetdetection(aubio_onsetdetection_type type, uint_t size, uint_t channels); 143 151 void aubio_onsetdetection(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset); … … 146 154 /* should these still be exposed ? */ 147 155 void aubio_onsetdetection_energy (aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset); 148 void aubio_onsetdetection_hfc 156 void aubio_onsetdetection_hfc (aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset); 149 157 void aubio_onsetdetection_complex (aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset); 150 158 void aubio_onsetdetection_phase (aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset); 151 159 void aubio_onsetdetection_specdiff(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset); 160 void aubio_onsetdetection_kl (aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset); 161 void aubio_onsetdetection_mkl (aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset); 152 162 153 163 /* pvoc */
Note: See TracChangeset
for help on using the changeset viewer.