Changeset 422edfb


Ignore:
Timestamp:
Oct 6, 2009, 5:02:54 PM (15 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:
eb089fb
Parents:
020d80e
Message:

src/onset/peakpick.h: clean up peakpicker object

Location:
src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/onset/onset.c

    r020d80e r422edfb  
    5151    onset->data[0][0] *= onset2->data[0][0];
    5252  }*/
    53   isonset = aubio_peakpick_pimrt(o->of,o->pp);
     53  isonset = aubio_peakpicker_do(o->pp, o->of);
    5454  if (isonset > 0.) {
    5555    if (aubio_silence_detection(input, o->silence)==1) {
  • src/onset/peakpick.c

    r020d80e r422edfb  
    6868 * is slightly more permissive than the offline one, and yelds to an increase
    6969 * of false positives. best  */
    70 smpl_t aubio_peakpick_pimrt(fvec_t * onset,  aubio_pickpeak_t * p) {
     70smpl_t aubio_peakpicker_do(aubio_pickpeak_t * p, fvec_t * onset) {
    7171        fvec_t * onset_keep = (fvec_t *)p->onset_keep;
    7272        fvec_t * onset_proc = (fvec_t *)p->onset_proc;
     
    121121 * after smoothing
    122122 */
    123 smpl_t aubio_peakpick_pimrt_getval(aubio_pickpeak_t * p)
     123smpl_t aubio_peakpicker_get_thresholded_input(aubio_pickpeak_t * p)
    124124{
    125         uint_t i = 0;
    126         return p->onset_peek->data[i][1];
     125        return p->onset_peek->data[0][1];
    127126}
    128127
    129128/** function added by Miguel Ramirez to return the onset detection amplitude in peakval */
    130 uint_t aubio_peakpick_pimrt_wt(fvec_t * onset,  aubio_pickpeak_t * p, smpl_t* peakval)
    131 {
    132         uint_t isonset = 0;
    133         isonset = aubio_peakpick_pimrt(onset,p);
    134 
    135         //if ( isonset && peakval != NULL )
    136         if ( peakval != NULL )
    137                 *peakval = aubio_peakpick_pimrt_getval(p);
    138 
    139         return isonset;
    140 }
    141 
    142129void aubio_peakpicker_set_threshold(aubio_pickpeak_t * p, smpl_t threshold) {
    143130        p->threshold = threshold;
  • src/onset/peakpick.h

    r020d80e r422edfb  
    4141aubio_pickpeak_t * new_aubio_peakpicker(smpl_t threshold);
    4242/** real time peak picking function */
    43 smpl_t aubio_peakpick_pimrt(fvec_t * DF, aubio_pickpeak_t * p);
    44 /** function added by Miguel Ramirez to return the onset detection amplitude in peakval */
    45 uint_t aubio_peakpick_pimrt_wt( fvec_t* DF, aubio_pickpeak_t* p, smpl_t* peakval );
     43smpl_t aubio_peakpicker_do(aubio_pickpeak_t * p, fvec_t * DF);
    4644/** get current peak value */
    47 smpl_t aubio_peakpick_pimrt_getval(aubio_pickpeak_t * p);
     45smpl_t aubio_peakpicker_get_thresholded_input(aubio_pickpeak_t * p);
    4846/** destroy peak picker structure */
    4947void del_aubio_peakpicker(aubio_pickpeak_t * p);
  • src/tempo/tempo.c

    r020d80e r422edfb  
    6969  }
    7070  o->blockpos++;
    71   tempo->data[0][1] = aubio_peakpick_pimrt_wt(o->of,o->pp,
    72     &(o->dfframe->data[0][winlen - step + o->blockpos]));
     71  tempo->data[0][1] = aubio_peakpicker_do (o->pp, o->of);
     72  o->dfframe->data[0][winlen - step + o->blockpos] =
     73    aubio_peakpicker_get_thresholded_input(o->pp);
    7374  /* end of second level loop */
    7475  tempo->data[0][0] = 0; /* reset tactus */
Note: See TracChangeset for help on using the changeset viewer.