Problem with multiple MSP inlets/outlets in C API


    Oct 27 2013 | 12:36 am
    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...

    • Oct 27 2013 | 5:26 am
      Hi there,
      many threads about this:
      http://cycling74.com/forums/topic/order-of-access-to-dsp-signals-important/
      http://cycling74.com/forums/topic/4-in-4-out-msp-external-problem-sdk-5-1-1/
      Best
      - Luigi
    • Oct 27 2013 | 4:26 pm
      Hey Luigi, thank you very much! I didn't discover these threads when searching. Now it's all clear :)
      Best, Boris