ref: edca23f0ac3361fd26a4b83d2a5588c451791bfb
parent: 0b530cbf3b532383ea84be81b610c7ff41f4d474
author: Paul Brossier <piem@altern.org>
date: Sun May 22 06:40:37 EDT 2005
add aubio_ to pitch detection modes add aubio_ to pitch detection modes
--- a/examples/utils.c
+++ b/examples/utils.c
@@ -58,7 +58,7 @@
/* 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 @@
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);
--- a/src/pitchdetection.c
+++ b/src/pitchdetection.c
@@ -52,11 +52,11 @@
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 @@
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 pitch = 0.;
uint_t i,j = 0;
switch(p->type) {
- case yin:
+ case aubio_yin:
/* do sliding window blocking */
for (i=0;i<p->buf->channels;i++){
for (j=0;j<p->buf->length-ibuf->length;j++){
@@ -110,7 +110,7 @@
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);
--- a/src/pitchdetection.h
+++ b/src/pitchdetection.h
@@ -24,15 +24,15 @@
#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;