[PD] PD-list Digest, Vol 27, Issue 78

Mathieu Bouchard matju at artengine.ca
Sat Jun 16 05:24:14 CEST 2007


On Fri, 15 Jun 2007, Roman wrote:
> On Fri, 2007-06-15 at 20:25 +0200, Patco wrote:
>> What about having a static server where we could automatically
>> upload/download sounds and binary files?
> i didn't find a (good) way yet to transmit binary files within pd. do
> you know of any way?

Binary files in netsend have to be transmitted as either floats or 
symbols.

As floats, the theoretical limit for decimals in ASCII is only 41.5% 
efficient, that is, a file of 41500 bytes will be expanded to 100000 
bytes. However, because of limits on number of digits per number, and 
supposing we avoid using the dot, then we can only use numbers from 
-999999 to 999999, and there has to be spaces. If one character out of 7 
has to be a space, the efficiency drops to 35.6%.

As hex, you'd have 50.0% efficiency, but because you have to represent 
this with symbols, you have to put spaces somewhere, else that's a big 
honking memory leak. If you use 256 symbols you have 33.3% efficiency. If 
you use 4096 symbols you have 37.5% efficiency. But if you have 4096 
symbols in base64 (such as MIME) then you have 50% efficiency.

So far, the easiest other ways that I can think of would be:

  * use HTTP (or FTP or SFTP or RSYNC)

  * use OSC and modify the [tcpsend] externals so that they can handle
    Martin Peach's strings/blobs

(I can justify any of the above figures)

  _ _ __ ___ _____ ________ _____________ _____________________ ...
| Mathieu Bouchard - tél:+1.514.383.3801, Montréal QC Canada


More information about the Pd-list mailing list