[PD] Problems with oscformat (and oscparse?) and slashes

João Pais jmmmpais at gmail.com
Sat Jul 13 12:20:02 CEST 2019


I think I delimited the issues more cleary, here is a patch that shows the
problems.

Am Fr., 12. Juli 2019 um 19:26 Uhr schrieb Christof Ressi <
christof.ressi at gmx.at>:

> > 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.
>
> mrpeach: [/foo/bar 1 2 3( -> [packOSC]
> Vanilla: [set foo bar, 1 2 3( -> [oscformat] *** mind the comma! ***
>
> > the output in Pd is "symbol /output_1"
>
> are you sure? the output should be "symbol output_1" (without a slash!)
>
> > and route doesn't filter the content.
>
> [oscparse] outputs a list, so you have to send it to [list trim], then you
> can use [route] in the way you intend it.
>
> Christof
> *Gesendet:* Freitag, 12. Juli 2019 um 19:15 Uhr
> *Von:* "João Pais" <jmmmpais at gmail.com>
> *An:* "Miller Puckette" <msp at ucsd.edu>
> *Cc:* "pd-list at lists.iem.at" <pd-list at mail.iem.at>
> *Betreff:* Re: [PD] Problems with oscformat (and oscparse?) and slashes
> 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.
> 2 other issues, but I can't reproduce them here:
> - 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.
> - 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.
>
> I didn't check the exact osc code traffic, maybe later I can do that.
>
> Joao
>
> Am Fr., 12. Juli 2019 um 18:18 Uhr schrieb Miller Puckette <msp at ucsd.edu>:
>
>> Hi Joao -
>>
>> I might be misunderstanding the problem, but to specify an address like
>> "/parameter/bla" you can sen oscformat a list, "parameter bla" (the
>> slashes
>> are delimiters between the elements of the address, each of which is a
>> symbol without any slashes in it.)  So you can simply send the message "1"
>> to the object "oscformat parameter bla".
>>
>> cheers
>> Miller
>>
>> On Fri, Jul 12, 2019 at 05:48:19PM +0200, Jo??o Pais wrote:
>> > Hi all,
>> >
>> > I'm having some issues with oscformat and slashes ( / ). Many programs
>> out
>> > there use formats such as "/parameter/bla 1", but both oscformat and
>> > oscparse don't really cope that well with them.
>> >
>> > For oscformat:
>> > - it's not possible to send a string starting with a slash, the message
>> > "oscformat: no method for '/aa' " appears.
>> > - A hack can be done by sending a message [set /aa, bang( ...
>> > - ... but this doesn't work if the message to send is /aa 1, as oscparse
>> > will convert it to /aa/1
>> > - defining an object as [oscformat /aa] seems to work, but it will mean
>> > that another oscformat object has to be defined for each single string
>> > being sent: /aa, /aa/a, /aa/b, ...
>> >
>> > For oscparse:
>> > - when it receives a message with slashes in it, it removes the slashes
>> > automatically. Which is kind of acceptable, if it's going to be
>> connected
>> > with a normal route. But not that much if the message is going to be
>> worked
>> > on, and resent.
>> >
>> > Or is there any other way of doing this? The documentation doesn't
>> present
>> > anything else. It took some time of screaming at the computer until I
>> > compared the results with mrpeach's objects.
>> >
>> > Best,
>> >
>> > Joao
>>
>> > _______________________________________________
>> > Pd-list at lists.iem.at mailing list
>> > UNSUBSCRIBE and account-management ->
>> https://lists.puredata.info/listinfo/pd-list
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20190713/be9951e7/attachment.html>
-------------- next part --------------
#N canvas 504 95 644 591 10;
#X declare -lib mrpeach;
#X obj 212 339 declare -lib mrpeach;
#X obj 251 480 unpackOSC;
#X obj 21 449 oscparse;
#X obj 251 540 print mrp;
#X obj 21 539 print van;
#X obj 23 321 list prepend send;
#X obj 23 341 list trim;
#X obj 23 231 oscformat;
#X msg 23 51 set /outputs_1 \, bang;
#X obj 163 231 packOSC;
#X msg 163 51 /outputs_1;
#X msg 70 148 set /list/a \, 1;
#X obj 23 361 netsend -u -b;
#X msg 155 359 connect localhost 9999;
#X obj 261 520 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 31 520 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X obj 155 339 loadbang;
#X text 24 21 Vanilla vs. Mrpeach OSC test;
#X msg 179 148 /list/a 1;
#X msg 163 271 47 111 117 116 112 117 116 115 95 49 0 0 44 0 0 0;
#N canvas 0 50 450 300 set 0;
#X obj 62 80 list prepend set;
#X obj 62 101 list trim;
#X obj 62 122 outlet;
#X obj 66 47 inlet;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 3 0 0 0;
#X restore 163 251 pd set;
#X msg 163 301 47 111 117 116 112 117 116 115 95 49 0 0 44 0 0 0;
#N canvas 0 50 450 300 set 0;
#X obj 62 80 list prepend set;
#X obj 62 101 list trim;
#X obj 62 122 outlet;
#X obj 66 47 inlet;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 3 0 0 0;
#X restore 33 251 pd set;
#X msg 159 168 /list/a 1.5;
#X msg 30 168 set /list/a \, 1.5;
#X obj 21 419 netreceive -u -b 9999;
#X obj 261 500 route /outputs_1;
#X obj 31 480 route symbol;
#X text 250 147 test 2 - lists with argument \; - sends and receives
look ok \, but in an external program \, only the output from mrpeach
is being accepted. When looking at the osc code \, both results are
different \; - 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.;
#X obj 134 480 list trim;
#X obj 31 500 route outputs_1;
#X obj 134 520 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 134 500 route outputs_1;
#X text 250 37 test 1 - single symbol \; - both sends are ok \; - when
receiving below \, the route from mrpeach works \, the route from oscparse
doesn't (although printout is similar) \, the "symbol" indicator doesn't
get parsed. \; - 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;
#X connect 1 0 3 0;
#X connect 1 0 26 0;
#X connect 2 0 4 0;
#X connect 2 0 29 0;
#X connect 2 0 27 0;
#X connect 5 0 6 0;
#X connect 6 0 12 0;
#X connect 7 0 5 0;
#X connect 7 0 22 0;
#X connect 8 0 7 0;
#X connect 9 0 5 0;
#X connect 9 0 20 0;
#X connect 10 0 9 0;
#X connect 11 0 7 0;
#X connect 13 0 12 0;
#X connect 16 0 13 0;
#X connect 18 0 9 0;
#X connect 20 0 19 0;
#X connect 22 0 21 0;
#X connect 23 0 9 0;
#X connect 24 0 7 0;
#X connect 25 0 2 0;
#X connect 25 0 1 0;
#X connect 26 0 14 0;
#X connect 27 0 30 0;
#X connect 29 0 32 0;
#X connect 30 0 15 0;
#X connect 32 0 31 0;


More information about the Pd-list mailing list