Changeset 8b884ef


Ignore:
Timestamp:
Apr 9, 2013, 7:49:36 PM (12 years ago)
Author:
Paul Brossier <piem@piem.org>
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:
483b883
Parents:
dee4164
Message:

src/onset/: rename get_last_onset to get_last

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • python/demos/demo_onset.py

    rdee4164 r8b884ef  
    2929    samples, read = s()
    3030    if o(samples):
    31         print "%f" % o.get_last_onset_s()
    32         onsets.append(o.get_last_onset())
     31        print "%f" % o.get_last_s()
     32        onsets.append(o.get_last())
    3333    total_frames += read
    3434    if read < hop_s: break
  • python/demos/demo_onset_plot.py

    rdee4164 r8b884ef  
    3434while True:
    3535    samples, read = s()
    36     is_onset = o(samples)
    37     if is_onset:
    38         this_onset = o.get_last_onset()
    39         print "%f" % (this_onset / float(samplerate))
    40         onsets.append(this_onset)
     36    if o(samples):
     37        print "%f" % (o.get_last_s())
     38        onsets.append(o.get_last())
    4139    # keep some data to plot it later
    4240    new_maxes = (abs(samples.reshape(hop_s/downsample, downsample))).max(axis=0)
  • src/onset/onset.c

    rdee4164 r8b884ef  
    5959      isonset  = 0;
    6060    } else {
    61       uint_t new_onset = o->total_frames + isonset * o->hop_size;
     61      uint_t new_onset = o->total_frames + (uint_t)ROUND(isonset * o->hop_size);
    6262      if (o->last_onset + o->minioi < new_onset) {
    6363        //AUBIO_DBG ("accepted detection, marking as onset\n");
     
    8181}
    8282
    83 smpl_t aubio_onset_get_last_onset (aubio_onset_t *o)
     83uint_t aubio_onset_get_last (aubio_onset_t *o)
    8484{
    8585  return o->last_onset - o->delay;
    8686}
    8787
    88 smpl_t aubio_onset_get_last_onset_s (aubio_onset_t *o)
     88smpl_t aubio_onset_get_last_s (aubio_onset_t *o)
    8989{
    90   return aubio_onset_get_last_onset (o) / (smpl_t) (o->samplerate);
     90  return aubio_onset_get_last (o) / (smpl_t) (o->samplerate);
    9191}
    9292
    93 smpl_t aubio_onset_get_last_onset_ms (aubio_onset_t *o)
     93smpl_t aubio_onset_get_last_ms (aubio_onset_t *o)
    9494{
    95   return aubio_onset_get_last_onset_s (o) / 1000.;
     95  return aubio_onset_get_last_s (o) / 1000.;
    9696}
    9797
  • src/onset/onset.h

    rdee4164 r8b884ef  
    9292
    9393*/
    94 smpl_t aubio_onset_get_last_onset (aubio_onset_t *o);
     94uint_t aubio_onset_get_last (aubio_onset_t *o);
    9595
    9696/** get the time of the latest onset detected, in seconds
     
    9999
    100100*/
    101 smpl_t aubio_onset_get_last_onset_s (aubio_onset_t *o);
     101smpl_t aubio_onset_get_last_s (aubio_onset_t *o);
    102102
    103103/** get the time of the latest onset detected, in milliseconds
     
    106106
    107107*/
    108 smpl_t aubio_onset_get_last_onset_ms (aubio_onset_t *o);
     108smpl_t aubio_onset_get_last_ms (aubio_onset_t *o);
    109109
    110110/** set onset detection silence threshold
Note: See TracChangeset for help on using the changeset viewer.