Changeset 5cf415f for src


Ignore:
Timestamp:
Aug 9, 2005, 8:35:14 PM (19 years ago)
Author:
Paul Brossier <piem@altern.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:
b1f723d
Parents:
a29ad46
Message:

protected onset enumerators, factorise python check_modes

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/onsetdetection.c

    ra29ad46 r5cf415f  
    208208        switch(type) {
    209209                /* for both energy and hfc, only fftgrain->norm is required */
    210                 case energy:
    211                         break;
    212                 case hfc:
     210                case aubio_onset_energy:
     211                        break;
     212                case aubio_onset_hfc:
    213213                        break;
    214214                /* the other approaches will need some more memory spaces */
    215                 case complexdomain:
     215                case aubio_onset_complex:
    216216                        o->oldmag = new_fvec(rsize,channels);
    217217                        /** bug: must be complex array */
     
    221221                        o->theta2 = new_fvec(rsize,channels);
    222222                        break;
    223                 case phase:
     223                case aubio_onset_phase:
    224224                        o->dev1  = new_fvec(rsize,channels);
    225225                        o->theta1 = new_fvec(rsize,channels);
     
    228228                        o->threshold = 0.1;
    229229                        break;
    230                 case specdiff:
     230                case aubio_onset_specdiff:
    231231                        o->oldmag = new_fvec(rsize,channels);
    232232                        o->dev1   = new_fvec(rsize,channels);
     
    234234                        o->threshold = 0.1;
    235235                        break;
    236                 case kl:
     236                case aubio_onset_kl:
    237237                        o->oldmag = new_fvec(rsize,channels);
    238238                        break;
    239                 case mkl:
     239                case aubio_onset_mkl:
    240240                        o->oldmag = new_fvec(rsize,channels);
    241241                        break;
     
    249249
    250250        switch(type) {
    251                 case energy:
     251                case aubio_onset_energy:
    252252                        o->funcpointer = aubio_onsetdetection_energy;
    253253                        break;
    254                 case hfc:
     254                case aubio_onset_hfc:
    255255                        o->funcpointer = aubio_onsetdetection_hfc;
    256256                        break;
    257                 case complexdomain:
     257                case aubio_onset_complex:
    258258                        o->funcpointer = aubio_onsetdetection_complex;
    259259                        break;
    260                 case phase:
     260                case aubio_onset_phase:
    261261                        o->funcpointer = aubio_onsetdetection_phase;
    262262                        break;
    263                 case specdiff:
     263                case aubio_onset_specdiff:
    264264                        o->funcpointer = aubio_onsetdetection_specdiff;
    265265                        break;
    266                 case kl:
     266                case aubio_onset_kl:
    267267                        o->funcpointer = aubio_onsetdetection_kl;
    268268                        break;
    269                 case mkl:
     269                case aubio_onset_mkl:
    270270                        o->funcpointer = aubio_onsetdetection_mkl;
    271271                        break;
     
    281281        switch(o->type) {
    282282                /* for both energy and hfc, only fftgrain->norm is required */
    283                 case energy:
    284                         break;
    285                 case hfc:
     283                case aubio_onset_energy:
     284                        break;
     285                case aubio_onset_hfc:
    286286                        break;
    287287                /* the other approaches will need some more memory spaces */
    288                 case complexdomain:
     288                case aubio_onset_complex:
    289289                        AUBIO_FREE(o->meas);
    290290                        del_fvec(o->oldmag);
     
    293293                        del_fvec(o->theta2);
    294294                        break;
    295                 case phase:
     295                case aubio_onset_phase:
    296296                        del_fvec(o->dev1);
    297297                        del_fvec(o->theta1);
     
    299299                        del_aubio_hist(o->histog);
    300300                        break;
    301                 case specdiff:
     301                case aubio_onset_specdiff:
    302302                        del_fvec(o->oldmag);
    303303                        del_fvec(o->dev1);
  • src/onsetdetection.h

    ra29ad46 r5cf415f  
    5050/** onsetdetection types */
    5151typedef enum {
    52         energy,         /**< energy based */         
    53         specdiff,       /**< spectral diff */         
    54         hfc,            /**< high frequency content */
    55         complexdomain,  /**< complex domain */       
    56         phase,          /**< phase fast */           
    57         kl,             /**< Kullback Liebler (Hainsworth et al.,  Onset detection in musical audio signals) */
    58         mkl             /**< modified Kullback Liebler (Hainsworth et al.,  Onset detection in musical audio signals) */
     52        aubio_onset_energy,         /**< energy based */         
     53        aubio_onset_specdiff,       /**< spectral diff */         
     54        aubio_onset_hfc,            /**< high frequency content */
     55        aubio_onset_complex,        /**< complex domain */       
     56        aubio_onset_phase,          /**< phase fast */           
     57        aubio_onset_kl,             /**< Kullback Liebler (Hainsworth et al.,  Onset detection in musical audio signals) */
     58        aubio_onset_mkl             /**< modified Kullback Liebler (Hainsworth et al.,  Onset detection in musical audio signals) */
    5959} aubio_onsetdetection_type;
    6060
Note: See TracChangeset for help on using the changeset viewer.