Ok, I tried building my new object and it crashes Pd as I expected.

Here's the original [xgate~] code, and I'm highlighting a specific line in it because the same thing in the "mc" version is what's crashing Pd.

https://github.com/porres/pd-else/blob/master/Code_source/Compiled/signal/xgate~.c#L57

and here's the [xgate.mc~] code, which is exactly the same thing https://github.com/porres/pd-else/blob/master/Code_source/Compiled/signal/xgate.mc~.c#L52

But now it seems "*x->x_outs[n]++" doesn't work. The only difference is that the outlets are now multichannel but Pd crashes even if the input is a single channel. 

Not sure yet if it is something about "dsp_addv" not working for multichannels. I also suspect I need to adapt the code a bit in this case for some unknown reason to me.

please help

thanks

Em qua., 9 de ago. de 2023 às 00:57, Alexandre Torres Porres <porres@gmail.com> escreveu:
Hi, I am having a hard time using "dsp_addv" with a multichannel external.

I am trying to make a multichannel version of [else/xgate~], which routes a signal to different outputs with crossfading. It originally uses "dsp_addv" so it can have a DSP routine with a variable number of outlets, which is specified by an argument. 

So now I want these outlets to output multichannel signals and I have run into trouble before trying to use "dsp_addv" with multichannel signals. I was able to avoid it before but now I can't and I wanna be sure before I try it.

thanks