Changeset 17b7d66
- Timestamp:
- Sep 28, 2009, 8:12:02 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:
- 258195f
- Parents:
- 3de10bb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tempo/beattracking.c
r3de10bb r17b7d66 22 22 #include "mathutils.h" 23 23 #include "tempo/beattracking.h" 24 25 /** define to 1 to print out tracking difficulties */ 26 #define AUBIO_BEAT_WARNINGS 1 24 27 25 28 uint_t fvec_gettimesig (fvec_t * acf, uint_t acflen, uint_t gp); … … 195 198 maxindex = vec_max_elem (bt->phout); 196 199 if (maxindex >= winlen - 1) { 197 // AUBIO_WRN ("damned, no idea what this groove is\n"); 200 #if AUBIO_BEAT_WARNINGS 201 AUBIO_WRN ("no idea what this groove's phase is\n"); 202 #endif /* AUBIO_BEAT_WARNINGS */ 198 203 phase = step - bt->lastbeat; 199 204 } else { 200 205 phase = vec_quadint (bt->phout, maxindex, 1); 201 206 } 207 /* take back one frame delay */ 208 phase += 1.; 202 209 #if 0 // debug metronome mode 203 210 phase = step - bt->lastbeat; … … 209 216 i = 1; 210 217 beat = bp - phase; 211 //AUBIO_DBG ("beat: %f, bp: %f, phase: %f, lastbeat: %f, step: %d, winlen: %d\n", 212 // beat, bp, phase, bt->lastbeat, step, winlen); 218 219 // AUBIO_DBG ("bp: %f, phase: %f, lastbeat: %f, step: %d, winlen: %d\n", 220 // bp, phase, bt->lastbeat, step, winlen); 221 222 /* the next beat will be earlier than 60% of the tempo period 223 skip this one */ 224 if ( ( step - bt->lastbeat - phase ) < -0.40 * bp ) { 225 #if AUBIO_BEAT_WARNINGS 226 AUBIO_WRN ("back off-beat error, skipping this beat\n"); 227 #endif /* AUBIO_BEAT_WARNINGS */ 228 beat += bp; 229 } 230 213 231 /* start counting the beats */ 214 232 while (beat + bp < 0) { … … 230 248 231 249 bt->lastbeat = beat; 232 /* store the number of beat foundin this frame as the first element */250 /* store the number of beats in this frame as the first element */ 233 251 output->data[0][0] = i; 234 252 } … … 364 382 /* if tempo is > 206 bpm, half it */ 365 383 while (bp < 25) { 366 //AUBIO_DBG("warning, doubling the beat period from %d\n", bp); 384 #if AUBIO_BEAT_WARNINGS 385 AUBIO_WRN ("doubling from %f (%f bpm) to %f (%f bpm)\n", 386 bp, 60.*44100./512./bp, bp/2., 60.*44100./512./bp/2. ); 367 387 //AUBIO_DBG("warning, halving the tempo from %f\n", 60.*samplerate/hopsize/bp); 388 #endif /* AUBIO_BEAT_WARNINGS */ 368 389 bp = bp * 2; 369 390 }
Note: See TracChangeset
for help on using the changeset viewer.