Hi All! I’m new Here.
I came across a thread from a few months ago that discussed this issue, so hopefully this isn’t too much of a re-tread. Sounded like this was a known “feature” with some workarounds but no clear-cut solution.
I’m trying to route OSC messages, formatted as lists using Pd Vanilla:
[netreceive -u -b 8024] | [oscparse] | [list trim]
I see my list in the Pd window when the result is sent to [print], but when I [route] by the first number, nothing passes through. I’m able to route everything I need to in Max this way so some of this is admittedly due to not understanding the different ways Pd handles the data.
Any help / workarounds are much appreciated!
-Joel
Hi Joel,
On 14/05/15 11:45, Joel Corelitz wrote:
I’m able to route everything I need to in Max this way so some of this is admittedly due to not understanding the different ways Pd handles the data.
It's super annoying, but what is actually coming from oscparse is a "symbol" not a float. In Pd there is currently no way to re-cast a symbol-float atom back to what it looks like, so instead you'll have to manually create one of these "symbol" floats to compare against, which you can do with a message through makefilename like this:
[42( | [makefilename %d] | into the right inlet of your 'route'.
This will route on the "symbol" 42.
I submitted a patch to Miller to allow [f] to cast those symbol-floats back to floats (since there are now 3 different ways to accidentally or purposely create a symbol-float) a while back but I think he thinks there is a better way of handling this situation.
Cheers,
Chris.
Thanks, Chris - I really appreciate the help.
I’m still doing something wrong though. When I send the message [42( to [makefilename %d] I get an “ inlet: expected 'float' but got ‘1’” error from [route]. Seems like it’s still a symbol.
--Joel Corelitz / waveplant http://www.waveplantstudios.com (http://www.waveplantstudios.com/)
joel@waveplantstudios.com (mailto:joel@waveplantstudios.com) 312-348-5798 (tel:312-348-5798) (voice & fax)
On Wednesday, May 13, 2015 at 11:56 PM, Chris McCormick wrote:
Hi Joel,
On 14/05/15 11:45, Joel Corelitz wrote:
I’m able to route everything I need to in Max this way so some of this is admittedly due to not understanding the different ways Pd handles the data.
It's super annoying, but what is actually coming from oscparse is a "symbol" not a float. In Pd there is currently no way to re-cast a symbol-float atom back to what it looks like, so instead you'll have to manually create one of these "symbol" floats to compare against, which you can do with a message through makefilename like this:
[42( | [makefilename %d] | into the right inlet of your 'route'.
This will route on the "symbol" 42.
I submitted a patch to Miller to allow [f] to cast those symbol-floats back to floats (since there are now 3 different ways to accidentally or purposely create a symbol-float) a while back but I think he thinks there is a better way of handling this situation.
Cheers,
Chris.
On 05/14/2015 04:31 PM, Joel Corelitz wrote:
Thanks, Chris - I really appreciate the help.
I’m still doing something wrong though. When I send the message [42( to [makefilename %d] I get an “ inlet: expected 'float' but got ‘1’” error from [route].
i'm pretty sure you get a slightly different error, but anyhow:
Seems like it’s still a symbol.
actually, what chris suggested was not to convert the symbol into a float (which currently is hard to to if not impossible in Pd), but convert a [route]-selector into a symbol as well. this will only work if [route] is not in the (default) float-mode, so you need to create it as something like:
[route fourtytwo]
(with the argument being a symbol).
then you use [makefilename %d] to convert the number 42 into the symbol "42", and override the [route]-selector "fourtytwo" with this new symbol.
after that, [route] will route the "42"-symbol just fine.
gfmadsr IOhannes
Hi Joel,
On 14/05/15 22:31, Joel Corelitz wrote:
I’m still doing something wrong though. When I send the message [42( to [makefilename %d] I get an “ inlet: expected 'float' but got ‘1’” error from [route]. Seems like it’s still a symbol.
I think route by default expects an float to the right inlet. To have it expect a symbol you need to create it with a symbol to start with. So replace [route] with [route replaceme] and then the 42->makefilename->right inlet should work.
Cheers,
Chris.
Chris, thanks again - realized this after I posted, was a total oversight on my part. Your solution works great and I understand it now.
Part of my issue is that after hacking around with this, I realized that my OSC commands, generated by a node.js server, start with a leading space so I have to figure out how to get [route] to recognize that, or how to escape it!
--Joel Corelitz / waveplant http://www.waveplantstudios.com (http://www.waveplantstudios.com/)
joel@waveplantstudios.com (mailto:joel@waveplantstudios.com) 312-348-5798 (tel:312-348-5798) (voice & fax)
On Thursday, May 14, 2015 at 11:57 PM, Chris McCormick wrote:
Hi Joel,
On 14/05/15 22:31, Joel Corelitz wrote:
I’m still doing something wrong though. When I send the message [42( to [makefilename %d] I get an “ inlet: expected 'float' but got ‘1’” error from [route]. Seems like it’s still a symbol.
I think route by default expects an float to the right inlet. To have it expect a symbol you need to create it with a symbol to start with. So replace [route] with [route replaceme] and then the 42->makefilename->right inlet should work.
Cheers,
Chris.
Am 14. Mai 2015 05:45:11 MESZ, schrieb Joel Corelitz joel@waveplantstudios.com:
Hi All! I’m new Here.
I came across a thread from a few months ago that discussed this issue, so hopefully this isn’t too much of a re-tread. Sounded like this was a known “feature” with some workarounds but no clear-cut solution.
I’m trying to route OSC messages, formatted as lists using Pd Vanilla:
[netreceive -u -b 8024] | [oscparse] | [list trim]
I see my list in the Pd window when the result is sent to [print], but when I [route] by the first number, nothing passes through. I’m able to route everything I need to in Max this way so some of this is admittedly due to not understanding the different ways Pd handles the data.
Any help / workarounds are much appreciated.
Hi, I have made an abstraction for that, that uses l2s and l2s from zexy: https://github.com/residuum/Puredata-abstractions/blob/master/glue/s2f.pd
Hth, Thomas
Thanks, Thomas - looks like what I need but I can’t get zexy to compile. I get errors when running the scripts.
--Joel Corelitz / waveplant http://www.waveplantstudios.com (http://www.waveplantstudios.com/)
joel@waveplantstudios.com (mailto:joel@waveplantstudios.com) 312-348-5798 (tel:312-348-5798) (voice & fax)
On Thursday, May 14, 2015 at 7:43 AM, Thomas Mayer wrote:
Am 14. Mai 2015 05:45:11 MESZ, schrieb Joel Corelitz <joel@waveplantstudios.com (mailto:joel@waveplantstudios.com)>:
Hi All! I’m new Here.
I came across a thread from a few months ago that discussed this issue, so hopefully this isn’t too much of a re-tread. Sounded like this was a known “feature” with some workarounds but no clear-cut solution.
I’m trying to route OSC messages, formatted as lists using Pd Vanilla:
[netreceive -u -b 8024] | [oscparse] | [list trim]
I see my list in the Pd window when the result is sent to [print], but when I [route] by the first number, nothing passes through. I’m able to route everything I need to in Max this way so some of this is admittedly due to not understanding the different ways Pd handles the data.
Any help / workarounds are much appreciated.
Hi, I have made an abstraction for that, that uses l2s and l2s from zexy:
https://github.com/residuum/Puredata-abstractions/blob/master/glue/s2f.pdHth, Thomas
--
Sent from a mobile device.
here’s my patch:
#N canvas 0 22 450 300 10; #X obj 76 37 netreceive -u -b 8024; #X obj 79 71 oscparse; #X obj 248 26 loadbang; #X msg 247 64 1; #X obj 83 194 print routed; #X obj 249 104 makefilename %d; #X obj 83 146 route one; #X obj 84 117 list trim; #X connect 0 0 1 0; #X connect 1 0 7 0; #X connect 2 0 3 0; #X connect 3 0 5 0; #X connect 5 0 6 1; #X connect 6 0 4 0; #X connect 7 0 6 0;
I’m not sure if I need [list trim] but I’ve tried without it and I can’t get the left outlet of [route] to output anything.
IOhannes, thanks for the clarification. My OSC data is a string of numbers, indicating positions on various 4x4 grids, with the final number being 0 or 1.
Based on what you’re saying, with the solution Chris described, will I even be able to use those numbers as numbers? Maybe just cover them to bangs with [sel]?
On Thursday, May 14, 2015 at 10:54 AM, Joel Corelitz wrote:
Thanks, Thomas - looks like what I need but I can’t get zexy to compile. I get errors when running the scripts.
--Joel Corelitz / waveplant http://www.waveplantstudios.com (http://www.waveplantstudios.com/)
joel@waveplantstudios.com (mailto:joel@waveplantstudios.com) 312-348-5798 (tel:312-348-5798) (voice & fax)
On Thursday, May 14, 2015 at 7:43 AM, Thomas Mayer wrote:
Am 14. Mai 2015 05:45:11 MESZ, schrieb Joel Corelitz <joel@waveplantstudios.com (mailto:joel@waveplantstudios.com)>:
Hi All! I’m new Here.
I came across a thread from a few months ago that discussed this issue, so hopefully this isn’t too much of a re-tread. Sounded like this was a known “feature” with some workarounds but no clear-cut solution.
I’m trying to route OSC messages, formatted as lists using Pd Vanilla:
[netreceive -u -b 8024] | [oscparse] | [list trim]
I see my list in the Pd window when the result is sent to [print], but when I [route] by the first number, nothing passes through. I’m able to route everything I need to in Max this way so some of this is admittedly due to not understanding the different ways Pd handles the data.
Any help / workarounds are much appreciated.
Hi, I have made an abstraction for that, that uses l2s and l2s from zexy:
https://github.com/residuum/Puredata-abstractions/blob/master/glue/s2f.pdHth, Thomas
--
Sent from a mobile device.