[PD] packOSC "BLOB"

Martin Peach martin.peach at sympatico.ca
Mon May 11 17:00:41 CEST 2009


IOhannes m zmoelnig wrote:
> Martin Peach wrote:
>> Wolfgang Jäger wrote:
>>> Hello,
>>>
>>> For sending audio efficiently over OSC I would need an OSC-"BLOB".
>>> Unfortunately the packOSC object supports no OSC-"BLOB"s.
>>> Is there any possibility to send BLOBs?
> 
> since blob is an arbitrary type, you have to interpret/generate this 
> list of bytes somehow in your patch.
> if you are working that low-level, i guess you can also de/construct 
> OSC-packages on your own.
> 
>>> ciao
>>>
>>
>> I can probably add a Blob type to [packOSC] and [unpackOSC]. The thing 
>> is that the blob type is supposed to consist of arbitrary bytes 
>> (8-bits), but Pd audio works with 32-bit floats. There is nothing 
>> [unpackOSC] can do with a received blob except output the list of 
>> bytes, so some other object would be needed to pack groups of 4 bytes 
>> into floats again.
>> It may end up being just as efficient to send a bunch of floats for 
>> each signal vector.
> 
> iirc, for the very project the decoding is done outside of Pd anyhow (on 
> specialized hardware), so the problem of [unpackOSC] not knowing what to 
> do with a blob is a minor issue here. (and the use of specialized 
> hardware is the reason why data (low-resolution fixed-point numbers) 
> should actually be packed in a blob rather than floating-point).
> 
> i still think (see above) that even [packOSC] cannot provide a 
> consistent interface to pack blobs into an osc message that is 
> sufficiently more simple to use than manually constructing OSC messages.
> 

It might be interesting to have a [netsend~] and [netreceive~] pair that 
send/receive raw Pd sound vectors like [send~] -- no OSC or fancy 
formatting, just UDP packets with floats, except that the first element 
of the list would probably have to be the number of floats in the vector 
unless it's fixed for all time.

[osc~ 330]
|
[netsend~ 127.0.0.1 9998]

[netreceive~ 9998]
|
[dac~]


Martin






More information about the Pd-list mailing list