I'm trying several lists from symbols with [moocow/bytes2any] and the following behavior seems a bit strange to me. The following symbols, converted to numeral lists behave fine: a_float, a_string, string, a_bang, bang
The corresponding lists sent to [bytes2any] are: 97 95 102 108 111 97 116 97 95 115 116 114 105 110 103 115 116 114 105 110 103 97 95 98 97 110 103 98 97 110 103
If I send these lists to [bytes2any] it will output the correct messages (a_float, a_string, etc.). The symbol "float" though, which is converted to the list "102 108 11 97 116", when sent to [bytes2any] produces a 0 out the left outlet of the object.
I have attached a patch that demonstrates this. The symbols are converted to lists with [list fromsymbol]. I could use [list tosymbol] to create symbols from the lists, but I want to test [bytes2any] in this case.
Is this behavior expected or is it a bug?
moin Alexandros,
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".
happy solstice, Bryan / moocow
On Thu, Dec 24, 2015 at 7:00 PM, Alexandros Drymonitis adrcki@gmail.com wrote:
I'm trying several lists from symbols with [moocow/bytes2any] and the following behavior seems a bit strange to me. The following symbols, converted to numeral lists behave fine: a_float, a_string, string, a_bang, bang
The corresponding lists sent to [bytes2any] are: 97 95 102 108 111 97 116 97 95 115 116 114 105 110 103 115 116 114 105 110 103 97 95 98 97 110 103 98 97 110 103
If I send these lists to [bytes2any] it will output the correct messages (a_float, a_string, etc.). The symbol "float" though, which is converted to the list "102 108 11 97 116", when sent to [bytes2any] produces a 0 out the left outlet of the object.
I have attached a patch that demonstrates this. The symbols are converted to lists with [list fromsymbol]. I could use [list tosymbol] to create symbols from the lists, but I want to test [bytes2any] in this case.
Is this behavior expected or is it a bug?
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
another moocow question, if you don’t mind…
why does readdir on linux output filenames not in order? 16.* before 10.* for example? on osx and windows i get the expected behaviour.
cheers
On 24 Dec 2015, at 20:54, Bryan Jurish moocow.bovine@gmail.com wrote:
moin Alexandros,
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".
happy solstice, Bryan / moocow
On Thu, Dec 24, 2015 at 7:00 PM, Alexandros Drymonitis <adrcki@gmail.com mailto:adrcki@gmail.com> wrote: I'm trying several lists from symbols with [moocow/bytes2any] and the following behavior seems a bit strange to me. The following symbols, converted to numeral lists behave fine: a_float, a_string, string, a_bang, bang
The corresponding lists sent to [bytes2any] are: 97 95 102 108 111 97 116 97 95 115 116 114 105 110 103 115 116 114 105 110 103 97 95 98 97 110 103 98 97 110 103
If I send these lists to [bytes2any] it will output the correct messages (a_float, a_string, etc.). The symbol "float" though, which is converted to the list "102 108 11 97 116", when sent to [bytes2any] produces a 0 out the left outlet of the object.
I have attached a patch that demonstrates this. The symbols are converted to lists with [list fromsymbol]. I could use [list tosymbol] to create symbols from the lists, but I want to test [bytes2any] in this case.
Is this behavior expected or is it a bug?
Pd-list@lists.iem.at mailto:Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list http://lists.puredata.info/listinfo/pd-list
-- Bryan Jurish "There is *always* one more bug." moocow.bovine@gmail.com mailto:moocow.bovine@gmail.com -Lubarsky's Law of Cybernetic Entomology _______________________________________________ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On 12/24/2015 10:03 PM, Simon Iten wrote:
another moocow question, if you don’t mind…
why does readdir on linux output filenames not in order? 16.* before 10.* for example? on osx and windows i get the expected behaviour.
most likely because readdir(3) does not return the filenames in the order you expect (the order might not be alphabetically but it might be sorted by inode number; or creation date; or...).
to cut it short: readdir(3) doesn't guarantee *any* order. if some filesystems return data in a given order, that is just by accident.
cf. http://stackoverflow.com/questions/8977441
gfamrds IOhannes
On Thu, Dec 24, 2015 at 10:52 PM, IOhannes m zmölnig zmoelnig@iem.at wrote:
On 12/24/2015 10:03 PM, Simon Iten wrote:
why does readdir on linux output filenames not in order? 16.* before
10.* for example? most likely because readdir(3) does not return the filenames in the order you expect (the order might not be alphabetically but it might be sorted by inode number; or creation date; or...).
to cut it short: readdir(3) doesn't guarantee *any* order. if some filesystems return data in a given order, that is just by accident.
+1 ... beat me to it ;-)
marmosets, Bryan
On Thu, Dec 24, 2015 at 9:54 PM, Bryan Jurish moocow.bovine@gmail.com wrote:
moin Alexandros,
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...
moin Alexandros,
On Fri, Dec 25, 2015 at 11:43 AM, Alexandros Drymonitis adrcki@gmail.com wrote:
On Thu, Dec 24, 2015 at 9:54 PM, Bryan Jurish moocow.bovine@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
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@gmail.com wrote:
moin Alexandros,
On Fri, Dec 25, 2015 at 11:43 AM, Alexandros Drymonitis adrcki@gmail.com wrote:
On Thu, Dec 24, 2015 at 9:54 PM, Bryan Jurish moocow.bovine@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@gmail.com -Lubarsky's Law of Cybernetic Entomology