Changeset dc467b5d for src/tempo/beattracking.c
- Timestamp:
- Oct 27, 2013, 12:44:29 PM (10 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:
- 8247249
- Parents:
- dd15573 (diff), 7fc5ba2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tempo/beattracking.c
rdd15573 rdc467b5d 171 171 /* find non-zero Rayleigh period */ 172 172 maxindex = fvec_max_elem (bt->acfout); 173 bt->rp = maxindex ? fvec_quad int(bt->acfout, maxindex) : 1;173 bt->rp = maxindex ? fvec_quadratic_peak_pos (bt->acfout, maxindex) : 1; 174 174 //rp = (maxindex==127) ? 43 : maxindex; //rayparam 175 175 bt->rp = (maxindex == bt->acfout->length - 1) ? bt->rayparam : maxindex; //rayparam … … 183 183 /* end of biased filterbank */ 184 184 185 if (bp == 0) { 186 output->data[0] = 0; 187 return; 188 } 185 189 186 190 /* deliberate integer operation, could be set to 3 max eventually */ … … 204 208 phase = step - bt->lastbeat; 205 209 } else { 206 phase = fvec_quad int(bt->phout, maxindex);210 phase = fvec_quadratic_peak_pos (bt->phout, maxindex); 207 211 } 208 212 /* take back one frame delay */ … … 306 310 } 307 311 fvec_weight (acfout, bt->gwv); 308 gp = fvec_quad int(acfout, fvec_max_elem (acfout));312 gp = fvec_quadratic_peak_pos (acfout, fvec_max_elem (acfout)); 309 313 /* 310 314 while(gp<32) gp =gp*2; … … 382 386 383 387 /* if tempo is > 206 bpm, half it */ 384 while ( bp < 25) {388 while (0 < bp && bp < 25) { 385 389 #if AUBIO_BEAT_WARNINGS 386 390 AUBIO_WRN ("doubling from %f (%f bpm) to %f (%f bpm)\n", … … 409 413 aubio_beattracking_get_bpm (aubio_beattracking_t * bt) 410 414 { 411 if (bt-> timesig != 0 && bt->counter == 0 && bt->flagstep == 0) {412 return 5168. / fvec_quad int(bt->acfout, bt->bp);415 if (bt->bp != 0 && bt->timesig != 0 && bt->counter == 0 && bt->flagstep == 0) { 416 return 5168. / fvec_quadratic_peak_pos (bt->acfout, bt->bp); 413 417 } else { 414 418 return 0.;
Note: See TracChangeset
for help on using the changeset viewer.