[PD] Getting 32 bit floating point number from 4 sequential bytes

Roman Haefeli reduzent at gmail.com
Sun Apr 7 17:52:06 CEST 2019

Hi Arda

On Fri, 2019-04-05 at 16:00 +0300, Arda Eden wrote:
> I am reading the udp data with [netreceive] succesfully and able to
> reach any value I need.  Now trying to find a way to combine these
> (big endian) sequential 4 bytes in order to get the resulting 32 bit
> floating point number. A little advice would speed me up.

Don't know if you need to do it in your own external. If you do the
message parsing in Pd (as opposed to a dedicated external), check
attached patch. It converts between floats and 4-byte-lists. Probably
not efficient, when converting tons of numbers, but easy if you're
looking for a quick'n'dirty solution.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: convert-float-bytes.pd
Type: text/x-puredata
Size: 886 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20190407/ebf1b166/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20190407/ebf1b166/attachment.sig>

More information about the Pd-list mailing list