[PD] netreceive text messages

Frank Barknecht fbar at footils.org
Sun May 25 18:36:27 CEST 2008

Jack hat gesagt: // Jack wrote:

> Maybe this can help.
> ++

It's probably better to use: 

 [netreceive ...]
 [list prepend text]
 [list trim]
 [textextruded ...]

as you don't need to concat the list to a single symbol,
[textextruded] can handle a list of symbols as well, also you don't
need any more externals then.

> Le 25 mai 08 à 13:27, Joseph Barrows a écrit :
> >hi PDers,
> >thanks for previous help - i have now got basic messages going over  
> >tcp, but am having trouble passing text messages to PD.  the  
> >problem is spaces (and the first word getting dropped).

What problem are spaces? Regarding the first word being dropped: YOu
may want to read up a bit on how messages are handled in Pd, e.g.
here: http://puredata.info/dev/PdMessages

Basically it's like this: Messages in Pd have two parts: A selector,
which is the "first word" from above, and the actual message data. The
selector is "float" for number messages, "symbol" for symbol messages,
"list" for list-messages and other words for "other" or meta-message.
As a special rule, a message without data is converted to a "bang"
message, and messages, whose data part start with a number, can omit
the "float" or "list" selector.

[netceceive] will spit out whatever message type you send to it. So if
you send "text pi pa po", it will output a "text" meta message, if you
send "list a b c", it's a list-message, if you send "hello world",
it's a meta message with selector "hello" i.e. a hello-message.

Now the tricky part that was wrong in your patch: dollar variables in
message boxes like [hello $1( take the replacement values from the
*data part* of incoming messages. The dollar variables ignore any
selectors. See attached patch for an example. 

Note that some selectors actually make a message box do special
things, like the "set" or "addsemi" meta-messages.

 Frank Barknecht                                     _ ______footils.org__
-------------- next part --------------
A non-text attachment was scrubbed...
Name: majortom.pd
Type: application/puredata
Size: 730 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20080525/f8a26f44/attachment.bin>

More information about the Pd-list mailing list