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

Alexandros Drymonitis adrcki at gmail.com
Wed Dec 30 19:44:50 CET 2015


Ok, I got it. The selector needs to be prepended as a list. So the "symbol"
selector needs to be prepended as "115 121 109 98 111 108 32" (with the
white space at the end).
I'm using it in an abstraction I've made for communicating with the Arduino
and in the vanilla version of it, where I use [list tosymbol] I didn't have
this problem...

Thanks for that!

On Wed, Dec 30, 2015 at 1:54 PM, Bryan Jurish <moocow.bovine at gmail.com>
wrote:

> 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/a7204b36/attachment.html>


More information about the Pd-list mailing list