Changeset 61316a6


Ignore:
Timestamp:
Oct 8, 2009, 8:54:49 PM (12 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
3027c6e
Parents:
05773a2c
Message:

examples plugins: update to latest pitch prototypes

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • examples/aubionotes.c

    r05773a2c r61316a6  
    4646      isonset = aubio_peakpicker_do(parms, onset);
    4747     
    48       pitch = aubio_pitchdetection_do (pitchdet,ibuf);
     48      aubio_pitchdetection_do (pitchdet, ibuf, pitch_obuf);
     49      pitch = fvec_read_sample(pitch_obuf, 0, 0);
    4950      if(median){
    5051              note_append(note_buffer, pitch);
  • examples/utils.c

    r05773a2c r61316a6  
    6262fvec_t *ibuf;
    6363fvec_t *obuf;
     64fvec_t *pitch_obuf;
    6465cvec_t *fftgrain;
    6566fvec_t *woodblock;
     
    319320    pitchdet = new_aubio_pitchdetection (buffer_size * 4,
    320321        overlap_size, channels, samplerate, type_pitch, mode_pitch);
    321     aubio_pitchdetection_set_yinthresh (pitchdet, 0.7);
     322    aubio_pitchdetection_set_tolerance (pitchdet, 0.7);
     323    pitch_obuf = new_fvec (1, channels);
    322324
    323325    if (median) {
     
    350352      del_fvec (note_buffer2);
    351353    }
     354    del_fvec (pitch_obuf);
    352355  }
    353356  if (usedoubled) {
  • examples/utils.h

    r05773a2c r61316a6  
    9595extern fvec_t *ibuf;
    9696extern fvec_t *obuf;
     97extern fvec_t *pitch_obuf;
    9798extern cvec_t *fftgrain;
    9899extern fvec_t *woodblock;
  • plugins/puredata/aubiopitch~.c

    r05773a2c r61316a6  
    3131        aubio_pitchdetection_t *o;
    3232        fvec_t *vec;
     33        fvec_t *pitchvec;
    3334        t_outlet *pitch;
    3435} t_aubiopitch_tilde;
     
    4041        int n                 = (int)(w[3]);
    4142        int j;
    42         smpl_t pitch;
    4343        for (j=0;j<n;j++) {
    4444                /* write input to datanew */
     
    4747                if (x->pos == x->hopsize-1) {         
    4848                        /* block loop */
    49                         pitch = aubio_pitchdetection(x->o,x->vec);
    50                         outlet_float(x->pitch, pitch);
     49                        aubio_pitchdetection_do(x->o,x->vec, x->pitchvec);
     50                        outlet_float(x->pitch, x->pitchvec->data[0][0]);
    5151                        /* end of block loop */
    5252                        x->pos = -1; /* so it will be zero next j loop */
     
    9696        x->o = new_aubio_pitchdetection(x->bufsize,
    9797                    x->hopsize, 1, 44100., type_pitch, mode_pitch);
    98         aubio_pitchdetection_set_yinthresh(x->o, 0.7);
     98        aubio_pitchdetection_set_tolerance (x->o, 0.7);
    9999        x->vec = (fvec_t *)new_fvec(x->hopsize,1);
     100        x->pitchvec = (fvec_t *)new_fvec(1,1);
    100101
    101102        //floatinlet_new (&x->x_obj, &x->threshold);
     
    110111        del_aubio_pitchdetection(x->o);
    111112        del_fvec(x->vec);
     113        del_fvec(x->pitchvec);
    112114        return 0;
    113115}
Note: See TracChangeset for help on using the changeset viewer.