[PD] variable arguments to route
David Merrill
dmerrill at media.mit.edu
Thu Jul 6 21:40:17 CEST 2006
Frank, I'm puzzled.. Your attached version works given the inputs you've
set up as an example, but mine doesn't - and I'm not sure what the
difference is. I suspect that there is a difference in how the messages
emerge from netreceive.. Here is my setup:
[netreceive 4955 1]
|
[route $1-id]
| |
and everything goes to the rightmost outlet, when strings come in like:
0-id blah blah blah
..I even tried putting a [list trim] in as you suggest:
[netreceive 4955 1]
|
[list trim]
|
[route $1-id]
| |
And it all *still* goes to the right.. Is it a subtle message-type-problem?
thanks!
-David M.
Frank Barknecht wrote:
> Hallo,
> David Merrill hat gesagt: // David Merrill wrote:
>
>
>> I'm having trouble instantiating a route object with $1 type variable
>> arguments... I made the following object:
>>
>> [route $1-id]
>>
>> where $1 is an argument to the patch, 0 for instance - but messages like
>> 0-id are getting sent to the rightmost outlet (trash). Does route
>> require literal (non variable) arguments?
>>
>
> No, route with arguments works. I guess you're making a different
> mistake. My crystal ball say, it is the one in attached patch. ;)
>
> Ciao
>
> ------------------------------------------------------------------------
>
> #N canvas 0 0 450 300 10;
> #X obj 84 126 route \$1-id;
> #X obj 84 101 inlet;
> #X obj 84 155 outlet;
> #X obj 156 156 outlet;
> #X connect 0 0 2 0;
> #X connect 0 1 3 0;
> #X connect 1 0 0 0;
>
> ------------------------------------------------------------------------
>
> #N canvas 0 0 777 395 10;
> #X obj 179 210 rid 0;
> #X msg 179 112 0-id 123;
> #X msg 264 109 list 0-id 123;
> #X obj 179 265 print HIT;
> #X msg 264 137 list 0-id 123;
> #X obj 264 161 list trim;
> #X text 164 307 Hint: Move [list trim] into the abstraction directly
> in frot of the[route];
> #X text 180 87 HIT;
> #X text 268 86 MISS;
> #X text 374 137 HIT again;
> #X obj 209 236 print MISS;
> #X connect 0 0 3 0;
> #X connect 0 1 10 0;
> #X connect 1 0 0 0;
> #X connect 2 0 0 0;
> #X connect 4 0 5 0;
> #X connect 5 0 0 0;
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> PD-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
>
--
MIT Media Lab
dmerrill at media.mit.edu
More information about the Pd-list
mailing list