AubioOnsetDetector :: ~AubioOnsetDetector(){
		aubio_onsetdetection_free (o);
		del_aubio_pvoc(pv);
		del_aubio_peakpicker(parms);
		del_fvec(vec);
		aubio_cleanup();
}
Beispiel #2
0
void del_aubio_onset (aubio_onset_t *o)
{
  del_aubio_specdesc(o->od);
  del_aubio_peakpicker(o->pp);
  del_aubio_pvoc(o->pv);
  del_fvec(o->desc);
  del_cvec(o->fftgrain);
  AUBIO_FREE(o);
}
Beispiel #3
0
void aubio_destruct() {
    del_aubio_pvoc(pv);
    del_fvec(ibuf);
    del_cvec(fftgrain);
    del_aubio_onsetdetection(o);
    del_aubio_peakpicker(parms);
    del_fvec(onset);
    if (usedoubled)    {
        del_aubio_onsetdetection(o2);
        del_fvec(onset2);
    }
}
Beispiel #4
0
void del_aubio_tempo (aubio_tempo_t *o)
{
  del_aubio_onsetdetection(o->od);
  del_aubio_beattracking(o->bt);
  del_aubio_peakpicker(o->pp);
  del_aubio_pvoc(o->pv);
  del_fvec(o->out);
  del_fvec(o->of);
  del_cvec(o->fftgrain);
  del_fvec(o->dfframe);
  AUBIO_FREE(o);
  return;
}
Beispiel #5
0
int main() {
    /* allocate some memory */
    uint_t win_s      = 1024;                       /* window size */
    fvec_t * in       = new_fvec (win_s); /* input buffer */
    fvec_t * out      = new_fvec (1); /* input buffer */
    aubio_peakpicker_t * o = new_aubio_peakpicker();
    aubio_peakpicker_set_threshold (o, 0.3);

    aubio_peakpicker_do(o, in, out);
    aubio_peakpicker_do(o, in, out);
    aubio_peakpicker_do(o, in, out);
    aubio_peakpicker_do(o, in, out);

    del_aubio_peakpicker(o);
    del_fvec(in);
    return 0;
}
Beispiel #6
0
/* Allocate memory for an onset detection */
aubio_onset_t * new_aubio_onset (const char_t * onset_mode,
    uint_t buf_size, uint_t hop_size, uint_t samplerate)
{
  aubio_onset_t * o = AUBIO_NEW(aubio_onset_t);

  /* check parameters are valid */
  if ((sint_t)hop_size < 1) {
    AUBIO_ERR("onset: got hop_size %d, but can not be < 1\n", hop_size);
    goto beach;
  } else if ((sint_t)buf_size < 2) {
    AUBIO_ERR("onset: got buffer_size %d, but can not be < 2\n", buf_size);
    goto beach;
  } else if (buf_size < hop_size) {
    AUBIO_ERR("onset: hop size (%d) is larger than win size (%d)\n", hop_size, buf_size);
    goto beach;
  } else if ((sint_t)samplerate < 1) {
    AUBIO_ERR("onset: samplerate (%d) can not be < 1\n", samplerate);
    goto beach;
  }

  /* store creation parameters */
  o->samplerate = samplerate;
  o->hop_size = hop_size;

  /* allocate memory */
  o->pv = new_aubio_pvoc(buf_size, o->hop_size);
  o->pp = new_aubio_peakpicker();
  o->od = new_aubio_specdesc(onset_mode,buf_size);
  if (o->od == NULL) goto beach_specdesc;
  o->fftgrain = new_cvec(buf_size);
  o->desc = new_fvec(1);
  o->spectral_whitening = new_aubio_spectral_whitening(buf_size, hop_size, samplerate);

  /* initialize internal variables */
  aubio_onset_set_default_parameters (o, onset_mode);

  aubio_onset_reset(o);
  return o;

beach_specdesc:
  del_aubio_peakpicker(o->pp);
  del_aubio_pvoc(o->pv);
beach:
  AUBIO_FREE(o);
  return NULL;
}