ref: 129486275d99b061f4fe7f75afd395b61b0c1e81
parent: 1b8828918ce4056f810fced1cc836e871af834ad
author: Paul Brossier <piem@piem.org>
date: Wed Oct 7 15:33:51 EDT 2009
src/pitch/: change all _detect prototypes to _do
--- a/examples/aubionotes.c
+++ b/examples/aubionotes.c
@@ -45,7 +45,7 @@
}
isonset = aubio_peakpicker_do(parms, onset);
- pitch = aubio_pitchdetection(pitchdet,ibuf);
+ pitch = aubio_pitchdetection_do (pitchdet,ibuf);
if(median){
note_append(note_buffer, pitch);
}
--- a/python/aubio/aubioclass.py
+++ b/python/aubio/aubioclass.py
@@ -134,7 +134,7 @@
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):
--- a/src/pitch/pitchdetection.c
+++ b/src/pitch/pitchdetection.c
@@ -195,7 +195,7 @@
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 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_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_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);
}
--- a/src/pitch/pitchdetection.h
+++ b/src/pitch/pitchdetection.h
@@ -58,7 +58,7 @@
\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
--- a/src/pitch/pitchfcomb.c
+++ b/src/pitch/pitchfcomb.c
@@ -58,7 +58,7 @@
}
/* 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,
--- a/src/pitch/pitchfcomb.h
+++ b/src/pitch/pitchfcomb.h
@@ -47,7 +47,7 @@
\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
--- a/src/pitch/pitchmcomb.c
+++ b/src/pitch/pitchmcomb.c
@@ -89,7 +89,7 @@
};
-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;
--- a/src/pitch/pitchmcomb.h
+++ b/src/pitch/pitchmcomb.h
@@ -48,7 +48,7 @@
\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
--- a/src/pitch/pitchschmitt.c
+++ b/src/pitch/pitchschmitt.c
@@ -42,7 +42,7 @@
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; i<input->length; i++) {
--- a/src/pitch/pitchschmitt.h
+++ b/src/pitch/pitchschmitt.h
@@ -47,7 +47,7 @@
\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
--- a/src/pitch/pitchyinfft.c
+++ b/src/pitch/pitchyinfft.c
@@ -87,7 +87,7 @@
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;
--- a/src/pitch/pitchyinfft.h
+++ b/src/pitch/pitchyinfft.h
@@ -48,7 +48,7 @@
\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
--- a/swig/aubio.i
+++ b/swig/aubio.i
@@ -162,7 +162,7 @@
/* 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 @@
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 @@
/* 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 @@
/* 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 */