[PD] So far so failed on my part
t.grill at gmx.net
Tue Aug 19 00:24:19 CEST 2003
a few very superficial remarks from my side (i'm in a hurry....).
1) I don't use straight PD code because of exactly the problems you have.
2) I use flext.
3) As far as i remember (and deducing from flext internal code) i see the
> //why do I have 6 outlets defined here but 7 show up on the sphere~ object
The reason is that for a signal object the leftmost signal inlet is
implicit. It's always there.
> //no inclusion? what happens to w?
Miller knows it.
> t_sphere_tilde *ref = (t_sphere_tilde *)(w);
> t_sample *in1 = (t_sample *)(w); //centerx
> t_sample *in2 = (t_sample *)(w); //centery
> t_sample *in3 = (t_sample *)(w); //centerz
> t_sample *in4 = (t_sample *)(w); //radius
> t_sample *in5 = (t_sample *)(w); //conrolx
> t_sample *in6 = (t_sample *)(w); //conroly
> t_sample *in7 = (t_sample *)(w); //conrolz
> t_sample *out = (t_sample *)(w); //outlet
> int n = (int)(w);//number of samples in block
Apart from that you should possibly clean up the code a bit..... one running
index would probably be more clear and efficient than incrementing each
> void sphere_tilde_dsp(t_sphere_tilde *ref, t_signal **sp)
> dsp_add(sphere_tilde_perform, 10, ref,
> sp->s_vec, sp->s_vec, sp->s_vec, sp->s_vec,
sp->s_vec, sp->s_vec, sp->s_vec, sp->s_n);
You announce that you are passing 10 arguments here, while you are passing
only 9!! Hence, you should pass another sp->s_vec.
Remember that you have 7 inbound and 1 outbound signals.
> //optional question: what happens if I want to have an optional
> //number of defaults within the object box?
> //e.g. [sphere~ centerx centery centerz radius]
This won't work if your centerx, centery, centerz , radius are passed in as
signals. Signals can't have a default value defined inside the external.
Probably you don't need signals for these values? Will simple float messages
do it as well?
More information about the Pd-list