Changeset fe163ad for plugins


Ignore:
Timestamp:
Oct 15, 2009, 6:54:23 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:
515c7b2
Parents:
cd77c15
Message:

src/pitch: use a string to set pitch method, add a new function to set pitch unit, keep pitch enums private, update pitch methods where they are used

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/puredata/aubiopitch~.c

    rcd77c15 rfe163ad  
    1313
    1414char aubiopitch_version[] = "aubiopitch~ version 0.1";
    15 
    16 aubio_pitchdetection_type type_pitch = aubio_pitch_yinfft;
    17 aubio_pitchdetection_mode mode_pitch = aubio_pitchm_freq;
    1815
    1916static t_class *aubiopitch_tilde_class;
     
    7976        x->hopsize   = x->bufsize / 2;
    8077
    81         if (strcmp(s->s_name,"mcomb") == 0)
    82                 type_pitch = aubio_pitch_mcomb;
    83         else if (strcmp(s->s_name,"yinfft") == 0)
    84                 type_pitch = aubio_pitch_yin;
    85         else if (strcmp(s->s_name,"yin") == 0)
    86                 type_pitch = aubio_pitch_yin;
    87         else if (strcmp(s->s_name,"schmitt") == 0)
    88                 type_pitch = aubio_pitch_schmitt;
    89         else if (strcmp(s->s_name,"fcomb") == 0)
    90                 type_pitch = aubio_pitch_fcomb;
    91         else {
    92                 post("unknown pitch type, using default.\n");
    93         }
    94 
    9578        //FIXME: get the real samplerate
    96         x->o = new_aubio_pitchdetection(x->bufsize,
    97                     x->hopsize, 1, 44100., type_pitch, mode_pitch);
     79    x->o = new_aubio_pitchdetection(s->s_name, x->bufsize,
     80            x->hopsize, 1, 44100.);
    9881        aubio_pitchdetection_set_tolerance (x->o, 0.7);
    9982        x->vec = (fvec_t *)new_fvec(x->hopsize,1);
Note: See TracChangeset for help on using the changeset viewer.