[PD] outlets with lists
Mathieu Bouchard
matju at artengine.ca
Fri Apr 8 16:51:19 CEST 2005
On Fri, 8 Apr 2005, Florian Grond wrote:
> I' ve managed to program simple objects for pd so far where inlets and
> outlets were only scalars. But the amount of numbers I want to send out
> increased and it makes no sense to have for everything an outlet: Could
> anybody briefly tell me how to output a list through an outlet, say a
> list, containing three floats.
> In particular, how to I have to change these lines?
> x->list_out = outlet_new(&x->x_obj, &s_???????????????);
> outlet_???????(x->list_out, x->???????????);
> A quick reply would be very appreciated,
from include/m_pd.h:
EXTERN void outlet_list(t_outlet *x, t_symbol *s, int argc, t_atom *argv);
EXTERN void outlet_anything(t_outlet *x, t_symbol *s, int argc, t_atom
*argv);
So that to do like a msgbox containing "2 3 5 7" you could do:
t_atom t[4];
SETFLOAT(t[0],2);
SETFLOAT(t[1],3);
SETFLOAT(t[2],5);
SETFLOAT(t[3],7);
outlet_anything(my_outlet,gensym("list"),sizeof(t)/sizeof(t_atom),t);
but i don't know why outlet_list has a t_symbol *s argument, and i never
used it. (I also am using a wrapper, and mine only ever uses
outlet_anything)
PS: I just had a look at the source code of Pd and it seems that the s of
outlet_list is just ignored, that is, just assumed to be gensym("list").
that's somewhat confusing, but for compatibility, the s argument can't be
removed.
,-o---------o---------o---------o-. ,----. |
| The Diagram is the Program (TM) | | ,-o----------------------------o-.
`-o-----------------------------o-' | | Mathieu Bouchard |
| |---' | http://artengine.ca/matju |
| | `-o------------------------------'
More information about the Pd-list
mailing list