[PD] receive from multiple symbols in an external (using pd_bind)

Jacob Lee artdent at gmail.com
Sun Sep 14 03:48:36 CEST 2008


On Sat, Sep 13, 2008 at 3:47 PM, Claude Heiland-Allen
<claudiusmaximus at goto10.org> wrote:
> Jacob Lee wrote:
>>
>> For example,
>> if I do:
>> pd_bind(&x->x_obj.ob_pd, gensym("a"));
>> pd_bind(&x->x_obj.ob_pd, gensym("b"));
>>
>> and create corresponding [s a] and [s b] objects, I will receive
>> messages sent via those objects -- but there is no indication which
>> came from which.
>
> Proxies!  pdlua has an implementation that seems to work for me, there might
> be a better way to implement it for a C-based external though.
>
> svn co https://code.goto10.org/svn/maximus/pdlua pdlua
>

Ah ha! That's exactly what I'm looking for. And not quite as
complicated as I had feared.

>> The complicated workaround is to create a new object for each symbol I
>> want to receive on. But before I pursue that (tedious and difficult)
>> route, is there a more straightforward way to accomplish this?
>
> Yeah, it's not ideal, but this proxy solution isn't so tedious if you make
> it generic enough, which isn't too hard.
>
> Maybe there should be a libpdutils for such common tasks, pending inclusion
> into pd?
>

+1. Though it's really hard to say what's a common task.

At any rate, if what I end up writing looks generally useful, I'll
extract the proxy bits and post it somewhere.

-- 
Jacob Lee
artdent at gmail.com




More information about the Pd-list mailing list