I am very new to programming MaxMSP externals.
To practice, I am making a Moog VCF-like filter. I have based my external on the SDK lores~ example.
My external works well, but, I really want to understand all functionalities that I've implemented.
I don't understand well the relationships between SMOOTHING_VERSION, lores_perform_unroll_smooth64, and maxvectorsize.
Can someone explain this to me?
void lores_dsp64(t_lores *x, t_object *dsp64, short *count, double samplerate, long maxvectorsize, long flags){
x->l_2pidsr = (2.0 * PI) / samplerate;
lores_calc(x);
x->l_a1p = x->l_a1; // store prev coefs
x->l_a2p = x->l_a2;
x->l_fcon = count[1]; // signal connected to the frequency inlet?
x->l_rcon = count[2]; // signal connected to the resonance inlet?
lores_clear(x);
if (maxvectorsize >= 4) {
#if SMOOTHING_VERSION
dsp_add64(dsp64, (t_object *)x,(t_perfroutine64)lores_perform_unroll_smooth64, 0, NULL);
#else
dsp_add64(dsp64, (t_object *)x, (t_perfroutine64)lores_perform_unroll64, 0, NULL);
#endif
}
else
dsp_add64(dsp64, (t_object *)x, (t_perfroutine64)lores_perform64, 0, NULL);
}
Basically, why do we need an unroll function?