send respectively forward

klaus filip's icon

hi there,
can someone please provide me with a simple example of
how to generate a message,
that will be received by a receive object.
lets say a [r bla].
i tried with typedmess(), but failed..
thanks a lot
klaus

klaus filip's icon

ok, i found my simple one:

void myobject_anything(t_myobject *x, t_symbol *s, long ac, t_atom *av)
{
    if(s->s_thing) typedmess(s->s_thing,gensym("list"),ac,av);
}

which sends 4.56 to a [r bla] if i pass the message bla 4.56
thats what i wanted.
but i am wondering why this is quite a bit slower than a patched combination of vanilla route and send.
any insights on this speed issue?

cheers
klaus

Timothy Place's icon

Hi Klaus,

It's bit hard to know with limited information. One could speculate, however, that the call to gensym() here is expensive. You could cache the result of gensym("list"), or use the cached version from commonsyms.

best,
Tim