[PD] Weird behavior of [moocow/bytes2any], or not?

Bryan Jurish moocow.bovine at gmail.com
Wed Dec 30 12:54:35 CET 2015


moin Alexandros,

On Fri, Dec 25, 2015 at 11:43 AM, Alexandros Drymonitis <adrcki at gmail.com>
wrote:
>
> On Thu, Dec 24, 2015 at 9:54 PM, Bryan Jurish <moocow.bovine at gmail.com>
> wrote:
>
>> looks like you're creating an "any" message with the selector "float",
>> which iirc pd interprets as it does the output of a [float] object. without
>> further arguments (the float value), the float's value defaults to zero.
>>  if you really want the symbol "float", prefix it with the selector
>> "symbol" or "list".
>>
> This doesn't seem to fix it. Tried both prefixes but with the "list"
> prefix I still get a 0, and with the "symbol" prefix I get a bang...
>

where are you inserting the selectors?  i just tried here and i get "0" for
the "list" selector too, but "symbol" ought to work -- of course, it's a
problem if you might also be passing through "real" floats (i.e.
real-valued numbers like "42.247" or some such).

i'm not sure what context you're using this in, but i think you're running
into the fact that pd internally handles some selectors (notably "float"
and "symbol") differently from most others.  so passing a 'pure' symbol
"float" through [any2bytes] should be the same as passing the output of a
message box [float( through it, i.e. [list 102 108 111 97 116(.
 [bytes2any] should map that right back onto a simple [float( message, but
[print] is likely to output "0" for that.  if you need [float( alone to map
to [symbol float(, then my guess is that you'll need to handle that
specially.

marmosets,
  Bryan


-- 
Bryan Jurish                           "There is *always* one more bug."
moocow.bovine at gmail.com         -Lubarsky's Law of Cybernetic Entomology
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20151230/574143e1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bytes2any_floattest.pd
Type: text/x-puredata
Size: 481 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20151230/574143e1/attachment.bin>


More information about the Pd-list mailing list