Signal inlets 2+ won't work
May 19 2012 | 10:51 am
I'm working on an external with five signal inlets, and I can't seem to get any input from inlets 2 onward. I've included the project folder (an Xcode project) and the compiled external as an attachment, in case anybody wants to try those out. Here is my perform routine.
void rhythm_perform64(t_rhythm *x, t_object *dsp64, double **ins, long numins, double **outs, long numouts, long sampleframes, long flags, void *userparam) { t_double *in3 = ins[2]; //works if I change to ins[1] or ins[0] t_double *outL = outs[0]; t_double *outR = outs[1]; int n = sampleframes; //fields int len = x->length; int wCount = x->writeCount; while (n--) { //write values to array if (wCount > len-1) { wCount = 0; } *outL++ = wCount; *outR++ = *in3++; //increment count and update value wCount++; x->writeCount = wCount; } }
The code above will not get any output from outR. However, when I change the inlet declaration to 'ins[1]' or 'ins[0]', those inlet's input is passed to the second outlet, as expected.
Here is my new instance routine, in which the inlets are initially created:
void *rhythm_new(t_symbol *s, long argc, t_atom *argv) { t_rhythm *x = (t_rhythm *)object_alloc(rhythm_class); x->m_outlet3 = floatout((t_rhythm *)x); if (x) { dsp_setup((t_pxobject *)x, 5); outlet_new(x, "signal"); outlet_new(x, "signal"); } return (x); }
As you can see, I HAVE created 5 inlets.
I haven't found anything related to this in the documentation or the forums so far, so any help would be much appreciated.