x->bufsize = 1024;
x->hopsize = x->bufsize / 2;
- x->t = new_aubio_tempo ("complex", x->bufsize, x->hopsize, 1);
+ x->t = new_aubio_tempo ("complex", x->bufsize, x->hopsize, 1,
+ (uint_t) sys_getsr ());
aubio_tempo_set_silence(x->t,x->silence);
aubio_tempo_set_threshold(x->t,x->threshold);
x->output = (fvec_t *)new_fvec(2,1);
sint_t blockpos; /** current position in dfframe */
uint_t winlen; /** dfframe bufsize */
uint_t step; /** dfframe hopsize */
+ uint_t samplerate; /** sampling rate of the signal */
};
/* execute tempo detection function on iput buffer */
/* Allocate memory for an tempo detection */
aubio_tempo_t * new_aubio_tempo (char_t * onset_mode,
- uint_t buf_size, uint_t hop_size, uint_t channels)
+ uint_t buf_size, uint_t hop_size, uint_t channels, uint_t samplerate)
{
aubio_tempo_t * o = AUBIO_NEW(aubio_tempo_t);
+ o->samplerate = samplerate;
o->winlen = SQR(512)/hop_size;
o->step = o->winlen/4;
o->blockpos = 0;
o->threshold = 0.3;
- o->silence = -90;
+ o->silence = -90.;
o->blockpos = 0;
o->dfframe = new_fvec(o->winlen,channels);
o->fftgrain = new_cvec(buf_size, channels);
/** create tempo detection object */
aubio_tempo_t * new_aubio_tempo (char_t * mode,
- uint_t buf_size, uint_t hop_size, uint_t channels);
+ uint_t buf_size, uint_t hop_size, uint_t channels, uint_t samplerate);
/** execute tempo detection */
void aubio_tempo_do (aubio_tempo_t *o, fvec_t * input, fvec_t * tempo);