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);
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);
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 */
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)
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);
/* 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);
}
\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
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 */
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);
void del_aubio_pvoc(aubio_pvoc_t *pv);
#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_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_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_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_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_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_mkl, win_s, channels);
- aubio_onsetdetection(o,in,out);
- aubio_onsetdetection_mkl(o,in,out);
- del_aubio_onsetdetection(o);
-
- del_cvec(in);
- del_fvec(out);
- aubio_cleanup();
-
- return 0;
-}
+ 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_do (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_do (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_do (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 ();
+
+ return 0;
+}