--- On Wed, 7/29/09, Hans Roels <[email protected]> wrote:
> From: Hans Roels <[email protected]>
> Subject: [PD] changeable receive
> To: [email protected]
> Date: Wednesday, July 29, 2009, 5:00 PM
> hello,
>
> From what I read and tried, it is impossible to change the
> argument of 'receive' (like the right inlet of send) in
> Pd-vanilla.
> Is there a trick to solve this in vanilla?
>
> I want to be able to insert the names of various receives
> in symbol boxes. The only way to do this is by using a
> slider or number box and sending a [receive $1( to
> this object. This works but
> 1. I can only receive numbers from this 'receive' and not
> lists, symbols,... like a normal receive
> 2. in this way all these GUI are using CPU. Does it help to
> reduce the CPU consumption if I reduce the size of this GUI
> to the minimum?
>
> I hope somebody has found a hack for this problem?
You could use a bunch of spigots, or [list prepend] + [route], but both
have the limitation that you must know what the receive names are
ahead of time.
Here's a solution that uses dynamic patching. If there's a way to do this
in vanilla without it, I'd like to know it, too.
-Jonathan
#N canvas 251 243 592 280 12;
#X obj 134 10 loadbang;
#X obj 134 163 pack s \$0;
#N canvas 82 242 144 103 \$0-dynamic 0;
#X restore 10 163 pd \$0-dynamic;
#X obj 10 238 outlet;
#X obj 134 35 list prepend \$1;
#X obj 134 138 route symbol;
#X obj 10 10 inlet;
#X obj 10 213 r \$0-out;
#X obj 134 238 s pd-\$0-dynamic;
#X msg 134 213 clear \, obj 0 0 r \$1 \, obj 0 30 s \$2-out \, connect
0 0 1 0;
#X msg 227 163 error: receive name must be a symbol;
#X obj 227 188 print;
#X obj 134 60 route symbol;
#X obj 227 85 b;
#X obj 227 110 symbol;
#X connect 0 0 4 0;
#X connect 1 0 9 0;
#X connect 4 0 12 0;
#X connect 5 0 1 0;
#X connect 5 1 10 0;
#X connect 6 0 5 0;
#X connect 7 0 3 0;
#X connect 9 0 8 0;
#X connect 10 0 11 0;
#X connect 12 0 5 0;
#X connect 12 1 13 0;
#X connect 13 0 14 0;
#X connect 14 0 1 0;
#N canvas 454 274 319 200 12;
#X obj 10 154 print;
#X obj 10 57 s bar;
#X obj 170 57 s foo;
#X msg 170 97 symbol foo;
#X msg 10 7 1 2 3 4 5;
#X msg 170 7 6 7 8 9 0;
#X msg 180 32 foo6 7 8 9 0;
#X msg 20 32 bar1 2 3 4 5;
#X msg 10 97 symbol bar;
#X obj 10 129 dynr foo;
#X obj 225 132 dynr;
#X floatatom 225 157 5 0 0 0 - - -;
#X floatatom 171 132 5 0 0 0 - - -;
#X obj 171 154 s;
#X connect 3 0 9 0;
#X connect 4 0 1 0;
#X connect 5 0 2 0;
#X connect 6 0 2 0;
#X connect 7 0 1 0;
#X connect 8 0 9 0;
#X connect 9 0 0 0;
#X connect 10 0 11 0;
#X connect 12 0 13 0;
_______________________________________________
[email protected] mailing list
UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list