OSC API through Max

Learn about building and using Max for Live devices.
willrjmarshall
Posts: 87
Joined: Fri Apr 24, 2009 2:41 am

OSC API through Max

Post by willrjmarshall » Wed Nov 11, 2009 1:17 am

So,

Has anyone given any thought to building a standard Max for Live patch that would expose the Live API via OSC, so any device (Lemur, Monome) could access the API directly and simply?

I'm thinking that it's quite doable (they did it with Python and LiveOSC) - and it would be good to have an Official/Supported OSC API for Ableton.

Would anyone be interested in this?

earmade2
Posts: 19
Joined: Wed Oct 14, 2009 1:31 pm
Location: France
Contact:

Re: OSC API through Max

Post by earmade2 » Wed Nov 11, 2009 1:43 pm

I totally agree with that !

I'd like to use my Lemur with osc to control Live and get feedbacks from Live too. Would be so cool...
But my knowledge about Max is still very poor. The tutorial on osc are quite nice but I'm a newbie in max.
Anyone with strong skills to build that ?

technog0d
Posts: 265
Joined: Mon May 26, 2008 1:14 pm
Location: Philly
Contact:

Re: OSC API through Max

Post by technog0d » Wed Nov 11, 2009 2:16 pm

willrjmarshall wrote:So,

Has anyone given any thought to building a standard Max for Live patch that would expose the Live API via OSC, so any device (Lemur, Monome) could access the API directly and simply?

I'm thinking that it's quite doable (they did it with Python and LiveOSC) - and it would be good to have an Official/Supported OSC API for Ableton.

Would anyone be interested in this?
Thats sounds great. I use OSC right now with M4L. So the issue here is really agreeing on a standardized naming/path convention to utilize. It is definitely doable.

Mike
Websites:
Max For Live Community site:
http://www.max4live.info
http://www.noisemakers.info

Controllers: Lemur, Ohm 64, Monome, APC40, Launchpad
Daw: Live 8 Suite
Audio Interfaces: Apogee Ensemble & Duet
Monitors: JBL LSR 4300

willrjmarshall
Posts: 87
Joined: Fri Apr 24, 2009 2:41 am

Re: OSC API through Max

Post by willrjmarshall » Wed Nov 11, 2009 6:01 pm

The first step would simply be to clone the API out into OSC. No particular issues here, cos everything is defined and named already. Basically a big cut-and-paste job (although I don't really know Max, so I'm extrapolating from Python).

A nice to have thing on top of this would be to add OSC paths for various abstractions. There are a bunch provided already, but I bet we'll end up with 5-10 things basically everyone wants, so it'd be good to add them. Stuff like "currently playing clip name".

Would anyone be interested in setting up a Google Code or Github project for this? I'm keen to start, but I only picked up Max for the first time last night and I'm not really on top of it yet.

technog0d
Posts: 265
Joined: Mon May 26, 2008 1:14 pm
Location: Philly
Contact:

Re: OSC API through Max

Post by technog0d » Wed Nov 11, 2009 9:40 pm

willrjmarshall wrote:The first step would simply be to clone the API out into OSC. No particular issues here, cos everything is defined and named already. Basically a big cut-and-paste job (although I don't really know Max, so I'm extrapolating from Python).

A nice to have thing on top of this would be to add OSC paths for various abstractions. There are a bunch provided already, but I bet we'll end up with 5-10 things basically everyone wants, so it'd be good to add them. Stuff like "currently playing clip name".

Would anyone be interested in setting up a Google Code or Github project for this? I'm keen to start, but I only picked up Max for the first time last night and I'm not really on top of it yet.
We could actually use the same hierarchy as the LOM

so we could do stuff like

/live_set/
/live_set/view/
/live_set/view/detail_clip parameters
/live_set/tracks/

things like that

Mike
Websites:
Max For Live Community site:
http://www.max4live.info
http://www.noisemakers.info

