ref: 01b8fcc1b4d797f0f001d3a4372d1e7f3c1c5b2d
parent: cb158ab878de1ce6d9147f4ff67c7998caaa8dca
author: Paul Brossier <[email protected]>
date: Wed Oct 7 18:58:25 EDT 2009
src/onset: rename aubio_onsetdetection to aubio_onsetdetection_do
--- a/examples/aubionotes.c
+++ b/examples/aubionotes.c
@@ -38,9 +38,9 @@
if (pos == overlap_size-1) {
/* block loop */
aubio_pvoc_do (pv,ibuf, fftgrain);
- aubio_onsetdetection(o,fftgrain, onset);
+ aubio_onsetdetection_do(o,fftgrain, onset);
if (usedoubled) {
- aubio_onsetdetection(o2,fftgrain, onset2);
+ aubio_onsetdetection_do(o2,fftgrain, onset2);
onset->data[0][0] *= onset2->data[0][0];
}
isonset = aubio_peakpicker_do(parms, onset);
--- a/examples/aubioonset.c
+++ b/examples/aubioonset.c
@@ -38,9 +38,9 @@
if (pos == overlap_size-1) {
/* block loop */
aubio_pvoc_do (pv,ibuf, fftgrain);
- aubio_onsetdetection(o,fftgrain, onset);
+ aubio_onsetdetection_do (o,fftgrain, onset);
if (usedoubled) {
- aubio_onsetdetection(o2,fftgrain, onset2);
+ aubio_onsetdetection_do (o2,fftgrain, onset2);
onset->data[0][0] *= onset2->data[0][0];
}
isonset = aubio_peakpicker_do(parms, onset);
--- a/plugins/puredata/aubioonset~.c
+++ b/plugins/puredata/aubioonset~.c
@@ -46,7 +46,7 @@
if (x->pos == x->hopsize-1) {
/* block loop */
aubio_pvoc_do (x->pv,x->vec, x->fftgrain);
- aubio_onsetdetection(x->o,x->fftgrain, x->onset);
+ aubio_onsetdetection_do (x->o,x->fftgrain, x->onset);
isonset = aubio_peakpick_pimrt(x->onset,x->parms);
if (isonset) {
/* test for silence */
--- a/python/aubio/aubioclass.py
+++ b/python/aubio/aubioclass.py
@@ -72,7 +72,7 @@
def __init__(self,type,buf,chan):
self.od = new_aubio_onsetdetection(type,buf,chan)
def do(self,tc,tf):
- aubio_onsetdetection(self.od,tc(),tf())
+ aubio_onsetdetection_do(self.od,tc(),tf())
def __del__(self):
del_aubio_onsetdetection(self.od)
--- a/src/onset/onset.c
+++ b/src/onset/onset.c
@@ -45,9 +45,9 @@
uint_t isonset = 0;
uint_t wasonset = o->wasonset;
aubio_pvoc_do (o->pv,input, o->fftgrain);
- aubio_onsetdetection(o->od,o->fftgrain, o->of);
+ aubio_onsetdetection_do (o->od,o->fftgrain, o->of);
/*if (usedoubled) {
- aubio_onsetdetection(o2,fftgrain, onset2);
+ aubio_onsetdetection_do (o2,fftgrain, onset2);
onset->data[0][0] *= onset2->data[0][0];
}*/
isonset = aubio_peakpicker_do(o->pp, o->of);
--- a/src/onset/onsetdetection.c
+++ b/src/onset/onsetdetection.c
@@ -295,7 +295,7 @@
/* Generic function pointing to the choosen one */
void
-aubio_onsetdetection(aubio_onsetdetection_t *o, cvec_t * fftgrain,
+aubio_onsetdetection_do (aubio_onsetdetection_t *o, cvec_t * fftgrain,
fvec_t * onset) {
o->funcpointer(o,fftgrain,onset);
}
--- a/src/onset/onsetdetection.h
+++ b/src/onset/onsetdetection.h
@@ -61,7 +61,7 @@
\param onset output vector (one sample long, to send to the peak picking)
*/
-void aubio_onsetdetection(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
+void aubio_onsetdetection_do (aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
/** creation of an onset detection object
\param type onset detection mode
--- a/src/tempo/tempo.c
+++ b/src/tempo/tempo.c
@@ -51,9 +51,9 @@
uint_t winlen = o->winlen;
uint_t step = o->step;
aubio_pvoc_do (o->pv, input, o->fftgrain);
- aubio_onsetdetection(o->od, o->fftgrain, o->of);
+ aubio_onsetdetection_do (o->od, o->fftgrain, o->of);
/*if (usedoubled) {
- aubio_onsetdetection(o2,fftgrain, onset2);
+ aubio_onsetdetection_do(o2,fftgrain, onset2);
onset->data[0][0] *= onset2->data[0][0];
}*/
/* execute every overlap_size*step */
--- a/swig/aubio.i
+++ b/swig/aubio.i
@@ -198,17 +198,8 @@
aubio_onset_specflux,
} aubio_onsetdetection_type;
aubio_onsetdetection_t * new_aubio_onsetdetection(aubio_onsetdetection_type type, uint_t size, uint_t channels);
-void aubio_onsetdetection(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
+void aubio_onsetdetection_do (aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
void del_aubio_onsetdetection(aubio_onsetdetection_t *o);
-
-/* should these still be exposed ? */
-void aubio_onsetdetection_energy (aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
-void aubio_onsetdetection_hfc (aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
-void aubio_onsetdetection_complex (aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
-void aubio_onsetdetection_phase (aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
-void aubio_onsetdetection_specdiff(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
-void aubio_onsetdetection_kl (aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
-void aubio_onsetdetection_mkl (aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
/* pvoc */
aubio_pvoc_t * new_aubio_pvoc (uint_t win_s, uint_t hop_s, uint_t channels);
--- a/tests/src/test-onsetdetection.c
+++ b/tests/src/test-onsetdetection.c
@@ -1,54 +1,47 @@
#include <aubio.h>
-int main(){
- /* allocate some memory */
- uint_t win_s = 1024; /* window size */
- uint_t channels = 1; /* number of channel */
- cvec_t * in = new_cvec (win_s, channels); /* input buffer */
- fvec_t * out = new_fvec (1, channels); /* input buffer */
+int
+main ()
+{
+ uint_t win_s = 1024; /* window size */
+ uint_t channels = 1; /* number of channel */
+ cvec_t *in = new_cvec (win_s, channels); /* input buffer */
+ fvec_t *out = new_fvec (1, channels); /* input buffer */
+
+ aubio_onsetdetection_t *o;
- /* allocate fft and other memory space */
- aubio_onsetdetection_t * o =
- new_aubio_onsetdetection(aubio_onset_energy, win_s, channels);
- aubio_onsetdetection(o,in,out);
- aubio_onsetdetection_energy(o,in,out);
- del_aubio_onsetdetection(o);
+ o = new_aubio_onsetdetection (aubio_onset_energy, win_s, channels);
+ aubio_onsetdetection_do (o, in, out);
+ del_aubio_onsetdetection (o);
- o = new_aubio_onsetdetection(aubio_onset_specdiff, win_s, channels);
- aubio_onsetdetection(o,in,out);
- aubio_onsetdetection_specdiff(o,in,out);
- del_aubio_onsetdetection(o);
+ o = new_aubio_onsetdetection (aubio_onset_specdiff, win_s, channels);
+ aubio_onsetdetection_do (o, in, out);
+ del_aubio_onsetdetection (o);
- o = new_aubio_onsetdetection(aubio_onset_hfc, win_s, channels);
- aubio_onsetdetection(o,in,out);
- aubio_onsetdetection_hfc(o,in,out);
- del_aubio_onsetdetection(o);
+ o = new_aubio_onsetdetection (aubio_onset_hfc, win_s, channels);
+ aubio_onsetdetection_do (o, in, out);
+ del_aubio_onsetdetection (o);
- o = new_aubio_onsetdetection(aubio_onset_complex, win_s, channels);
- aubio_onsetdetection(o,in,out);
- aubio_onsetdetection_complex(o,in,out);
- del_aubio_onsetdetection(o);
+ o = new_aubio_onsetdetection (aubio_onset_complex, win_s, channels);
+ aubio_onsetdetection_do (o, in, out);
+ del_aubio_onsetdetection (o);
- o = new_aubio_onsetdetection(aubio_onset_phase, win_s, channels);
- aubio_onsetdetection(o,in,out);
- aubio_onsetdetection_phase(o,in,out);
- del_aubio_onsetdetection(o);
+ o = new_aubio_onsetdetection (aubio_onset_phase, win_s, channels);
+ aubio_onsetdetection_do (o, in, out);
+ del_aubio_onsetdetection (o);
- o = new_aubio_onsetdetection(aubio_onset_kl, win_s, channels);
- aubio_onsetdetection(o,in,out);
- aubio_onsetdetection_kl(o,in,out);
- del_aubio_onsetdetection(o);
+ o = new_aubio_onsetdetection (aubio_onset_kl, win_s, channels);
+ aubio_onsetdetection_do (o, in, out);
+ del_aubio_onsetdetection (o);
- o = new_aubio_onsetdetection(aubio_onset_mkl, win_s, channels);
- aubio_onsetdetection(o,in,out);
- aubio_onsetdetection_mkl(o,in,out);
- del_aubio_onsetdetection(o);
+ o = new_aubio_onsetdetection (aubio_onset_mkl, win_s, channels);
+ aubio_onsetdetection_do (o, in, out);
+ del_aubio_onsetdetection (o);
- del_cvec(in);
- del_fvec(out);
- aubio_cleanup();
+ del_cvec (in);
+ del_fvec (out);
+ aubio_cleanup ();
- return 0;
+ return 0;
}
-