[PD] sending to arbitrary receivers

Frank Barknecht fbar at footils.org
Fri Aug 11 01:21:39 CEST 2006


Hallo,
Frank Barknecht hat gesagt: // Frank Barknecht wrote:

> A third solution would be to use a fixed send/receiver name and use
> [route] to route incoming messages according to their first element. 
> 
> You can use the [list prepend]-[list trim] idiom to easily construct
> such messages.

I attached an illustration of how I use this idea normally. Although I
used [list] here, the basic approach works without it as well, I just
used [list] because it's so convenient.

IMO this is almost fully equivalent to renaming sends and receives and
should catch most cases where one might want to use these. The main
advantage, or the advantage important to me is, that it reduces the
number of globally visible receivers to basically one or two. I tend
to avoid pollution of the receiver namespace whereever possible, but
that may be a style or taste issue.

Ciao
-- 
 Frank Barknecht                 _ ______footils.org_ __goto10.org__
-------------- next part --------------
#N canvas 0 0 598 395 10;
#X obj 103 115 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -262144
-1 -1 12000 1;
#X obj 100 74 route \$1-r;
#X obj 100 46 r GLOBAL-R;
#X obj 100 211 s GLOBAL-S;
#X obj 100 143 list prepend \$1-s;
#X obj 100 173 list trim;
#X connect 0 0 4 0;
#X connect 1 0 0 0;
#X connect 2 0 1 0;
#X connect 4 0 5 0;
#X connect 5 0 3 0;
#X coords 0 -1 1 1 133 30 1 100 100;
-------------- next part --------------
#N canvas 234 353 587 336 10;
#X floatatom 123 188 5 0 0 0 - - -;
#X obj 123 230 list trim;
#X obj 123 256 s GLOBAL-R;
#X obj 425 76 r GLOBAL-S;
#X floatatom 425 140 5 0 0 0 - - -;
#X floatatom 468 141 5 0 0 0 - - -;
#X msg 305 113 2-r;
#X msg 146 114 1-r;
#X obj 425 113 route 1-s 2-s;
#X obj 98 74 myhsl 1;
#X obj 243 75 myhsl 2;
#X obj 123 208 list prepend 1-r;
#X connect 0 0 11 0;
#X connect 1 0 2 0;
#X connect 3 0 8 0;
#X connect 6 0 11 1;
#X connect 7 0 11 1;
#X connect 8 0 4 0;
#X connect 8 1 5 0;
#X connect 11 0 1 0;


More information about the Pd-list mailing list