Controllers: Lemur, Ohm 64, Monome, APC40, Launchpad
Daw: Live 8 Suite
Audio Interfaces: Apogee Ensemble & Duet
Monitors: JBL LSR 4300

mzed
Posts: 44
Joined: Tue Sep 01, 2009 4:11 pm
Contact:

Re: OSC API through Max

Post by mzed » Thu Nov 12, 2009 5:12 pm

Sounds like a job for regexp:

<pre><code>
----------begin_max5_patcher----------
437.3ocyUtsTCBCDF9Z3oXmbcsP3fhdk9bnc5Pg01nPfgDpnc56tg.zysh0N
cbFHLY2MI+7weBKLMHSxpPAAd.dFLLVXZXnCUGvnsuAIMrJJITnKivwOxl7F
YPSJIVI0gyKvbjGC4gxYcI4koLdBJ0Cj1F70LtTv9B0wbFZut1rR4tE2DR9Y
N1HQBAF0lRsPQyX7oiKvHYSVpusZ9.ZfW8i.ZcqiJzpwvh0ZUo+aBHanGdXp
dAHOUvBSH0IVZZV2LnmTIEEhvo3dXwJgMGGKPokrHL5cgksUJqBKFGiyYQn0
7rjxT7f.y4b.l5yf.4xPIKiuOYtqd3fcayJrbVTtYtbbZQ9gor+kkxGw6UfS
wpbvBdTTNQHYxRIBuPTW+cmn+QYzfct6AytWaLot2dJmo20wY1YLgFiIXCaZ
LgKsw7W5wBb0jxuYOL08TlL2qhIqlWCuLmt49idpd3kbbzPw2+TdIZ+Pidnp
2P9t+JPu70w2lWhrxhnNQ2dZJrV.wnZSHWeFzF0P2plYr3XTmtiQor37LFW1
JAXzA+10WE40CEEbUUjeOTj2+NFo1bAzyTQpNKM+FLMz2aC
-----------end_max5_patcher-----------
</code></pre>

technog0d
Posts: 265
Joined: Mon May 26, 2008 1:14 pm
Location: Philly
Contact:

Re: OSC API through Max

Post by technog0d » Thu Nov 12, 2009 5:56 pm

mzed wrote:Sounds like a job for regexp:

<pre><code>
----------begin_max5_patcher----------
437.3ocyUtsTCBCDF9Z3oXmbcsP3fhdk9bnc5Pg01nPfgDpnc56tg.zysh0N
cbFHLY2MI+7weBKLMHSxpPAAd.dFLLVXZXnCUGvnsuAIMrJJITnKivwOxl7F
YPSJIVI0gyKvbjGC4gxYcI4koLdBJ0Cj1F70LtTv9B0wbFZut1rR4tE2DR9Y
N1HQBAF0lRsPQyX7oiKvHYSVpusZ9.ZfW8i.ZcqiJzpwvh0ZUo+aBHanGdXp
dAHOUvBSH0IVZZV2LnmTIEEhvo3dXwJgMGGKPokrHL5cgksUJqBKFGiyYQn0
7rjxT7f.y4b.l5yf.4xPIKiuOYtqd3fcayJrbVTtYtbbZQ9gor+kkxGw6UfS
wpbvBdTTNQHYxRIBuPTW+cmn+QYzfct6AytWaLot2dJmo20wY1YLgFiIXCaZ
LgKsw7W5wBb0jxuYOL08TlL2qhIqlWCuLmt49idpd3kbbzPw2+TdIZ+Pidnp
2P9t+JPu70w2lWhrxhnNQ2dZJrV.wnZSHWeFzF0P2plYr3XTmtiQor37LFW1
JAXzA+10WE40CEEbUUjeOTj2+NFo1bAzyTQpNKM+FLMz2aC
-----------end_max5_patcher-----------
</code></pre>
You could do that or just use the externals from CNMAT... They support the full OSC standard that allows wildcards in the OSC paths.
Websites:
Max For Live Community site:
http://www.max4live.info
http://www.noisemakers.info

