I am not really getting much understanding from the udpreceive help file but what i am trying to do is use touch osc to control the kslider through MIDI. I was using the Osculator program to transfer it from OSC to midi but I am trying to bypass using Osculator so TouchOsc sends strait to my patch and is then transferred to MIDI.
To clarify what I am trying to do. I am trying to receive OSC(open sound control) and convert it to midi (specifically control data).
Thanks ill try that.
the CNMAT tools seem like a pretty big hammer for this problem to me. (I’m sure they’re fine tools, but you can do this very easily with udpreceive and a handful of route objects.
Here’s a patch that receives on port 46000 (whatever your TouchOSC is sending), then looks for messages of the form "/PageName/ControllerName ". It converts them to MIDI controller 16 on channel 1. Pretty simple stuff. I’ve been using udpreceive for TouchOSC for a long while with good results.
----------begin_max5_patcher---------- 479.3ocyU1zSiCCDF9bxuBKebUoX67ArbZWs2Wwc.gbSFJFkZGk3zs.h+6X6 jPKn1HCUXsRMYpGOi867T2wOGGgWn1.sXzEnqPQQOGGE4bYcDMLNBuhuonh2 5BCKg+oV7.dV+TZXi14tPWo5zHZNhNNmrakPVAZWdICNuSI0shm.qOJaNYar lzGCdzaMWWbuPt71FnP2KxLhIGTByYxysuseGcyPJhRmbLR7jL7N6ojuxsm3 e2H3UX6DuDGaeM63JbgTu2Bl8YJX5f2dW5Gqg9p0s5uUaGDGryGnx7rCiizf fieXJxyl+MRj6pTbuXRpyjxl5HRRPXRioH.zeLaQip5u1c4nwC6P3AOy73Ac HIVCkNIdXADOWxWB+evFZ9OcFBcJ1PCCafkvlZzone01snUKzVTcM17Yubh9 Y3T1jbZ2GOXVBq2LYGYZXZI2UVazGHVCnzbBgb7n5fci7AMjAyjnI2Ox3REW Ije7Ra21a8+db0p5ZJFE6vs.nsBnDLmojbsPI2Ilr2Ey8hxRPt60xkhV9hJv Idxd+YyW0v7PMIASMIdnlzfoFpGpgEN0j4gbnASN49nlu5439+jwqqWCMsCq oSIltOOnZrCym4FJj8CcqnoY8ZwX7Yw1U6k3WkuZZ9M -----------end_max5_patcher-----------
Well, among the many nice features of the OSC-route object is the fact that you can just enter essentially exactly the same stuff that you see coming in through udpreceive to extract what you need.
Why would I use a "handful" of objects when I can use a single object? That’s like using assembly language when you have a perfectly fine high level alternative that works just as well (and in this case, it’s probably faster as well).
I think the benefits of OSC-route are rather cosmetic than functional.
For example, how would you get the numbers from addresses like /3/fader8 ?
Here is a simple solution with regexp.
----------begin_max5_patcher---------- 418.3oc0U1sSCBCEG+Z3onoWow4FTDF3c5qgtXJPGqJTHPIhtr2cosfto3fk sQTHvImuZ+mebZXstFzOshT.A2Bd.nosVWSSFRDPqwWClfqBhwExxfrxDeRN bhJUsGkES3xblMAWlx3Ez2IxXFSM9p1zRdawnlnYXdvJJK5obR.WIDSaTcS. SGKgw1P53N0.rnoG0xveKinZ.RYb3D.zGyhfeVEMTJ3T+mu1CtkzX3DYev6x o3Xv8owgPQ1M55hWS96.Bu4JNfNUbv8+IGtw5Dyg4mCNPdsdoaWXNoRJdXIK CG7BfJtOdHY86PxUcnA4JLJTMHHskoKT4LdnJmDQpx.yt3w5qvqtb1RbHIu0 SXJZcNdRZumwM4wNulgtALtI32NOcARqy.HSHEE3HxOH4LKE6bAH6NQE5PPk Yenx1VNy4n.1dIUWjAc.jQ1OLlx99esjhSDeWbUjVlGzt6MaF3KAFRJ3TFlS SYaUi0N0rhFFRjoawSBMLKs9.SiD.K57S2PUjX2L6QQNiphbF.ilO5JpOF4N 5JB0ih7NBEU6rQ+C2QyNwC -----------end_max5_patcher-----------
An interesting feature of OSC-route is the ability to use the slash keyword in the arguments. It can be very useful for abstractions.
First of all, you’ll get no argument from me on the usefulness of regular expressions, they’re a life saver in many domains.
However, while your example makes it very easy to extract values out of the incoming string, what happens next? You’re going to have to add stuff at the other end to route to different places based on those address values. If you extract everything the same way, you’ll have quite an explosion in objects to handle all the different combinations. What happens when you need to detect faders, sendlevel, par(ameters) and so forth
On top of that, you’re still going to have to add
[route 1 2 3 4 5 6 7 8] to route the value of each fader to the desired place. The value of the OSC-route is that the routing is part of the object’s function.
It’s also a heck of a lot easier to see what’s going on. For example:
----------begin_max5_patcher---------- 666.3ocyWtrbaBCEFdM9oPCqZmwIQGcgKcWmz8cQW1ISGEPIVc.ACHRcZl7t WPfSwMCFbLg5EV.GIj98G+5bfmV43da1VYoK5SnuibbdZkiiMTS.mtqcbSEa iRDk1g4lJKKE2KcW21mQt0XiiuDyo.E10QhRKixpz1dIcAuKSaJU+V1DCHWh 6BmWHKkZivnxz+nPFYZED0yqdHHZf8.tqAcS2coqRU5Door+JjKLQaT566MM PneysR3PyAtcdnjdSjJ19OH61edAwysmT0hTqTc+bgRj3920MqxraggtnsgL OlKaWUWWzMM877pUMMqOY7B9.2iMi3kDByBdgvV7Rm.d8OewKv4.cNwKvmC7 xfoS2f+yzUK+UsNdEbyJitnndIjnqpAUbh7AYBz6bRuyotGF16gMXXr4SrXi f6QOBd.tEdrbiMH2V262ahgQYoo0toWAwqE4lpBIJu19hnHgNt8TN5CkhG+3 aw3NUVxXVJ5Y8yPmGjM.KIGKKwyHj9hvHP2UjkhpiHKzhDjIqJZyW+10yjuh A1syDqgB77OnuBuDrXAKH60lRiE3eRoz3P2tR734zffy1JFDJDxlyJFblWKd omVECJe538LtfrWHIz+jyqc.PQ4gSGT7y9Zq4hBv1RrsyUkTZHteozVO5Po7 .5YTozwQFEcEelvDIvtqy2t2M3f0Efitt.cTHMm.pJtNAUjT8frFDT17BHBq oML7P.58JmucsroR9mO40J2l36CqxrphncS0t2TDQdQxwxRiRaSi2eP0eCIB dYPaTwwRa+6HVpJNOSoMchXfGcGklfwzj+xqI7XZJXQ0Tyttw0z9B+cWSzI3 mfElSzI3m.+kWSi8rqoD8R6mFkSzE0OELELgOAIUewyq9CfowZJu -----------end_max5_patcher-----------
"The value of the OSC-route is that the routing is part of the object’s function."
Good point. I’m convinced.
Forums > MaxMSP