// Destroy void autotune_free(t_autotune *x) { //dsp_free((t_object *)x); // Always call dsp_free first in this routine unsigned int ti; clock_unset(x->clock); clock_free(x->clock); fft_des(x->fx); freebytes(x->cbi,0); freebytes(x->cbf,0); freebytes(x->cbo,0); //freebytes(x->cbonorm,0); freebytes(x->cbwindow,0); freebytes(x->hannwindow,0); freebytes(x->acwinv,0); freebytes(x->frag,0); freebytes(x->ffttime,0); freebytes(x->fftfreqre,0); freebytes(x->fftfreqim,0); free(x->fk); free(x->fb); free(x->fc); free(x->frb); free(x->frc); free(x->fsmooth); free(x->fsig); for (ti=0; ti<x->ford; ti++) { free(x->fbuff[ti]); } free(x->fbuff); free(x->ftvec); }
void cleanupAutotalent(Autotalent* Instance) { int ti; fft_des(Instance->fmembvars); free(Instance->cbi); free(Instance->cbf); free(Instance->cbo); free(Instance->cbwindow); free(Instance->hannwindow); free(Instance->acwinv); free(Instance->frag); free(Instance->ffttime); free(Instance->fftfreqre); free(Instance->fftfreqim); free(Instance->fk); free(Instance->fb); free(Instance->fc); free(Instance->frb); free(Instance->frc); free(Instance->fsmooth); free(Instance->fsig); for (ti=0; ti<Instance->ford; ti++) { free(Instance->fbuff[ti]); } free(Instance->fbuff); free(Instance->ftvec); // we allocated these cuz we just don't use them free(Instance->m_pfPitch); free(Instance->m_pfConf); free(Instance->m_pfLatency); free(Instance); }
AutoTalent::~AutoTalent(){ fft_des(fmembvars); free(cbi); free(cbo); free(cbonorm); free(cbwindow); free(hannwindow); free(acwinv); free(frag); free(ffttime); free(fftfreqre); free(fftfreqim); };