help with osc recieve and send in max

Aug 22, 2011 at 4:17am

help with osc recieve and send in max

Hi there!

I’m trying to do a few implementations on Ryan Challinor’s brilliant Synapse for Kinect

http://synapsekinect.tumblr.com/

basically his app recieves data from a microsoft kinect, binds a skeleton to it and sends it out as osc. I’m trying to recieve the osc messages in osculator so I can send them out with a bit more control and via midi as well, but some of the messages just aint getting recieved by osculator.

the problem is that synapse sends out a message called track joint, which tracks for instance your right hand and sends osc messages according to their possition on the screen in x,y,z values. I think osculator cant receive the osc properly because it contains 3 values rather than just the one.

I am hoping to use max as an intermediate so I can split the one message into three, each containing one the positions (x OR y OR z).

If you have a look at http://synapsekinect.tumblr.com/post/6307752257/maxmsp-jitter
you will see synapse sends joint position in relation to the screen as

/_pos_screen – The x,y,z position of the joint as projected onto the screen, in pixels.

where instead of it would send which joint is specified, ie .

You have to bang synapse to tell it to keep spewing out the joint possitions.

The bang will send β€œ/righthand_trackjointpos 1” to Synapse every 2 seconds, and cause messages like β€œ/righthand_pos_screen 150 200 400” to be sent out by Synapse every frame.

Synapse sends via osc ports 12345 and 12347, and recieves on 12346

Osculator can receive on any joint you specify.

My question is, how can I get max to recieve this β€œ/righthand_pos_screen 150 200 400”, split up the message and send it out via osc as three seperate messages, ie

/righthand_x_pos_screen 150
/righthand_x_pos_screen 200
/righthand_x_pos_screen 400

Please bear in mind i’m relativily new to max, and havent used it for anything with osc before

Thankyou!

James

#58582
Aug 22, 2011 at 8:03am

hi,
1st go to http://cnmat.berkeley.edu/downloads
and grab a copy of OSC-route (or their whole package, which is fantastic in various areas…) for your platform
2nd install the externals (there is a readme on the howto.
3rd here is a little demo, how it works (needs osc-route installed!)

– Pasted Max Patch, click to expand. –

hope it helps
hans

#210601
Aug 22, 2011 at 4:20pm

Actually you don’t need any externals for this. It also works with [route] from Max.

– Pasted Max Patch, click to expand. –
#210602
Aug 22, 2011 at 4:23pm

definitely get the CNMAT objects, helpful for a ton of other good stuff too. But you can also split up your lists without OSCRoute, two examples in the patch below. Not sure how OSC wants the data then sent back out, but using [pack], maybe [prepend], and possibly [sprintf] you should have no problem.

– Pasted Max Patch, click to expand. –
#210603
Aug 22, 2011 at 4:30pm

I can confirm that [prepend /name] works well for sending OSC data.

#210604
Aug 25, 2011 at 5:04am

OSC-unroute, from CNMAT is also worth looking it. When possible, I would use a hierarchical namespace, like /righand/screen_pos

mz

#210605

You must be logged in to reply to this topic.