[PD] sending a text file through netsend
Frank Barknecht
fbar at footils.org
Thu Nov 2 19:09:11 CET 2006
Hallo,
poil at apfrod.com hat gesagt: // poil at apfrod.com wrote:
> I'd like to send an entire external text file (xml) over tcp on a bang.
> I'm currently struggling with the textfile object and netsend. Are there
> better ways?
>
> Textfile assumes I want to send a line at a time, while netsend wants a
> message with "send" at the start and then the entire string I want to
> send. A message with "send $1" only sends the second word of any line.
To dynamically prepend a "send" in front of a list of unknown length
you can use [list prepend send]. This will generate a message: "list
send a b c d ..."
However [netsend] wants to get a message not starting with "list send"
but only with "send ..." so you need to use an additional [list trim]
to remove the "list"-part. All together this will be like this:
[textfile]
|
[list prepend send]
|
[list trim]
|
[netsend]
Ciao
--
Frank Barknecht _ ______footils.org_ __goto10.org__
More information about the Pd-list
mailing list