@mzed
I'm still too new to Max to be of much help. If you look at the Max for Live docs within Max, they have an API for the LOM, that should give you all the info you need.
OSC API through Max
Re: OSC API through Max
I'm not up to speed on this level of coding but wanted to give a shout out to OSC for midi sync via the API.
In my life
Why do I smile
At people who I'd much rather kick in the eye?
-Moz
Why do I smile
At people who I'd much rather kick in the eye?
-Moz
Re: OSC API through Max
My personal feeling about this type of endeavour is that an easier way to do it would be to build a big observer structure in js using callbacks for track creation, clip adding, device addition and what have you and take it from there. You could handle all the OSC in there as well, or push out [path, id] pairs.
Any attempt at a generalisation which ends up having to make a call to live.path any time something happens will end in tears, IME
-A
Any attempt at a generalisation which ends up having to make a call to live.path any time something happens will end in tears, IME
-A
Re: OSC API through Max
Indeed. As much as I love string handling in Max, I'm finding this kind of javascript has more potential:
Takes a message like: "OSC /live_set/tracks/0/mixer_device/volume 0.5" and forwards it to the appropriate API address.
mz
javascript below
-=-=-=-=-
outlets =1 ;
var vpattern = "/";
var vmodifier = "g";
var vregexp = new RegExp(vpattern,vmodifier);
z = " ";
var api = new LiveAPI(this.patcher);
function OSC(address,value)
{
var r = address.replace(vregexp,z);
r = trimString(r);
api.path = (r);
api.set("value", value);
name = api.getstring("name");
post(name,"has been set to",value,".\n");
outlet(0,r);
}
function trimString (str) {
str = typeof this.valueOf() == 'string' ? this : str;
return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
}
Takes a message like: "OSC /live_set/tracks/0/mixer_device/volume 0.5" and forwards it to the appropriate API address.
mz
javascript below
-=-=-=-=-
outlets =1 ;
var vpattern = "/";
var vmodifier = "g";
var vregexp = new RegExp(vpattern,vmodifier);
z = " ";
var api = new LiveAPI(this.patcher);
function OSC(address,value)
{
var r = address.replace(vregexp,z);
r = trimString(r);
api.path = (r);
api.set("value", value);
name = api.getstring("name");
post(name,"has been set to",value,".\n");
outlet(0,r);
}
function trimString (str) {
str = typeof this.valueOf() == 'string' ? this : str;
return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
}
-
- Posts: 87
- Joined: Fri Apr 24, 2009 2:41 am
Re: OSC API through Max
The LiveAPI implementation can be seen at http://monome.q3f.org/wiki/LiveOSC
There are some things we could improve on, but it gives you all and idea.
There are some things we could improve on, but it gives you all and idea.
Re: OSC API through Max
Are there more infos available regarding the api for js?