Changeset 4d7ced9


Ignore:
Timestamp:
Jul 13, 2008, 9:56:02 PM (16 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:
6f9615c
Parents:
5288874
Message:

plugins/puredata/aubiopitch~.c: add optional creation argument to select pitch method, fix buffer size

File:
1 edited

Legend:

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

    r5288874 r4d7ced9  
    1010#include <m_pd.h>
    1111#include <aubio.h>
     12#include <string.h>
    1213
    1314char aubiopitch_version[] = "aubiopitch~ version 0.1";
     
    7071
    7172//static void *aubiopitch_tilde_new (t_floatarg f)
    72 static void *aubiopitch_tilde_new (void)
     73static void *aubiopitch_tilde_new (t_symbol * s)
    7374{
    7475        t_aubiopitch_tilde *x =
     
    7879        x->hopsize   = x->bufsize / 2;
    7980
     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
    8095        //FIXME: get the real samplerate
    81         x->o = new_aubio_pitchdetection(x->bufsize*4,
     96        x->o = new_aubio_pitchdetection(x->bufsize,
    8297                    x->hopsize, 1, 44100., type_pitch, mode_pitch);
    8398        aubio_pitchdetection_set_yinthresh(x->o, 0.7);
     
    104119                        (t_method)aubiopitch_tilde_del,
    105120                        sizeof (t_aubiopitch_tilde),
    106                         CLASS_DEFAULT, A_DEFFLOAT, 0);
     121                        CLASS_DEFAULT, A_DEFSYMBOL, 0);
    107122        class_addmethod(aubiopitch_tilde_class,
    108123                        (t_method)aubiopitch_tilde_dsp,
Note: See TracChangeset for help on using the changeset viewer.