Changeset 56ef7e1 for src/tempo


Ignore:
Timestamp:
Oct 18, 2009, 3:08:59 PM (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:
e5f49af
Parents:
74516f7
Message:

Change peakpicker to match API specs, make quadint per channel

  • src/mathutils.c
    • add per channel mean and median
    • update moving thres and adapt_thres accordingly
    • change quadint unused span argument to a channel argument
  • src/onset/onset.c:
    • make wasonset a vector for multi channel, use new peakpicker
  • src/onset/peakpick.c:
    • update peakpicker do for multi channeling
  • src/pitch/: update use to fvec_quadint
  • src/tempo/beattracking.c: update calls to fvec_quadint
  • src/tempo/tempo.c: update peakpicker usage
  • tests/src/test-peakpick.c: update peakpicker usage
Location:
src/tempo
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/tempo/beattracking.c

    r74516f7 r56ef7e1  
    170170  /* find non-zero Rayleigh period */
    171171  maxindex = fvec_max_elem (bt->acfout);
    172   bt->rp = maxindex ? fvec_quadint (bt->acfout, maxindex, 1) : 1;
     172  bt->rp = maxindex ? fvec_quadint (bt->acfout, maxindex, 0) : 1;
    173173  //rp = (maxindex==127) ? 43 : maxindex; //rayparam
    174174  bt->rp = (maxindex == bt->acfout->length - 1) ? bt->rayparam : maxindex;      //rayparam
     
    203203    phase = step - bt->lastbeat;
    204204  } else {
    205     phase = fvec_quadint (bt->phout, maxindex, 1);
     205    phase = fvec_quadint (bt->phout, maxindex, 0);
    206206  }
    207207  /* take back one frame delay */
     
    305305    }
    306306    fvec_weight (acfout, bt->gwv);
    307     gp = fvec_quadint (acfout, fvec_max_elem (acfout), 1);
     307    gp = fvec_quadint (acfout, fvec_max_elem (acfout), 0);
    308308    /*
    309309       while(gp<32) gp =gp*2;
     
    409409{
    410410  if (bt->timesig != 0 && bt->counter == 0 && bt->flagstep == 0) {
    411     return 5168. / fvec_quadint (bt->acfout, bt->bp, 1);
     411    return 5168. / fvec_quadint (bt->acfout, bt->bp, 0);
    412412  } else {
    413413    return 0.;
  • src/tempo/tempo.c

    r74516f7 r56ef7e1  
    3838  fvec_t * dfframe;              /** peak picked detection function buffer */
    3939  fvec_t * out;                  /** beat tactus candidates */
     40  fvec_t * onset;                /** onset results */
     41  fvec_t * peek;                 /** thresholded onset function */
    4042  smpl_t silence;                /** silence parameter */
    4143  smpl_t threshold;              /** peak picking threshold */
     
    7072  }
    7173  o->blockpos++;
    72   tempo->data[0][1] = aubio_peakpicker_do (o->pp, o->of);
     74  aubio_peakpicker_do (o->pp, o->of, o->onset);
     75  tempo->data[0][1] = o->onset->data[0][0];
    7376  o->dfframe->data[0][winlen - step + o->blockpos] =
    7477    aubio_peakpicker_get_thresholded_input(o->pp);
     
    115118  o->out      = new_fvec(o->step,channels);
    116119  o->pv       = new_aubio_pvoc(buf_size, hop_size, channels);
    117   o->pp       = new_aubio_peakpicker(o->threshold);
     120  o->pp       = new_aubio_peakpicker(channels);
     121  aubio_peakpicker_set_threshold (o->pp, o->threshold);
    118122  o->od       = new_aubio_onsetdetection(onset_mode,buf_size,channels);
    119123  o->of       = new_fvec(1, channels);
    120124  o->bt       = new_aubio_beattracking(o->winlen,channels);
     125  o->onset    = new_fvec(1, channels);
     126  o->peek     = new_fvec(3, channels);
    121127  /*if (usedoubled)    {
    122128    o2 = new_aubio_onsetdetection(type_onset2,buffer_size,channels);
     
    144150  del_cvec(o->fftgrain);
    145151  del_fvec(o->dfframe);
     152  del_fvec(o->onset);
     153  del_fvec(o->peek);
    146154  AUBIO_FREE(o);
    147155  return;
Note: See TracChangeset for help on using the changeset viewer.