[PD] sprintf and netsend for comma delimited UDP data

florian mosleh florian.m at coolux-us.com
Tue Mar 10 20:17:16 CET 2009


Hello,

   I already posted this to the forum, so I hope it's no foible to post 
it here as well...

I am building a connector for PD to communicate with an external 
application running on another system. I am using netsend to craft UDP 
packets that the remote application can parse for actions. The payload 
is supposed to look sort of like this:
(STRING,STRING,INTEGER,INTEGER,STRING,INTEGER)

Initially I was unable to get commas into the netsend stream because PD 
uses commas as in internal delimiter. I was able to circumvent this by 
using the cyclone external's 'sprintf' function. Like this:

|44|
|
|send  (STRING%cSTRING%cINTEGER%cINTEGER%cSTRING%cINTEGER) |
|
|netsend|

this almost works, except that pd inserts whitespace characters after 
the commas, which the remote application doesn't understand.

I noticed that 'print' actually puts a space before and after the 
commas, whereas netsend (or sprintf) only puts one after the commas.

Does anyone know how to circumvent this behavior? Or, perhaps a simpler 
way to achieve what I am trying to do?

Thank you.

Florian
-- 

 :[ flo ]:


There is something you must understand about the Soviet system.  They have the
ability to concentrate all their efforts on a given design, and develop all
components simulateously, but sometimes without proper testing.  Then they end
up with a technological disaster like the Tu-144.  In a technology race at
the time, that aircraft was two months ahead of the Concorde.  Four Tu-144s
were built; two have crashed, and two are in museums.  The Concorde has been
flying safely for over 10 years.
-- Victor Belenko, MiG-25 fighter pilot who defected in 1976
   "Defense Electronics", Vol 20, No. 6, pg. 100

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20090310/e06949cc/attachment.htm>


More information about the Pd-list mailing list