<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<div>test 1:</div>

<div> </div>

<div>> it does work if there is a list trim after oscparse, but it's confusing because there is no list indicator in oscparse's output</div>

<div> </div>

<div>in this case, [oscparse] outputs a symbol, which is conceptually the same as a list with a single atom. [route symbol] will output a symbol again, which I actually consider a bug (I would expect it to strip the "symbol" selector, just like [route list] does with the "list" selector). Anyway, just use [list trim] after [oscparse] and you're fine.</div>

<div> </div>

<div>---</div>

<div> </div>

<div>test 2:</div>

<div> </div>

<div>> in max/msp, the print from oscformat shows that ints are converted to floats ("1."), while the input from packOSC is kept as it is. There is no difference when sending floats. This is problematic in programs which differentiate between float and int input.</div>

<div> </div>

<div>well, I had exactly the opposite problem with [packOSC] where I *didn't* want to send "1" as int and "1.1" as float. I can see how both type guessing behaviors can be valid, although I tend to agree more with [oscformat] (after all, Pd doesn't have integers). Fortunately, both [oscformat] and [packOSC] support typetags. If you want to send a single integer argument with [oscparse], use [format i(.</div>

<div> </div>

<div>> This is problematic in programs which differentiate between float and int input.</div>

<div> </div>

<div>I think such a program is probably flawed.</div>

<div> </div>

<div>Christof</div>

<div> </div>

<div>PS: although with [oscformat] you *can* set the address pattern with [set /foo/bar(, the more idiomatic way would be [set foo bar(, because this is also what [oscparse] will output.</div>

<div>
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Gesendet:</b> Samstag, 13. Juli 2019 um 12:20 Uhr<br/>
<b>Von:</b> "João Pais" <jmmmpais@gmail.com><br/>
<b>An:</b> "Christof Ressi" <christof.ressi@gmx.at><br/>
<b>Cc:</b> Pd-List <pd-list@lists.iem.at><br/>
<b>Betreff:</b> Re: Re: [PD] Problems with oscformat (and oscparse?) and slashes</div>

<div name="quoted-content">
<div>
<div>I think I delimited the issues more cleary, here is a patch that shows the problems.</div>
 

<div class="gmail_quote">
<div class="gmail_attr">Am Fr., 12. Juli 2019 um 19:26 Uhr schrieb Christof Ressi <<a href="mailto:christof.ressi@gmx.at" onclick="parent.window.location.href='mailto:christof.ressi@gmx.at'; return false;" target="_blank">christof.ressi@gmx.at</a>>:</div>

<blockquote class="gmail_quote" style="margin: 0.0px 0.0px 0.0px 0.8ex;border-left: 1.0px solid rgb(204,204,204);padding-left: 1.0ex;">
<div>
<div style="font-family: Verdana;font-size: 12.0px;">
<div>> but that will mean that for every new string, a new oscparse must be created, in contrary to the current practice, where the message has all the addresses in it.
<div> </div>

<div>mrpeach: [/foo/bar 1 2 3( -> [packOSC]</div>

<div>Vanilla: [set foo bar, 1 2 3( -> [oscformat] *** mind the comma! ***</div>

<div> </div>

<div>> the output in Pd is "symbol /output_1"</div>

<div> </div>

<div>are you sure? the output should be "symbol output_1" (without a slash!)</div>

<div> </div>

<div>> and route doesn't filter the content.</div>

<div> </div>

<div>
<div>[oscparse] outputs a list, so you have to send it to [list trim], then you can use [route] in the way you intend it.</div>

<div> </div>

<div>Christof</div>

<div style="margin: 10.0px 5.0px 5.0px 10.0px;padding: 10.0px 0.0px 10.0px 10.0px;border-left: 2.0px solid rgb(195,217,229);">
<div style="margin: 0.0px 0.0px 10.0px;"><b>Gesendet:</b> Freitag, 12. Juli 2019 um 19:15 Uhr<br/>
<b>Von:</b> "João Pais" <<a href="mailto:jmmmpais@gmail.com" onclick="parent.window.location.href='mailto:jmmmpais@gmail.com'; return false;" target="_blank">jmmmpais@gmail.com</a>><br/>
<b>An:</b> "Miller Puckette" <<a href="mailto:msp@ucsd.edu" onclick="parent.window.location.href='mailto:msp@ucsd.edu'; return false;" target="_blank">msp@ucsd.edu</a>><br/>
<b>Cc:</b> "<a href="mailto:pd-list@lists.iem.at" onclick="parent.window.location.href='mailto:pd-list@lists.iem.at'; return false;" target="_blank">pd-list@lists.iem.at</a>" <<a href="mailto:pd-list@mail.iem.at" onclick="parent.window.location.href='mailto:pd-list@mail.iem.at'; return false;" target="_blank">pd-list@mail.iem.at</a>><br/>
<b>Betreff:</b> Re: [PD] Problems with oscformat (and oscparse?) and slashes</div>

<div>
<div>
<div>that is correct - but that will mean that for every new string, a new oscparse must be created, in contrary to the current practice, where the message has all the addresses in it.</div>

<div>2 other issues, but I can't reproduce them here:</div>

<div>- when I send an address with a number added to it, the external program doesn't accept it. When I send the same message with mrpeach, it works. In Pd (and even through unpackOSC) they look the same.</div>

<div>- when receiving the message "/output_1", oscparse doesn't process it in the same way as mrpeach: the output in Pd is "symbol /output_1", and route doesn't filter the content.</div>

<div> </div>

<div>I didn't check the exact osc code traffic, maybe later I can do that.</div>

<div> </div>

<div>Joao</div>
</div>
 

<div class="gmail_quote">
<div class="gmail_attr">Am Fr., 12. Juli 2019 um 18:18 Uhr schrieb Miller Puckette <<a href="mailto:msp@ucsd.edu" onclick="parent.window.location.href='mailto:msp@ucsd.edu'; return false;" target="_blank">msp@ucsd.edu</a>>:</div>

<blockquote class="gmail_quote" style="margin: 0.0px 0.0px 0.0px 0.8ex;border-left: 1.0px solid rgb(204,204,204);padding-left: 1.0ex;">Hi Joao -<br/>
<br/>
I might be misunderstanding the problem, but to specify an address like<br/>
"/parameter/bla" you can sen oscformat a list, "parameter bla" (the slashes<br/>
are delimiters between the elements of the address, each of which is a<br/>
symbol without any slashes in it.)  So you can simply send the message "1"<br/>
to the object "oscformat parameter bla".<br/>
<br/>
cheers<br/>
Miller<br/>
<br/>
On Fri, Jul 12, 2019 at 05:48:19PM +0200, Jo??o Pais wrote:<br/>
> Hi all,<br/>
><br/>
> I'm having some issues with oscformat and slashes ( / ). Many programs out<br/>
> there use formats such as "/parameter/bla 1", but both oscformat and<br/>
> oscparse don't really cope that well with them.<br/>
><br/>
> For oscformat:<br/>
> - it's not possible to send a string starting with a slash, the message<br/>
> "oscformat: no method for '/aa' " appears.<br/>
> - A hack can be done by sending a message [set /aa, bang( ...<br/>
> - ... but this doesn't work if the message to send is /aa 1, as oscparse<br/>
> will convert it to /aa/1<br/>
> - defining an object as [oscformat /aa] seems to work, but it will mean<br/>
> that another oscformat object has to be defined for each single string<br/>
> being sent: /aa, /aa/a, /aa/b, ...<br/>
><br/>
> For oscparse:<br/>
> - when it receives a message with slashes in it, it removes the slashes<br/>
> automatically. Which is kind of acceptable, if it's going to be connected<br/>
> with a normal route. But not that much if the message is going to be worked<br/>
> on, and resent.<br/>
><br/>
> Or is there any other way of doing this? The documentation doesn't present<br/>
> anything else. It took some time of screaming at the computer until I<br/>
> compared the results with mrpeach's objects.<br/>
><br/>
> Best,<br/>
><br/>
> Joao<br/>
<br/>
> _______________________________________________<br/>
> <a href="mailto:Pd-list@lists.iem.at" onclick="parent.window.location.href='mailto:Pd-list@lists.iem.at'; return false;" target="_blank">Pd-list@lists.iem.at</a> mailing list<br/>
> UNSUBSCRIBE and account-management -> <a href="https://lists.puredata.info/listinfo/pd-list" target="_blank">https://lists.puredata.info/listinfo/pd-list</a><br/>
 </blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div></div></body></html>