aubio_onsetdetection(o2,fftgrain, onset2);
onset->data[0][0] *= onset2->data[0][0];
}*/
- isonset = aubio_peakpick_pimrt(o->of,o->pp);
+ isonset = aubio_peakpicker_do(o->pp, o->of);
if (isonset > 0.) {
if (aubio_silence_detection(input, o->silence)==1) {
isonset = 0;
/** 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_peakpick_pimrt(fvec_t * onset, aubio_pickpeak_t * p) {
+smpl_t aubio_peakpicker_do(aubio_pickpeak_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_peakpick_pimrt_getval(aubio_pickpeak_t * p)
+smpl_t aubio_peakpicker_get_thresholded_input(aubio_pickpeak_t * p)
{
- uint_t i = 0;
- return p->onset_peek->data[i][1];
+ return p->onset_peek->data[0][1];
}
/** function added by Miguel Ramirez to return the onset detection amplitude in peakval */
-uint_t aubio_peakpick_pimrt_wt(fvec_t * onset, aubio_pickpeak_t * p, smpl_t* peakval)
-{
- uint_t isonset = 0;
- isonset = aubio_peakpick_pimrt(onset,p);
-
- //if ( isonset && peakval != NULL )
- if ( peakval != NULL )
- *peakval = aubio_peakpick_pimrt_getval(p);
-
- return isonset;
-}
-
void aubio_peakpicker_set_threshold(aubio_pickpeak_t * p, smpl_t threshold) {
p->threshold = threshold;
return;
/** peak-picker creation function */
aubio_pickpeak_t * new_aubio_peakpicker(smpl_t threshold);
/** real time peak picking function */
-smpl_t aubio_peakpick_pimrt(fvec_t * DF, aubio_pickpeak_t * p);
-/** function added by Miguel Ramirez to return the onset detection amplitude in peakval */
-uint_t aubio_peakpick_pimrt_wt( fvec_t* DF, aubio_pickpeak_t* p, smpl_t* peakval );
+smpl_t aubio_peakpicker_do(aubio_pickpeak_t * p, fvec_t * DF);
/** get current peak value */
-smpl_t aubio_peakpick_pimrt_getval(aubio_pickpeak_t * p);
+smpl_t aubio_peakpicker_get_thresholded_input(aubio_pickpeak_t * p);
/** destroy peak picker structure */
void del_aubio_peakpicker(aubio_pickpeak_t * p);
o->blockpos = -1;
}
o->blockpos++;
- tempo->data[0][1] = aubio_peakpick_pimrt_wt(o->of,o->pp,
- &(o->dfframe->data[0][winlen - step + o->blockpos]));
+ tempo->data[0][1] = aubio_peakpicker_do (o->pp, o->of);
+ o->dfframe->data[0][winlen - step + o->blockpos] =
+ aubio_peakpicker_get_thresholded_input(o->pp);
/* end of second level loop */
tempo->data[0][0] = 0; /* reset tactus */
i=0;