fvec_t *onset;
fvec_t *onset2;
smpl_t isonset = 0;
-aubio_pickpeak_t *parms;
+aubio_peakpicker_t *parms;
/* pitch objects */
extern fvec_t *onset;
extern fvec_t *onset2;
extern smpl_t isonset;
-extern aubio_pickpeak_t *parms;
+extern aubio_peakpicker_t *parms;
/* pitch objects */
struct _aubio_onset_t {
aubio_pvoc_t * pv; /**< phase vocoder */
aubio_onsetdetection_t * od; /**< onset detection */
- aubio_pickpeak_t * pp; /**< peak picker */
+ aubio_peakpicker_t * pp; /**< peak picker */
cvec_t * fftgrain; /**< phase vocoder output */
fvec_t * of; /**< onset detection function */
smpl_t threshold; /**< onset peak picking threshold */
* .................|.............
* time-> ^now
*/
-struct _aubio_pickpeak_t {
+struct _aubio_peakpicker_t {
/** thresh: offset threshold [0.033 or 0.01] */
smpl_t threshold;
/** win_post: median filter window length (causal part) [8] */
/** modified version for real time, moving mean adaptive threshold this method
* is slightly more permissive than the offline one, and yelds to an increase
* of false positives. best */
-smpl_t aubio_peakpicker_do(aubio_pickpeak_t * p, fvec_t * onset) {
+smpl_t aubio_peakpicker_do(aubio_peakpicker_t * p, fvec_t * onset) {
fvec_t * onset_keep = (fvec_t *)p->onset_keep;
fvec_t * onset_proc = (fvec_t *)p->onset_proc;
fvec_t * onset_peek = (fvec_t *)p->onset_peek;
/** this method returns the current value in the pick peaking buffer
* after smoothing
*/
-smpl_t aubio_peakpicker_get_thresholded_input(aubio_pickpeak_t * p)
+smpl_t aubio_peakpicker_get_thresholded_input(aubio_peakpicker_t * p)
{
return p->onset_peek->data[0][1];
}
/** function added by Miguel Ramirez to return the onset detection amplitude in peakval */
-void aubio_peakpicker_set_threshold(aubio_pickpeak_t * p, smpl_t threshold) {
+void aubio_peakpicker_set_threshold(aubio_peakpicker_t * p, smpl_t threshold) {
p->threshold = threshold;
return;
}
-smpl_t aubio_peakpicker_get_threshold(aubio_pickpeak_t * p) {
+smpl_t aubio_peakpicker_get_threshold(aubio_peakpicker_t * p) {
return p->threshold;
}
-void aubio_peakpicker_set_thresholdfn(aubio_pickpeak_t * p, aubio_thresholdfn_t thresholdfn) {
+void aubio_peakpicker_set_thresholdfn(aubio_peakpicker_t * p, aubio_thresholdfn_t thresholdfn) {
p->thresholdfn = thresholdfn;
return;
}
-aubio_thresholdfn_t aubio_peakpicker_get_thresholdfn(aubio_pickpeak_t * p) {
+aubio_thresholdfn_t aubio_peakpicker_get_thresholdfn(aubio_peakpicker_t * p) {
return (aubio_thresholdfn_t) (p->thresholdfn);
}
-aubio_pickpeak_t * new_aubio_peakpicker(smpl_t threshold) {
- aubio_pickpeak_t * t = AUBIO_NEW(aubio_pickpeak_t);
+aubio_peakpicker_t * new_aubio_peakpicker(smpl_t threshold) {
+ aubio_peakpicker_t * t = AUBIO_NEW(aubio_peakpicker_t);
t->threshold = 0.1; /* 0.0668; 0.33; 0.082; 0.033; */
if (threshold > 0. && threshold < 10.)
t->threshold = threshold;
return t;
}
-void del_aubio_peakpicker(aubio_pickpeak_t * p) {
+void del_aubio_peakpicker(aubio_peakpicker_t * p) {
del_aubio_biquad(p->biquad);
del_fvec(p->onset_keep);
del_fvec(p->onset_proc);
/** function pointer to peak-picking function */
typedef uint_t (*aubio_pickerfn_t)(fvec_t *input, uint_t pos);
/** peak-picker structure */
-typedef struct _aubio_pickpeak_t aubio_pickpeak_t;
+typedef struct _aubio_peakpicker_t aubio_peakpicker_t;
/** peak-picker creation function */
-aubio_pickpeak_t * new_aubio_peakpicker(smpl_t threshold);
+aubio_peakpicker_t * new_aubio_peakpicker(smpl_t threshold);
/** real time peak picking function */
-smpl_t aubio_peakpicker_do(aubio_pickpeak_t * p, fvec_t * DF);
+smpl_t aubio_peakpicker_do(aubio_peakpicker_t * p, fvec_t * DF);
/** get current peak value */
-smpl_t aubio_peakpicker_get_thresholded_input(aubio_pickpeak_t * p);
+smpl_t aubio_peakpicker_get_thresholded_input(aubio_peakpicker_t * p);
/** destroy peak picker structure */
-void del_aubio_peakpicker(aubio_pickpeak_t * p);
+void del_aubio_peakpicker(aubio_peakpicker_t * p);
/** set peak picking threshold */
-void aubio_peakpicker_set_threshold(aubio_pickpeak_t * p, smpl_t threshold);
+void aubio_peakpicker_set_threshold(aubio_peakpicker_t * p, smpl_t threshold);
/** get peak picking threshold */
-smpl_t aubio_peakpicker_get_threshold(aubio_pickpeak_t * p);
+smpl_t aubio_peakpicker_get_threshold(aubio_peakpicker_t * p);
/** set peak picker thresholding function */
-void aubio_peakpicker_set_thresholdfn(aubio_pickpeak_t * p, aubio_thresholdfn_t thresholdfn);
+void aubio_peakpicker_set_thresholdfn(aubio_peakpicker_t * p, aubio_thresholdfn_t thresholdfn);
/** get peak picker thresholding function */
-aubio_thresholdfn_t aubio_peakpicker_get_thresholdfn(aubio_pickpeak_t * p);
+aubio_thresholdfn_t aubio_peakpicker_get_thresholdfn(aubio_peakpicker_t * p);
#ifdef __cplusplus
}
struct _aubio_tempo_t {
aubio_onsetdetection_t * od; /** onset detection */
aubio_pvoc_t * pv; /** phase vocoder */
- aubio_pickpeak_t * pp; /** peak picker */
+ aubio_peakpicker_t * pp; /** peak picker */
aubio_beattracking_t * bt; /** beat tracking */
cvec_t * fftgrain; /** spectral frame */
fvec_t * of; /** onset detection function value */
/* filterbank */
aubio_filterbank_t * new_aubio_filterbank(uint_t win_s, uint_t channels);
-void aubio_filterbank_set_mel_coeffs(aubio_filterbank_t *fb, uint_t samplerate, fvec_t *freqs);
+void aubio_filterbank_set_triangle_bands (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);
void del_aubio_pitchfcomb (aubio_pitchfcomb_t *p);
/* peakpicker */
-aubio_pickpeak_t * new_aubio_peakpicker(smpl_t threshold);
-smpl_t aubio_peakpicker_do(aubio_pickpeak_t * p, fvec_t * df);
-smpl_t aubio_peakpicker_get_thresholded_input(aubio_pickpeak_t* p);
-void del_aubio_peakpicker(aubio_pickpeak_t * p);
-void aubio_peakpicker_set_threshold(aubio_pickpeak_t * p, smpl_t threshold);
-smpl_t aubio_peakpicker_get_threshold(aubio_pickpeak_t * p);
+aubio_peakpicker_t * new_aubio_peakpicker(smpl_t threshold);
+smpl_t aubio_peakpicker_do(aubio_peakpicker_t * p, fvec_t * df);
+smpl_t aubio_peakpicker_get_thresholded_input(aubio_peakpicker_t* p);
+void del_aubio_peakpicker(aubio_peakpicker_t * p);
+void aubio_peakpicker_set_threshold(aubio_peakpicker_t * p, smpl_t threshold);
+smpl_t aubio_peakpicker_get_threshold(aubio_peakpicker_t * p);
/* transient/steady state separation */
aubio_tss_t * new_aubio_tss(smpl_t thrs, smpl_t alfa, smpl_t beta,
uint_t win_s = 1024; /* window size */
uint_t channels = 1; /* number of channel */
fvec_t * in = new_fvec (win_s, channels); /* input buffer */
- aubio_pickpeak_t * o = new_aubio_peakpicker(0.3);
+ aubio_peakpicker_t * o = new_aubio_peakpicker(0.3);
aubio_peakpicker_do(o, in);
aubio_peakpicker_do(o, in);