Problem with multiple MSP inlets/outlets in C API

Oct 26, 2013 at 5:36pm

Problem with multiple MSP inlets/outlets in C API

Hi folks,

I’m an MSP newbie and got stuck with a two-in two-out object. I’ve got weird interactions between the ins and outs. When printing out the pointer addresses of the ins and outs I saw they’re the same?!

Here’s an excerpt from my code (just looking at the 64bit part):
void *bl_slicer_new(t_symbol *s, long argc, t_atom *argv)
{
t_bl_slicer *x = (t_bl_slicer *)object_alloc(bl_slicer_class);
if (x) {
dsp_setup((t_pxobject *)x, 2);
outlet_new((t_object*)x, "signal");
outlet_new((t_object*)x, "signal");
}
return (x);
}

void bl_slicer_dsp64(t_bl_slicer *x, t_object *dsp64, short *count, double samplerate, long maxvectorsize, long flags)
{
post("my sample rate is: %f, count: %d", samplerate, *count);
object_method(dsp64, gensym("dsp_add64"), x, bl_slicer_perform64, 0, NULL);
}

void bl_slicer_perform64(t_bl_slicer *x, t_object *dsp64, double **ins, long numins, double **outs, long numouts, long sampleframes, long flags, void *userparam)
{
t_double *inL = ins[0];
t_double *inR = ins[1];
t_double *outL = outs[0];
t_double *outR = outs[1];
post("ins: %d %d, outs: %d %d", ins[0], ins[1], outs[0], outs[1]);
}

Here’s the print out:
ins: 315077024 315085280, outs: 315085280 315077024
You see that ins[0]==outs[1], and ins[1]==outs[0]. But why is this? I would assume the addresses to be different.

Thanks for any help…

#269228
Oct 26, 2013 at 10:26pm
#269238
Oct 27, 2013 at 9:26am

Hey Luigi, thank you very much! I didn’t discover these threads when searching. Now it’s all clear :)
Best, Boris

#269264
Oct 27, 2013 at 10:15am

As we already said here, a search restricted to the dev forum only, is an old feature that lacks very much since the new website ;-)

#269269

You must be logged in to reply to this topic.