Changeset 3de10bb for src/tempo


Ignore:
Timestamp:
Sep 27, 2009, 2:19:49 AM (10 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
17b7d66
Parents:
e792ea8
Message:

src/tempo/beattracking.c: fix maxindex == winlen never reached condition, avoiding very large bpm values, add some debugging strings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tempo/beattracking.c

    re792ea8 r3de10bb  
    194194  /* find Rayleigh period */
    195195  maxindex = vec_max_elem (bt->phout);
    196   if (maxindex == winlen)
    197     maxindex = 0;
    198   phase = 1. + vec_quadint (bt->phout, maxindex, 1);
     196  if (maxindex >= winlen - 1) {
     197    // AUBIO_WRN ("damned, no idea what this groove is\n");
     198    phase = step - bt->lastbeat;
     199  } else {
     200    phase = vec_quadint (bt->phout, maxindex, 1);
     201  }
    199202#if 0                           // debug metronome mode
    200203  phase = step - bt->lastbeat;
     
    206209  i = 1;
    207210  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);
    208213  /* start counting the beats */
     214  while (beat + bp < 0) {
     215    beat += bp;
     216  }
     217
    209218  if (beat >= 0) {
     219    //AUBIO_DBG ("beat: %d, %f, %f\n", i, bp, beat);
    210220    output->data[0][i] = beat;
    211221    i++;
     
    214224  while (beat + bp <= step) {
    215225    beat += bp;
     226    //AUBIO_DBG ("beat: %d, %f, %f\n", i, bp, beat);
    216227    output->data[0][i] = beat;
    217228    i++;
Note: See TracChangeset for help on using the changeset viewer.