Controllers: Lemur, Ohm 64, Monome, APC40, Launchpad
Daw: Live 8 Suite
Audio Interfaces: Apogee Ensemble & Duet
Monitors: JBL LSR 4300

willrjmarshall
Posts: 87
Joined: Fri Apr 24, 2009 2:41 am

Re: OSC API through Max

Post by willrjmarshall » Thu Nov 12, 2009 6:18 pm

Yup. It's cleaner if you do string.split('/') first, so you have ['my', 'path','in','osc'] and can match each one cleanly.

mzed
Posts: 44
Joined: Tue Sep 01, 2009 4:11 pm
Contact:

Re: OSC API through Max

Post by mzed » Thu Nov 12, 2009 6:30 pm

technog0d wrote:
You could do that or just use the externals from CNMAT... They support the full OSC standard that allows wildcards in the OSC paths.
It would be nice to be able to leverage wildcards in the Live API, too. In fact, without pattern matching and wildcards, changing LOM syntax into OSC-style-max-messages is really just a minor syntax shift. I would like to send a message like: /live_set/tracks/*/mixer_device/volume 127 and have all my tracks go up to max volume.

Is there an obvious way to scan through a whole Song and learn how many tracks there are, and what devices and parameters are present? I'm just digging through the docs now, and it's not clear to me. I know I can use live.observer to find the id's of the children. One could scan through those, I guess, and figure out what is there. But maybe there's a better way? I'm imagining dynamically generating an OSC namespace so you could do all the routing with OSC objects.

mz

pukunui
Posts: 405
Joined: Thu Jan 29, 2009 10:26 pm
Location: Los Angeles

Re: OSC API through Max

Post by pukunui » Thu Nov 12, 2009 6:31 pm

Mr technog0d,

The post about regexp was written by the guy who wrote the CNMAT externals.

-A

willrjmarshall
Posts: 87
Joined: Fri Apr 24, 2009 2:41 am

Re: OSC API through Max

Post by willrjmarshall » Thu Nov 12, 2009 6:39 pm

mzed wrote: Is there an obvious way to scan through a whole Song and learn how many tracks there are, and what devices and parameters are present? I'm just digging through the docs now, and it's not clear to me. I know I can use live.observer to find the id's of the children. One could scan through those, I guess, and figure out what is there. But maybe there's a better way? I'm imagining dynamically generating an OSC namespace so you could do all the routing with OSC objects.

mz
Yup. You can get all that info out easily enough, and set observers on the values in case of changes.

technog0d
Posts: 265
Joined: Mon May 26, 2008 1:14 pm
Location: Philly
Contact:

Re: OSC API through Max

Post by technog0d » Thu Nov 12, 2009 6:51 pm

pukunui wrote:Mr technog0d,

The post about regexp was written by the guy who wrote the CNMAT externals.

-A
That's funny... hehe. I actually didn't look at the code as I am not in front of Max right now. So i was just adding a comment. :-) I love the CNMAT externals!
Websites:
Max For Live Community site:
http://www.max4live.info
http://www.noisemakers.info

Controllers: Lemur, Ohm 64, Monome, APC40, Launchpad
Daw: Live 8 Suite
Audio Interfaces: Apogee Ensemble & Duet
Monitors: JBL LSR 4300

mzed
Posts: 44
Joined: Tue Sep 01, 2009 4:11 pm
Contact:

Re: OSC API through Max

Post by mzed » Thu Nov 12, 2009 7:01 pm

pukunui wrote:Mr technog0d,

The post about regexp was written by the guy who wrote the CNMAT externals.

-A
I was around when they were written, but I can't take much credit. Matt Wright and now Andy Schmeder are the ones.

@willrjmarshall
Ok, help me out. Is there some way I could dump all of the canonical paths to values into a collection, for example? If I had that, I could use patcher scripting to make a heap of OSC-route objects connected to live.observers with the right paths. (Although, I suspect it might be slicker to do this in javascript or java.)

mz

mzed
Posts: 44
Joined: Tue Sep 01, 2009 4:11 pm
Contact:

Re: OSC API through Max

Post by mzed » Thu Nov 12, 2009 7:17 pm

Maybe this helps to explain where I'm heading:

<pre><code>
----------begin_max5_patcher----------
808.3oc2X9saaBCEF+ZxSgEZWl1f+CIvtZ64Xqph.dodCLHrIKsU8ceXaRaR
WAbRntSSphJrMlO+iy4yGmGm44utbGU3C9L3a.OuGm44oaR0fW28d9EI6RyS
D5g4KxYYzZ+4lt3MELdNUp6C9RikMxW2ZUMUP4xDIqjeaMMUZdqnnUWGLGbE
TcMn6B3ltGxLOx6qnlQ66+bWB1C5FUOX2aHQldGiuouYmfTWivGL+rL8hpb8
OuBR1un9QdYhr8MW0nmEnp0mlMScYtkTpfJDIan6mQIcmdp7Wjy1RuUPkKj0
Io+RrHXQAaGs91L5VVJcQUBm2tB.eB9lDFsWgkb4yqezy.3b.OLH3TIe+bta
xPXycQ8P5P+CVG7jB8qv+q0rjb+y.1b5uam1+h0OjCnorbAXBXIpWpLeLxfB
0rXo4eqh0.JnGxDLsj4rSVu37ttUc734c3ILsqmHAIXMHGjOHGrJL.2GdVmv
2nCEFMbfPLYHZx.QvgBGBcShhxS551NThbxbcNQ+CCVHgKs.KD3zhk9Lqaso
mTi3yBIXkKZKYHC4nR9uw2naQSBsv3HxAaXWUWVQqk2C1lj2P+fiEPK0tFQQ
CEKfW4NSiVod26nqpcNplsZPPMhLFH84bfhcogpfVusmrHWU7QWbSLVG2DLH
aV4NWUcxzGu2JAq4xpkC5shbRLSaU5UTdFXZRoNSrzU0VjwlYvMgibSzxXGX
ZaYdSwGZnTGyPcm7AOTrjapmqltgtqBr.7EQyZgjIajTv28a+6xCrBG0q9D7
rglM3g3AMsgVVtm9Ya8d4u9GzPK.U6GiRQYSc5d4u+bofWjPFskcb8wlObPv
iFzcrrLpt+87pfkUUx3xNQ.t4M+vZslH1noP2po1pMAvQzjp5rSQS33tspNb
GKLNTESb4pcLBF4V.Bs4iZfS0TjERRU9jCkj53u.zHZRcXvCBFchlFiSpRvc
MmFKeTUd2ovIb.45P0QNLIhDy1aGeWbf4DplQFGbw4p+CZ.qJ+aTMQbrlrwR
C6VOMrMFHuBlu6ZZkMlZtMYEagjb614ZW8wrOBcrlr4KG4R1gr8lml8GFHBL
GA
-----------end_max5_patcher-----------
</code></pre>

technog0d
Posts: 265
Joined: Mon May 26, 2008 1:14 pm
Location: Philly
Contact:

Re: OSC API through Max

Post by technog0d » Thu Nov 12, 2009 7:31 pm

mzed wrote:Maybe this helps to explain where I'm heading:
That's exactly what i was thinking. The only problem is determining whether the object supports observe, get, and set. I guess we would have to create some filters. If we are going to support any input. I guess we could just perform some error handling.

Mike
Websites:
Max For Live Community site:
http://www.max4live.info
http://www.noisemakers.info

Controllers: Lemur, Ohm 64, Monome, APC40, Launchpad
Daw: Live 8 Suite
Audio Interfaces: Apogee Ensemble & Duet
Monitors: JBL LSR 4300

Post Reply