Howdy. Im trying to make a pd external with more than 2 signal inlets. So far i have been trying to do it in the way that I expanded from a 1 audio inlet to 2 audio inlet external, by adding an extra inlet_new function in my setup and adding a new inlet to my dsp method. This looks something like this:
static void *myobj_new(t_floatarg f)
{
t_myobj *x = (t_myobj *)pd_new(myobj_class);
x->x_f = f;
inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_signal, &s_signal);
inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_signal, &s_signal);
outlet_new(&x->x_obj, gensym("signal"));
return (x);
}
static void myobj_dsp(t_myobj *x, t_signal **sp)
{
x->x_conv = 1./sp[0]->s_sr;
dsp_add(myobj_perform, 6, x, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec, sp[0]->s_n);
}
I didn't change the setup function.
Unfortunately this makes pd crash once I turn on audio. Can someone point me in the right direction for doing this kind of thing?
thanks!