[PD] parsing the netreceive data

IOhannes m zmölnig zmoelnig at iem.at
Sun May 22 00:14:24 CEST 2005


Paris Treantafeles wrote:
> hi list,
> 
> i'm experimenting with netsend/receive and have a question about the 
> data that is received.
> 
> on the machine where i have netsend i have messages like:
> 
> send valRed $1
> and
> send valBlue $1
> 
> where each send message gets numerical values.
> 
> 
> on the machine where i have netreceive i have a print object.
> which is correctly printing things like
> valRed 145
> valBlue 203
> 
> my stupid question is how do i parse this data to use it with objects?
> i tried using a number atom and setting the receive symbol value to 
> valRed, but it gets nothing.
> i tried using unpack after the netreceive object eg.

the message you get out of [netreceive] is exactly [valRed 145(
[unpack] expects a "list" consisting of a symbol and a floating point 
value; this list would look like [list valRed 145(
the messages [list valRed 145( and [valRed 145( are _not_ the same (as 
can be seen by looking at them)
the whys and hows have often been discussed on this list, so please 
search the archives on that topic.

apart from that, unpacking won't help you much with your problem.
what you will need is something like

|
[route valRed valBlue valGreen]
|        |          |         |


mfg.asdf.ca
IOhannes




More information about the Pd-list mailing list