From 129486275d99b061f4fe7f75afd395b61b0c1e81 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Wed, 7 Oct 2009 19:33:51 +0200 Subject: [PATCH] src/pitch/: change all _detect prototypes to _do --- examples/aubionotes.c | 2 +- python/aubio/aubioclass.py | 2 +- src/pitch/pitchdetection.c | 10 +++++----- src/pitch/pitchdetection.h | 2 +- src/pitch/pitchfcomb.c | 2 +- src/pitch/pitchfcomb.h | 2 +- src/pitch/pitchmcomb.c | 2 +- src/pitch/pitchmcomb.h | 2 +- src/pitch/pitchschmitt.c | 2 +- src/pitch/pitchschmitt.h | 2 +- src/pitch/pitchyinfft.c | 2 +- src/pitch/pitchyinfft.h | 2 +- swig/aubio.i | 10 +++++----- 13 files changed, 21 insertions(+), 21 deletions(-) diff --git a/examples/aubionotes.c b/examples/aubionotes.c index af7fd78a..8e0c3fcb 100644 --- a/examples/aubionotes.c +++ b/examples/aubionotes.c @@ -45,7 +45,7 @@ int aubio_process(smpl_t **input, smpl_t **output, int nframes) { } isonset = aubio_peakpicker_do(parms, onset); - pitch = aubio_pitchdetection(pitchdet,ibuf); + pitch = aubio_pitchdetection_do (pitchdet,ibuf); if(median){ note_append(note_buffer, pitch); } diff --git a/python/aubio/aubioclass.py b/python/aubio/aubioclass.py index 58c8fe17..277d1fc9 100644 --- a/python/aubio/aubioclass.py +++ b/python/aubio/aubioclass.py @@ -134,7 +134,7 @@ class pitchdetection: del_aubio_pitchdetection(self.pitchp) def __call__(self,myvec): #self.filt(myvec) - return aubio_pitchdetection(self.pitchp,myvec()) + return aubio_pitchdetection_do(self.pitchp,myvec()) class filter: def __init__(self,srate,type=None): diff --git a/src/pitch/pitchdetection.c b/src/pitch/pitchdetection.c index 3e9d245d..6969fd89 100644 --- a/src/pitch/pitchdetection.c +++ b/src/pitch/pitchdetection.c @@ -195,7 +195,7 @@ void aubio_pitchdetection_set_yinthresh(aubio_pitchdetection_t *p, smpl_t thres) p->yinthres = thres; } -smpl_t aubio_pitchdetection(aubio_pitchdetection_t *p, fvec_t * ibuf) { +smpl_t aubio_pitchdetection_do (aubio_pitchdetection_t *p, fvec_t * ibuf) { return p->freqconv(p->callback(p,ibuf),p->srate,p->bufsize); } @@ -203,7 +203,7 @@ smpl_t aubio_pitchdetection_mcomb(aubio_pitchdetection_t *p, fvec_t *ibuf) { smpl_t pitch = 0.; aubio_filter_do(p->filter,ibuf); aubio_pvoc_do(p->pv,ibuf,p->fftgrain); - pitch = aubio_pitchmcomb_detect(p->mcomb,p->fftgrain); + pitch = aubio_pitchmcomb_do(p->mcomb,p->fftgrain); /** \bug should move the >0 check within aubio_bintofreq */ if (pitch>0.) { pitch = aubio_bintofreq(pitch,p->srate,p->bufsize); @@ -229,7 +229,7 @@ smpl_t aubio_pitchdetection_yin(aubio_pitchdetection_t *p, fvec_t *ibuf) { smpl_t aubio_pitchdetection_yinfft(aubio_pitchdetection_t *p, fvec_t *ibuf){ smpl_t pitch = 0.; aubio_pitchdetection_slideblock(p,ibuf); - pitch = aubio_pitchyinfft_detect(p->yinfft,p->buf,p->yinthres); + pitch = aubio_pitchyinfft_do(p->yinfft,p->buf,p->yinthres); if (pitch>0) { pitch = p->srate/(pitch+0.); } else { @@ -240,10 +240,10 @@ smpl_t aubio_pitchdetection_yinfft(aubio_pitchdetection_t *p, fvec_t *ibuf){ smpl_t aubio_pitchdetection_fcomb(aubio_pitchdetection_t *p, fvec_t *ibuf){ aubio_pitchdetection_slideblock(p,ibuf); - return aubio_pitchfcomb_detect(p->fcomb,p->buf); + return aubio_pitchfcomb_do(p->fcomb,p->buf); } smpl_t aubio_pitchdetection_schmitt(aubio_pitchdetection_t *p, fvec_t *ibuf){ aubio_pitchdetection_slideblock(p,ibuf); - return aubio_pitchschmitt_detect(p->schmitt,p->buf); + return aubio_pitchschmitt_do(p->schmitt,p->buf); } diff --git a/src/pitch/pitchdetection.h b/src/pitch/pitchdetection.h index 164b1f53..528387b9 100644 --- a/src/pitch/pitchdetection.h +++ b/src/pitch/pitchdetection.h @@ -58,7 +58,7 @@ typedef struct _aubio_pitchdetection_t aubio_pitchdetection_t; \param ibuf input signal of length hopsize */ -smpl_t aubio_pitchdetection(aubio_pitchdetection_t * p, fvec_t * ibuf); +smpl_t aubio_pitchdetection_do (aubio_pitchdetection_t * p, fvec_t * ibuf); /** change yin or yinfft tolerance threshold diff --git a/src/pitch/pitchfcomb.c b/src/pitch/pitchfcomb.c index 45a5a1a4..f7c43aca 100644 --- a/src/pitch/pitchfcomb.c +++ b/src/pitch/pitchfcomb.c @@ -58,7 +58,7 @@ aubio_pitchfcomb_t * new_aubio_pitchfcomb (uint_t bufsize, uint_t hopsize, uint_ } /* input must be stepsize long */ -smpl_t aubio_pitchfcomb_detect (aubio_pitchfcomb_t * p, fvec_t * input) +smpl_t aubio_pitchfcomb_do (aubio_pitchfcomb_t * p, fvec_t * input) { uint_t k, l, maxharm = 0; smpl_t freqPerBin = p->rate/(smpl_t)p->fftSize, diff --git a/src/pitch/pitchfcomb.h b/src/pitch/pitchfcomb.h index 1f1974b5..f17c7288 100644 --- a/src/pitch/pitchfcomb.h +++ b/src/pitch/pitchfcomb.h @@ -47,7 +47,7 @@ typedef struct _aubio_pitchfcomb_t aubio_pitchfcomb_t; \param input input signal window (length as specified at creation time) */ -smpl_t aubio_pitchfcomb_detect (aubio_pitchfcomb_t *p, fvec_t * input); +smpl_t aubio_pitchfcomb_do (aubio_pitchfcomb_t *p, fvec_t * input); /** creation of the pitch detection object \param bufsize size of the input buffer to analyse diff --git a/src/pitch/pitchmcomb.c b/src/pitch/pitchmcomb.c index cf284b7a..ca1cc130 100644 --- a/src/pitch/pitchmcomb.c +++ b/src/pitch/pitchmcomb.c @@ -89,7 +89,7 @@ struct _aubio_spectralcandidate_t { }; -smpl_t aubio_pitchmcomb_detect(aubio_pitchmcomb_t * p, cvec_t * fftgrain) { +smpl_t aubio_pitchmcomb_do (aubio_pitchmcomb_t * p, cvec_t * fftgrain) { uint_t i=0,j; smpl_t instfreq; fvec_t * newmag = (fvec_t *)p->newmag; diff --git a/src/pitch/pitchmcomb.h b/src/pitch/pitchmcomb.h index 492c35ec..9185a7f2 100644 --- a/src/pitch/pitchmcomb.h +++ b/src/pitch/pitchmcomb.h @@ -48,7 +48,7 @@ typedef struct _aubio_pitchmcomb_t aubio_pitchmcomb_t; \param fftgrain input signal spectrum as computed by aubio_pvoc_do */ -smpl_t aubio_pitchmcomb_detect(aubio_pitchmcomb_t * p, cvec_t * fftgrain); +smpl_t aubio_pitchmcomb_do (aubio_pitchmcomb_t * p, cvec_t * fftgrain); /** select the best candidates */ uint_t aubio_pitch_cands(aubio_pitchmcomb_t * p, cvec_t * fftgrain, smpl_t * cands); /** creation of the pitch detection object diff --git a/src/pitch/pitchschmitt.c b/src/pitch/pitchschmitt.c index fee4ca87..b1c0eded 100644 --- a/src/pitch/pitchschmitt.c +++ b/src/pitch/pitchschmitt.c @@ -42,7 +42,7 @@ aubio_pitchschmitt_t * new_aubio_pitchschmitt (uint_t size, uint_t samplerate) return p; } -smpl_t aubio_pitchschmitt_detect (aubio_pitchschmitt_t *p, fvec_t * input) +smpl_t aubio_pitchschmitt_do (aubio_pitchschmitt_t *p, fvec_t * input) { uint_t i; for (i=0; ilength; i++) { diff --git a/src/pitch/pitchschmitt.h b/src/pitch/pitchschmitt.h index 8a3192e2..d1348880 100644 --- a/src/pitch/pitchschmitt.h +++ b/src/pitch/pitchschmitt.h @@ -47,7 +47,7 @@ typedef struct _aubio_pitchschmitt_t aubio_pitchschmitt_t; \param input input signal window (length as specified at creation time) */ -smpl_t aubio_pitchschmitt_detect (aubio_pitchschmitt_t *p, fvec_t * input); +smpl_t aubio_pitchschmitt_do (aubio_pitchschmitt_t *p, fvec_t * input); /** creation of the pitch detection object \param size size of the input buffer to analyse diff --git a/src/pitch/pitchyinfft.c b/src/pitch/pitchyinfft.c index 0c412095..c53e283a 100644 --- a/src/pitch/pitchyinfft.c +++ b/src/pitch/pitchyinfft.c @@ -87,7 +87,7 @@ aubio_pitchyinfft_t * new_aubio_pitchyinfft (uint_t bufsize) return p; } -smpl_t aubio_pitchyinfft_detect(aubio_pitchyinfft_t * p, fvec_t * input, smpl_t tol) { +smpl_t aubio_pitchyinfft_do (aubio_pitchyinfft_t * p, fvec_t * input, smpl_t tol) { uint_t tau, l = 0; uint_t halfperiod; smpl_t tmp = 0, sum = 0; diff --git a/src/pitch/pitchyinfft.h b/src/pitch/pitchyinfft.h index cccacd6d..155fcdca 100644 --- a/src/pitch/pitchyinfft.h +++ b/src/pitch/pitchyinfft.h @@ -48,7 +48,7 @@ typedef struct _aubio_pitchyinfft_t aubio_pitchyinfft_t; \param tol tolerance parameter for minima selection [default 0.85] */ -smpl_t aubio_pitchyinfft_detect (aubio_pitchyinfft_t *p, fvec_t * input, smpl_t tol); +smpl_t aubio_pitchyinfft_do (aubio_pitchyinfft_t *p, fvec_t * input, smpl_t tol); /** creation of the pitch detection object \param bufsize size of the input buffer to analyse diff --git a/swig/aubio.i b/swig/aubio.i index d51e3c5f..939d835f 100644 --- a/swig/aubio.i +++ b/swig/aubio.i @@ -162,7 +162,7 @@ smpl_t aubio_spectral_centroid(cvec_t * spectrum, smpl_t samplerate); /* filterbank */ aubio_filterbank_t * new_aubio_filterbank(uint_t win_s, uint_t channels); -void aubio_filterbank_set_mel_coeffs(aubio_filterbank_t *fb, fvec_t *freqs, uint_t samplerate); +void aubio_filterbank_set_mel_coeffs(aubio_filterbank_t *fb, uint_t samplerate, fvec_t *freqs); void aubio_filterbank_set_mel_coeffs_slaney(aubio_filterbank_t *fb, uint_t samplerate); void del_aubio_filterbank(aubio_filterbank_t * fb); void aubio_filterbank_do(aubio_filterbank_t * fb, cvec_t * in, fvec_t *out); @@ -232,7 +232,7 @@ typedef enum { aubio_pitchm_bin } aubio_pitchdetection_mode; -smpl_t aubio_pitchdetection(aubio_pitchdetection_t * p, fvec_t * ibuf); +smpl_t aubio_pitchdetection_do (aubio_pitchdetection_t * p, fvec_t * ibuf); void aubio_pitchdetection_set_yinthresh(aubio_pitchdetection_t *p, smpl_t thres); @@ -248,7 +248,7 @@ aubio_pitchdetection_t * new_aubio_pitchdetection(uint_t bufsize, /* pitch mcomb */ aubio_pitchmcomb_t * new_aubio_pitchmcomb(uint_t bufsize, uint_t hopsize, uint_t channels, uint_t samplerate); -smpl_t aubio_pitchmcomb_detect(aubio_pitchmcomb_t * p, cvec_t * fftgrain); +smpl_t aubio_pitchmcomb_do (aubio_pitchmcomb_t * p, cvec_t * fftgrain); uint_t aubio_pitch_cands(aubio_pitchmcomb_t * p, cvec_t * fftgrain, smpl_t * cands); void del_aubio_pitchmcomb (aubio_pitchmcomb_t *p); @@ -260,12 +260,12 @@ smpl_t aubio_pitchyin_getpitchfast(fvec_t * input, fvec_t *yin, smpl_t tol); /* pitch schmitt */ aubio_pitchschmitt_t * new_aubio_pitchschmitt (uint_t size, uint_t samplerate); -smpl_t aubio_pitchschmitt_detect (aubio_pitchschmitt_t *p, fvec_t * input); +smpl_t aubio_pitchschmitt_do (aubio_pitchschmitt_t *p, fvec_t * input); void del_aubio_pitchschmitt (aubio_pitchschmitt_t *p); /* pitch fcomb */ aubio_pitchfcomb_t * new_aubio_pitchfcomb (uint_t size, uint_t hopsize, uint_t samplerate); -smpl_t aubio_pitchfcomb_detect (aubio_pitchfcomb_t *p, fvec_t * input); +smpl_t aubio_pitchfcomb_do (aubio_pitchfcomb_t *p, fvec_t * input); void del_aubio_pitchfcomb (aubio_pitchfcomb_t *p); /* peakpicker */ -- 2.26.2