On Aug 30, 2015, at 12:09 PM, David Medine <dmedine@ucsd.edu> wrote:Does any one know how to write a ~ object that has a variable number signal outlets and inlets? The only thing I've been able to come up with is to have a dsp routine that looks like:
switch(x->n_sigs){
case 3:
dsp_add(whatever_tilde_perform,
5,
x,
sp[0]->s_vec,
sp[1]->s_vec,
sp[2]->s_vec,
sp[0]->s_n);
break;
case 4:
dsp_add(whatever_tilde_perform,
6,
x,
sp[0]->s_vec,
sp[1]->s_vec,
sp[2]->s_vec,
sp[3]->s_vec,
sp[0]->s_n);
break;
// so on and so forth...
}
It feels like there should be a better way to do this.
Thanks,
David
_______________________________________________
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list