From edca23f0ac3361fd26a4b83d2a5588c451791bfb Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Sun, 22 May 2005 10:40:37 +0000 Subject: [PATCH] add aubio_ to pitch detection modes add aubio_ to pitch detection modes --- examples/utils.c | 5 +++-- src/pitchdetection.c | 12 ++++++------ src/pitchdetection.h | 12 ++++++------ 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/examples/utils.c b/examples/utils.c index 6741840a..d4f88bbd 100644 --- a/examples/utils.c +++ b/examples/utils.c @@ -58,7 +58,7 @@ aubio_pickpeak_t * parms; /* pitch objects */ smpl_t pitch = 0.; aubio_pitchdetection_t * pitchdet; -aubio_pitchdetection_type mode = yin; // mcomb +aubio_pitchdetection_type mode = aubio_yin; // aubio_mcomb uint_t median = 6; fvec_t * note_buffer = NULL; @@ -217,7 +217,8 @@ void examples_common_init(int argc,char ** argv) { fftgrain = new_cvec(buffer_size, channels); if (usepitch) { - pitchdet = new_aubio_pitchdetection(buffer_size*4, overlap_size, channels, samplerate, mode, freq); + pitchdet = new_aubio_pitchdetection(buffer_size*4, + overlap_size, channels, samplerate, mode, aubio_freq); if (median) { note_buffer = new_fvec(median, 1); diff --git a/src/pitchdetection.c b/src/pitchdetection.c index 038988a0..71dbf5b9 100644 --- a/src/pitchdetection.c +++ b/src/pitchdetection.c @@ -52,11 +52,11 @@ aubio_pitchdetection_t * new_aubio_pitchdetection(uint_t bufsize, p->type = type; p->bufsize = bufsize; switch(p->type) { - case yin: + case aubio_yin: p->buf = new_fvec(bufsize,channels); p->yin = new_fvec(bufsize/2,channels); break; - case mcomb: + case aubio_mcomb: p->pv = new_aubio_pvoc(bufsize, hopsize, channels); p->fftgrain = new_cvec(bufsize, channels); p->filter = new_aubio_adsgn_filter((smpl_t)samplerate); @@ -70,11 +70,11 @@ aubio_pitchdetection_t * new_aubio_pitchdetection(uint_t bufsize, void del_aubio_pitchdetection(aubio_pitchdetection_t * p) { switch(p->type) { - case yin: + case aubio_yin: del_fvec(p->yin); del_fvec(p->buf); break; - case mcomb: + case aubio_mcomb: del_aubio_pvoc(p->pv); del_cvec(p->fftgrain); //del_aubio_adsgn_filter(p->filter); @@ -91,7 +91,7 @@ smpl_t aubio_pitchdetection(aubio_pitchdetection_t *p, fvec_t * ibuf) { smpl_t pitch = 0.; uint_t i,j = 0; switch(p->type) { - case yin: + case aubio_yin: /* do sliding window blocking */ for (i=0;ibuf->channels;i++){ for (j=0;jbuf->length-ibuf->length;j++){ @@ -110,7 +110,7 @@ smpl_t aubio_pitchdetection(aubio_pitchdetection_t *p, fvec_t * ibuf) { pitch = 0.; } break; - case mcomb: + case aubio_mcomb: aubio_filter_do(p->filter,ibuf); aubio_filter_do(p->filter,ibuf); aubio_pvoc_do(p->pv,ibuf,p->fftgrain); diff --git a/src/pitchdetection.h b/src/pitchdetection.h index 9ab49a1e..220a6bbc 100644 --- a/src/pitchdetection.h +++ b/src/pitchdetection.h @@ -24,15 +24,15 @@ extern "C" { #endif typedef enum { - yin, - mcomb + aubio_yin, + aubio_mcomb } aubio_pitchdetection_type; typedef enum { - freq, - midi, - cent, - bin + aubio_freq, + aubio_midi, + aubio_cent, + aubio_bin } aubio_pitchdetection_mode; typedef struct _aubio_pitchdetection_t aubio_pitchdetection_t; -- 2.26.2