Changeset df53936


Ignore:
Timestamp:
Mar 18, 2013, 4:49:02 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:
78a42e2
Parents:
93e3463
Message:

src/onset/onset.c: rename of to desc for clarity

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/onset/onset.c

    r93e3463 rdf53936  
    11/*
    2   Copyright (C) 2006-2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2006-2013 Paul Brossier <piem@aubio.org>
    33
    44  This file is part of aubio.
     
    3131struct _aubio_onset_t {
    3232  aubio_pvoc_t * pv;            /**< phase vocoder */
    33   aubio_specdesc_t * od;        /**< onset description function */
     33  aubio_specdesc_t * od;        /**< spectral descriptor */
    3434  aubio_peakpicker_t * pp;      /**< peak picker */
    3535  cvec_t * fftgrain;            /**< phase vocoder output */
    36   fvec_t * of;                  /**< onset detection function */
     36  fvec_t * desc;                /**< spectral description */
    3737  smpl_t threshold;             /**< onset peak picking threshold */
    3838  smpl_t silence;               /**< silence threhsold */
     
    5151  smpl_t isonset = 0;
    5252  aubio_pvoc_do (o->pv,input, o->fftgrain);
    53   aubio_specdesc_do (o->od,o->fftgrain, o->of);
    54   aubio_peakpicker_do(o->pp, o->of, onset);
     53  aubio_specdesc_do (o->od, o->fftgrain, o->desc);
     54  aubio_peakpicker_do(o->pp, o->desc, onset);
    5555  isonset = onset->data[0];
    5656  if (isonset > 0.) {
    5757    if (aubio_silence_detection(input, o->silence)==1) {
     58      //AUBIO_DBG ("silent onset, not marking as onset\n");
    5859      isonset  = 0;
    5960    } else {
    6061      uint_t new_onset = o->total_frames + isonset * o->hop_size;
    6162      if (o->last_onset + o->minioi < new_onset) {
     63        //AUBIO_DBG ("accepted detection, marking as onset\n");
    6264        o->last_onset = new_onset;
    6365      } else {
     66        //AUBIO_DBG ("doubled onset, not marking as onset\n");
    6467        isonset  = 0;
    6568      }
     
    155158
    156159smpl_t aubio_onset_get_descriptor(aubio_onset_t * o) {
    157   return o->of->data[0];
     160  return o->desc->data[0];
    158161}
    159162
     
    182185  o->od = new_aubio_specdesc(onset_mode,buf_size);
    183186  o->fftgrain = new_cvec(buf_size);
    184   o->of = new_fvec(1);
     187  o->desc = new_fvec(1);
    185188  return o;
    186189}
     
    191194  del_aubio_peakpicker(o->pp);
    192195  del_aubio_pvoc(o->pv);
    193   del_fvec(o->of);
     196  del_fvec(o->desc);
    194197  del_cvec(o->fftgrain);
    195198  AUBIO_FREE(o);
Note: See TracChangeset for help on using the changeset viewer.