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

Jacob Lee artdent at gmail.com
Sat Sep 13 22:19:15 CEST 2008


I'm trying to hack plugin~ to accept a "bind foo" message that causes
it to listen for messages sent to "foo-gain", "foo-drive", etc., as
determined by the list of parameters the plugin accepts. Right now,
every time I want to try out a new plugin, I have to do a bunch of
wiring to receive a message, scale it appropriately (since I keep all
my adjustable parameters in the range 0-127), and convert it to
something like "control drive $1". My goal is to eliminate most of
those steps with some help from plugin~ itself, which should be able
to enumerate all the inputs, get their range, and listen for messages
appropriately.

The problem I'm running into is that if I have made multiple pd_bind
calls in the same object, to receive based on more than one symbol, I
can't tell which symbol the incoming messages came from. 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.

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?

Thanks,
-- 
Jacob Lee
artdent at gmail.com




More information about the Pd-list mailing list