oksunp / vvopensource

Automatically exported from code.google.com/p/vvopensource
0 stars 0 forks source link

VVOSC bug in OSCMessage parsing? #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi, I'm trying to use LiveOSC (http://monome.q3f.org/wiki/LiveOSC) to 
send OSC messages from Ableton Live to an iPhone application using 
VVOSC.

Some messages sent by LiveOSC are parsed with wrong values in VVOSC 
application. I've noticed that this happens for all parameters in the same 
OSCMessage that come after the first string parameter.

For example, when changing a clip color in Live, LiveOSC sends the 
following message: (printed from VVOSC OSCMessage's description)
<OSCMessage: /live/name/clip-(
    <OSCVal i 1>,
    <OSCVal i 0>,
    <OSCVal s "clipname">,
    <OSCVal i 0>
)>

The last integer value should be the color of the clip but it's always 0.

In  order to discard a problem in LiveOSC I build a simple java application 
to log the received messages using the javaosc library 
(http://www.illposed.com/software/javaosc.html) and it works fine so I 
guess there may be a problem in VVOSC.

What steps will reproduce the problem?
1. Send a OSCMessage from another application with N parameters, being 
one of them a string value.
2. When receiving this message in VVOSC all parameters after the string 
parameter are 0 or "".

What version of the product are you using? On what operating system?
I'm on MAC OSX 10.5.8 using iPhone SDK 3.1 and downloaded VVOSC 
about a week ago.

Original issue reported on code.google.com by joand...@gmail.com on 13 Mar 2010 at 1:24

GoogleCodeExporter commented 8 years ago
I've run into this as well.

If you send a message with multiple values, anything following a string is 
parsed incorrectly.

Original comment by jon.gilk...@gmail.com on 14 Apr 2010 at 4:49

GoogleCodeExporter commented 8 years ago
I've created a patch that fixes this:

http://interfacelab.com/parse_patch_20100414.diff

I would email it, but I can't find anyone's email address.

Original comment by jon.gilk...@gmail.com on 14 Apr 2010 at 6:50

GoogleCodeExporter commented 8 years ago
Hi jon,

i've tried your patch cause i've ran into the same issue - however it's not 
producing the correct results either. 

this is what should have been sent (after a listfunnel): 

print: 0 Squared Circle (Red Robin & Jakob Hilden Remix)
print: 1 a1 - untitled
print: 2 03-lfo-mokeylips-dps
print: 3 02 Disco Bus (Roland M Dill Remix)
print: 4 02-lfo-mum_-_man-dps
print: 5 02 Disco Bus (Roland M Dill Remix)

this is what was received:
2010-04-16 23:50:14.241 views[6131:4603] <OSCMessage: /clipblock-(
    <OSCVal s "Squared">,
    <OSCVal s "red">,
    <OSCVal s "Circle">,
    <OSCVal s "le">,
    <OSCVal s "(Red">,
    <OSCVal s "">,
    <OSCVal s "Robin">,
    <OSCVal s "n">,
    <OSCVal s "&">,
    <OSCVal s "Jakob">,
    <OSCVal s "b">,
    <OSCVal s "Hilden">,
    <OSCVal i 1701707776>,
    <OSCVal s "Remix)">,
    <OSCVal s "x)">,
    <OSCVal s "a1">,
    <OSCVal s "-">,
    <OSCVal s "untitled">,
    <OSCVal s "tled">,
    <OSCVal s "">,
    <OSCVal i 808660332>,
    <OSCVal s "fo-mokeylips-dps">,
    <OSCVal s "okeylips-dps">,
    <OSCVal s "lips-dps">,
    <OSCVal s "-dps">,
    <OSCVal s "">,
    <OSCVal s "">
)>

do you have any idea what could be wrong? 
cheers for any input on this

Chris

oh: you can email me aswell: voku@gmx.net 

Original comment by cblom...@googlemail.com on 16 Apr 2010 at 7:54

GoogleCodeExporter commented 8 years ago
oh here's the output for a message with 27 strings with 
"asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasd
asf"
just thought the shape might help ;-)

2010-04-16 23:58:54.493 views[6131:4603] <OSCMessage: /clipblock-(
    <OSCVal s "asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdasf">,
    <OSCVal s "asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdasf">,
    <OSCVal s "asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdasf">,
    <OSCVal s "asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdasf">,
    <OSCVal s "asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdasf">,
    <OSCVal s "asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdasf">,
    <OSCVal s "asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdasf">,
    <OSCVal s "asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdasf">,
    <OSCVal s "asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdasf">,
    <OSCVal s "asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdasf">,
    <OSCVal s "asdfasdfasdfasdfasdfasdfasdfasdfasdfasdasf">,
    <OSCVal s "asdfasdfasdfasdfasdfasdfasdfasdfasdasf">,
    <OSCVal s "asdfasdfasdfasdfasdfasdfasdfasdasf">,
    <OSCVal s "asdfasdfasdfasdfasdfasdfasdasf">,
    <OSCVal s "asdfasdfasdfasdfasdfasdasf">,
    <OSCVal s "asdfasdfasdfasdfasdasf">,
    <OSCVal s "asdfasdfasdfasdasf">,
    <OSCVal s "asdfasdfasdasf">,
    <OSCVal s "asdfasdasf">,
    <OSCVal s "asdasf">,
    <OSCVal s "sf">,
    <OSCVal s "asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdasf">,
    <OSCVal s "asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdasf">,
    <OSCVal s "asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdasf">,
    <OSCVal s "asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdasf">,
    <OSCVal s "asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdasf">,
    <OSCVal s "asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdasf">,
    <OSCVal s "asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdasf">

Original comment by cblom...@googlemail.com on 16 Apr 2010 at 8:01

GoogleCodeExporter commented 8 years ago
Hi all,

    I looked at this over the weekend and came up with the attached diff. I tested it both with strings and blobs, 
and with mixed messages, both on Mac and the iPhone. So far, it looks good. If 
you guys find a pathological 
case, please get back to me.

Original comment by provost....@gmail.com on 20 Apr 2010 at 11:30

Attachments:

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
nvm my previous comment - was a fault on my side.
great patch!! saved me a weekend :-) if i run into any problems i'll let you 
know
Cheers

Original comment by cblom...@googlemail.com on 21 Apr 2010 at 9:42

GoogleCodeExporter commented 8 years ago
Glad to be of service!

Original comment by provost....@gmail.com on 22 Apr 2010 at 5:15

GoogleCodeExporter commented 8 years ago
Thanks to all! I finally got time to check it and it works with the latest 
patch from provost.paul.
Cheers!

Original comment by joand...@gmail.com on 7 May 2010 at 4:35

GoogleCodeExporter commented 8 years ago
hi everybody-

sorry i'm late to this thread; needless to say, i don't check the "issues" tab 
very often and hadn't configured google code to email me when new issues are 
posted.  i've done this now, so i should be notified whenever someone posts an 
issue in the future.  thanks to everyone who offered potential solutions in the 
meantime, i should be much more responsive next time 'round!

the patch posted by provost.paul seems to be the most comprehensive, so that's 
what i've taken a look at (thanks again, paul!).  i've modified this patch a 
good deal, and have rolled the fix into the repository- as of now, this issue 
should be resolved; i've done a bunch of testing with strings and OSC blobs and 
everything looks okay- please drop me a line if you're still having issues.

...if anyone's interested, the problem seems to be that the ROUNDUP4() macro 
(which is supposed to round a number up- and only up- to the nearest multiple 
of 4) was adding 4 if the original number was already an even multiple of 4.  
this was working in most of the framework because the code in most of the 
framework took this into account, but wasn't working in a couple key locations. 
 the solution involved fixing the macro, then correcting the code in the 
various places where the macro was used.

cheers
: : ray

Original comment by raycut...@gmail.com on 19 Jul 2010 at 7:23

GoogleCodeExporter commented 8 years ago

Original comment by raycut...@gmail.com on 19 Jul 2010 at 7:25

GoogleCodeExporter commented 8 years ago
Woohoo! I'm famous! ;-)

Thanks Ray for rolling this into the trunk. I didn't dare touch at the 
ROUNDUP4() macro as I wasn't sure of the ramifications. 

Original comment by provost....@gmail.com on 19 Jul 2010 at 8:51

GoogleCodeExporter commented 8 years ago
hi paul-

thanks again for helping out, and sorry again it took me so long to notice- it 
shouldn't happen again now that i've got the email notifications turned on :-P. 
 i use these frameworks pretty much all the time, so i'm always grateful for 
bug reports or help!

cheers
: : ray

Original comment by raycut...@gmail.com on 19 Jul 2010 at 10:07