-
justAndrea
Wow, thank you so much @PierreGuillot!! Great explanation
-
justAndrea
Hi @alexandros, thanks for your answer. Actually I do create the outlets, but they don't behave correctly. They should work like this:
Inlet1-outlet1
Inlet2-outlet2
Inlet3-outlet3
Inlet4-outlet4But they return instead:
Inlet1-outlet1
Inlet2-outlet2
Inlet2-outlet3
Inlet1-outlet4After debugging I saw that I get correctly the data from the inlets and that I can also assign other values to the outlets, and it works correctly. The problem is when sending the signals from the inlets to the outlets, so the assignation
*out3++ = *in3++; *out4++ = *in4++;
And regarding the cast to void...I'm just playing around with the code provided in How to write an external in PD and I didn't change it so much.
-
justAndrea
Here you have. Thanks!
void ext_dsp(t_pan *x, t_signal **sp) { dsp_add(ext_perform, 10, x, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec, sp[4]->s_vec, sp[5]->s_vec, sp[6]->s_vec, sp[7]->s_vec, sp[0]->s_n); } void *ext_new(t_floatarg f) { t_pan *x = (t_pan *)pd_new(pan_class); x->x_in2 = inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_signal, &s_signal); x->x_in3 = inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_signal, &s_signal); x->x_in4 = inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_signal, &s_signal); x->x_out1 = outlet_new(&x->x_obj, &s_signal); x->x_out2 = outlet_new(&x->x_obj, &s_signal); x->x_out3 = outlet_new(&x->x_obj, &s_signal); x->x_out4 = outlet_new(&x->x_obj, &s_signal); return (void *)x; }```
-
justAndrea
Hi,
Thanks both for answering! I'm just trying to make this work...It works correctly for the first two outlets, but the outlet 3 returns inlet2, and the outlet4 returns inlet1, so I guess that I'm not declaring something correctly...
t_int *ext_perform(t_int *w) { int i; t_pan *x = (t_pan *)(w[1]); t_sample *in1 = (t_sample *)(w[2]); t_sample *in2 = (t_sample *)(w[3]); t_sample *in3 = (t_sample *)(w[4]); t_sample *in4 = (t_sample *)(w[5]); t_sample *out1 = (t_sample *)(w[6]); t_sample *out2 = (t_sample *)(w[7]); t_sample *out3 = (t_sample *)(w[8]); t_sample *out4 = (t_sample *)(w[9]); int n = (int)(w[10]); for (i = 0; i < n; i++) { *out1++ = *in1++; *out2++ = *in2++; *out3++ = *in3++; *out4++ = *in4++; } return (w+11); }```
-
justAndrea
Hi! I'm new writing externals, so sorry about the newbie question.
I would like to create a multichannel object, with several outlets but I'm having problems when adding more than 2. The first 2 outlets do what they have to do but the others doesn't behave as they should. At this point I'm asking myself, is possible to have more than 2 signal outlets? And if so, do they have to be defined in a different way than the others?
Thanks in advance!
-
justAndrea
@alexandros , thank you very much for offering your help. Finally it was a problem in the external that I was writing, not in the patch itself. So...bad question!
-
justAndrea
Hello @whale-av. Thanks for your answer. Actually I'm not using throw~ and catch~, I'm just using outlet~. I didn't explain it well..
-
justAndrea
I'm sorry, but I can't do that. But I can give you more details
I have several readsf~ (one in every subpatch), and all throw to the same dac~, but not at the same time. The dac~ is in the main patch. -
justAndrea
This is the scenario: I have a patch with some subpatches. I use a block size of [block~ 128] in one subpatch, but the default one in the rest. Then I do the following:
- I play the sound processed in one subpatch with the default block size, it works correctly
- I play the processed in one subpatch with the block size of 128, it works correctly
- I play again the file with the default one, and it is totally distorted
Does any have any idea about this? Thank you in advance