anyone completely lost with the BASICS of the Live API?

Learn about building and using Max for Live devices.
Tone Deft
Posts: 24152
Joined: Mon Oct 02, 2006 5:19 pm

Re: anyone completely lost with the BASICS of the Live API?

Post by Tone Deft » Tue Apr 13, 2010 7:55 pm

S4racen wrote:When you navigate to the control surfaces it tells you what is attached, what the paths are and what functions can be called
I've read this concept before but I don't get it.

I'd tie the right live.observer inlet to a live.path that takes in a message of something like "path controlsurfaces 0" what would go into the message box that hits the observer's left inlet? it all sounds automatic but there's a step missing. I'd try some stuff but I'm at work and haven't caved in to bringing the lappie in with me (danger!)

sorry, I'm being really dumb on purpose. I find forums a great way to learn when you put your dumb thoughts out there and watch them corrected by other people.

many thanks for the hand holding.
In my life
Why do I smile
At people who I'd much rather kick in the eye?
-Moz

monohusche
Posts: 190
Joined: Thu Jan 22, 2009 4:28 pm
Location: Hongkong

Re: anyone completely lost with the BASICS of the Live API?

Post by monohusche » Tue Apr 13, 2010 9:28 pm

not sure I am on the right track but the control_surfaces LOM object isn't really documented, so using the api explorer lets you walk the tree exposing the functions and attributes each node exposes.

It's done by calling getinfo on any live.object.

hope that helps :-)

Hanz_Petrov
Posts: 119
Joined: Sat Feb 06, 2010 2:39 pm
Contact:

Re: anyone completely lost with the BASICS of the Live API?

Post by Hanz_Petrov » Tue Apr 13, 2010 9:56 pm

The control_surfaces root object of the LOM basically provides paths to the various components and controls of a control surface (which actually originate in the python scripts). They can be manipulated from Max for Live using the syntax and arguments which are defined in the scripts. A bit more detail and some examples here: http://remotescripts.blogspot.com/

Hanz

p.s. Perhaps more 'advanced' than 'basic', but to my mind, the python scripts are the key to understanding how to work with control surfaces in Max for Live. :)
http://remotescripts.blogspot.com/ - an introduction to the Framework classes

Tone Deft
Posts: 24152
Joined: Mon Oct 02, 2006 5:19 pm

Re: anyone completely lost with the BASICS of the Live API?

Post by Tone Deft » Tue Apr 13, 2010 10:10 pm

monohusche wrote:It's done by calling getinfo on any live.object.
8O it's that simple hey?!?!?!

many thanks man, I hope to return the favor or at least pass the juju forward with more help. I wanna lay all this 'basic' info out.

can't wait to get home tonight to play with getinfo!


Hanz - I peered down the rabbit hole. 8O there's soooo much that can be done with all this, amazing. unfortunately I never learned a scripting language, I'm a hardware guy. can we encapsulate verilog into the API? ;) :evil:
In my life
Why do I smile
At people who I'd much rather kick in the eye?
-Moz

Tone Deft
Posts: 24152
Joined: Mon Oct 02, 2006 5:19 pm

Re: anyone completely lost with the BASICS of the Live API?

Post by Tone Deft » Wed Apr 14, 2010 3:03 am

S4racen wrote:For this you need the Live.api.explorer device....

When you navigate to the control surfaces it tells you what is attached, what the paths are and what functions can be called, it won't tell you what to do with them or what messages to send but half the job is done then....

Cheers
D
for anyone playing along at home, you can find the list of abstractions S4racen mentioned under the Extras menu, under M4L.api.ListOfAbstractions.

edit - nope, those are the M4L abstractions, not the Live dot abstractions. FWIW the abstractions are chunks of Python code Ableton have coded up to make new objects. all we need to know is that they're max objects, the fact that they're python scripts is invisible to us.


monohusche - I just got getinfo rolling. so cool, many thanks!
In my life
Why do I smile
At people who I'd much rather kick in the eye?
-Moz

Gregory Taylor
Posts: 268
Joined: Tue Sep 01, 2009 3:11 pm

Re: anyone completely lost with the BASICS of the Live API?

Post by Gregory Taylor » Wed Apr 14, 2010 8:49 am

I'm assuming that some of you were sufficiently impressed with Angstrom's run at a User Interface that you may be considering trying to create one. The getinfo message is a very good way to query a portion of the Live API to discover what the properties and functions associated with them are. As you play with getinfo, there are two things you might want to keep in mind (besides knowing what a "tuple" is, of course)

1. The data returned by the getinfo message allows you to parse easily on output for properties and functions, but there will be no indication of whether a property is gettable/settable/both, at this point in time - you'll have to look it up [yep. it's a programming language - one must still occasionally Read The Free Manuals].

2. The information returned for functions is somewhat different than that returned for properties in that no information about the data type is included [bool, float, unicode] at this point in time.

Both of these are "known." The good news is that look at the Live Object Model refpage will easily provide you with the information you need when creating/editing your colls or menus/umenus.

HTH.

monohusche
Posts: 190
Joined: Thu Jan 22, 2009 4:28 pm
Location: Hongkong

Re: anyone completely lost with the BASICS of the Live API?

Post by monohusche » Wed Apr 14, 2010 9:13 am

Hi Gregory,

so where do we find the free manual for the ControlSurface class ?

not here obviously

http://cycling74.com/docs/max5/refpages ... model.html

nick

Gregory Taylor
Posts: 268
Joined: Tue Sep 01, 2009 3:11 pm

Re: anyone completely lost with the BASICS of the Live API?

Post by Gregory Taylor » Wed Apr 14, 2010 9:24 am

As has been said patiently and often, that portion of the documentation hasn't been provided to us, and - as you no doubt know - the folks at Ableton are, at the moment, otherwise engaged. I fully expect that that will be rectified, at some point.

Given the comments here to date on what people don't seem to have figured out, I wouldn't consider that portion of things to be "basic." Your mileage may vary, of course.

josquin2000
Posts: 36
Joined: Wed Mar 16, 2005 5:24 pm
Location: Deep in 'it'.

Re: anyone completely lost with the BASICS of the Live API?

Post by josquin2000 » Wed Apr 14, 2010 4:47 pm

The release of the API with the MaxForLive release was both wonderful, and a cause of great consternation in the Live users who are drawn towards MaxForLive. to understand,
Keep in mind two things (GT, you of course know all this):
1) The API was not even going to be released initially: it was a great effort just to get the code to *near* release state, and the aforementioned "GREATNESS" of the api's promise made them include it, Hal-le-lu-yah! But it is VERY new code. And turned out to have problems: thus much consternation. SO...
2) All further work on the API, including documentation has been halted until these bugs are fixed ... Live has been justifiably proud of their app's stability... they will need to recapture that stability before we see the API expanded and finished to meet everyone's needs.

Result:
Be Patient, and please *do* read the many, many notes of this sort that Mr. Taylor, and annoyed users like myself have had to type for people either too busy to read the existing notes, or too thoughtless to care if their patience has been kindly requested.
This part of Live is *brand-new*, it needs to mature, and I am sure it is maturing.


So Chill, ok?


l&k
j2k
aka
cfb

Tone Deft
Posts: 24152
Joined: Mon Oct 02, 2006 5:19 pm

Re: anyone completely lost with the BASICS of the Live API?

Post by Tone Deft » Wed Apr 14, 2010 6:10 pm

nobody's being critical here, we have nothing but love for max4Live and the people that made this happen.

regarding #1, I know. not to mention the code that was written at the 11th hour is QUALITY. I'd love to buy that guy a beer, he really stepped up and is well respected for it.

regarding #2. take a look at the General forum, I've pretty much been the only poster regularly responding to pissed off users saying that yes, we need to be unpaid beta testers, new development has been halted and while Live might be hosed on their machine it works pretty well on mine. I've caught a LOT of shit for this, so it goes.


my intention is not to highlight the flaws but to try to find the paths through the jungle even though the signage isn't complete. if we work together us n00bs can make some headway climbing that learning curve. if the pathfinders can do some hand holding we'd be highly appreciative. sometimes it takes a n00b to understand a n00b.

please understand that many of us go home at night, fire up max4Live, spend hours tinkering around getting nowhere, but that's fine, we know that's par for the course. it's not like the General population that would come to the forum and scream and shout. you need the patience of a programmer to get through this, it's expected.


if you were involved in the release of all this from the Ableton or C74 end of things you should be really proud, the melding of Live and max is an amazing and unique product that's still in its infancy. this will be remembered for a LONG time.
In my life
Why do I smile
At people who I'd much rather kick in the eye?
-Moz

monohusche
Posts: 190
Joined: Thu Jan 22, 2009 4:28 pm
Location: Hongkong

Re: anyone completely lost with the BASICS of the Live API?

Post by monohusche » Wed Apr 14, 2010 7:45 pm

josquin2000 wrote:The release of the API with the MaxForLive release was both wonderful, and a cause of great consternation in the Live users who are drawn towards MaxForLive. to understand,
Keep in mind two things (GT, you of course know all this):
1) The API was not even going to be released initially: it was a great effort just to get the code to *near* release state, and the aforementioned "GREATNESS" of the api's promise made them include it, Hal-le-lu-yah! But it is VERY new code. And turned out to have problems: thus much consternation. SO...
2) All further work on the API, including documentation has been halted until these bugs are fixed ... Live has been justifiably proud of their app's stability... they will need to recapture that stability before we see the API expanded and finished to meet everyone's needs.

Result:
Be Patient, and please *do* read the many, many notes of this sort that Mr. Taylor, and annoyed users like myself have had to type for people either too busy to read the existing notes, or too thoughtless to care if their patience has been kindly requested.
This part of Live is *brand-new*, it needs to mature, and I am sure it is maturing.


So Chill, ok?


l&k
j2k
aka
cfb
easy mate, relax. I have been reading docs and posting devices since the private beta came out, absolutely happy and excited about M4L.

there was a specific discussion around the ControlSurface object, and because it is not documented yet (for probably good reasons), it was suggested how to circumvent the problem by using the API explorer aka getinfo or using the python scripts. nobody is whining but rather trying to find other means to go around obstacles, so suggesting to read the manual does not help in this case even though I fully agree that RTFM is always the first step.

btw just for the record: As the LOM (not the respective max objects such live.object, observer etc.) is based on the python scripts, it is not really new code that has to mature or to be fixed. The bugfixing is needed for the core Live app, M4L is probably the least of their worries right now. Have a look at the general forum.

nick

LOFA
Posts: 3365
Joined: Mon Jan 10, 2005 7:10 pm

Re: anyone completely lost with the BASICS of the Live API?

Post by LOFA » Thu Apr 15, 2010 4:26 am

Could someone break down this calling get info business?

This patch showcases my confusion, I believe. Perhaps someone could add a thing or two to turn it into a demonstrative example of how to know what is available in the API via calling get info?

<pre><code>
----------begin_max5_patcher----------
640.3ocyW9sbiBBEF+Z8ofwqylQ.w+r209ZrSmLDklPGUbTR2ram9tu.pMoo
lF0XL6M5Hfv24Gemi3a1VNqE6YUNfeB9Evx5MaKKSS5FrZd1xIitONkVYFlS
Fqphtg4rntOIauzzdLMMErgIWwyeVz16yhbYE+uL8HfnktMMmuKimmxjlYD0
zXAUFukmuYUIKVVqHunP06.7I5qAlqPUKfmNLOhcx1IB1zJOwHHw5W9A9Xgj
SyLBw4gRNMssm5IP9mBV8Z53.dR2y6115KKtRrnIRF8EQ4pWYkUbQNHrcLo7
bVrXWtYf3tHl6fIFlDYnjaf9FQOA.bzPPV34QF3QQZxskaWogg.8MgOFcH7G
liAc+sLgSDLZ8BdgiEFP3rACkVVyJGRjC+l5FnFa.7PjibOaji5HxiFQjyUo
xK.Nqo4aFIDX+Vs3ewPTpVIF3KURlVXEETaVFCr7GiMYwnsJcSoTAMQmRATw
3VPJ+U1JZQwDAID1jD4UaqBt.i5JUhb2qq7wWnGsKBcQWD16nDugUrY9.zYL
PRvZP5zlTUWFxyeIYn4TnwT50T4YxyqTYRKUcnisI0qDXJ036M7jIj681qXf
htPyzVeoN8gPt.RvcTewar0fWbCNx6D9O.Xe7QjYLGhI3pMKlEybd8S9UIid
0s+YLUI1UF2NUsFVvAMmvpTHhJ0keOLH049.vOFyVdRByzcKwx3IEB0YLZzv
Y1y5qjzez9nkqaIoOM7bqoKgI8gRmQMgf8gStCSSjZSsuq9CCdgla5GtV940
GsB+DjmE9co8TxrJIROTzIYr2bmeezjY6cF245SQqSRYu4bJ3+v8tdU0JZV0
D9ViI0Cua+O.m.ip+A
-----------end_max5_patcher-----------
</code></pre>

If I didn't have jet-lag I would keep poking at the live.explorer patch until it clicked, but I'd rather have a beer. So please, some kind soul, please make sense of this...

monohusche
Posts: 190
Joined: Thu Jan 22, 2009 4:28 pm
Location: Hongkong

Re: anyone completely lost with the BASICS of the Live API?

Post by monohusche » Thu Apr 15, 2010 5:27 pm

you are almost there

Code: Select all

-----begin_max5_patcher----------
458.3ocuU1saBBCEG+Z3onoWyHzBUY6tsWiEioJUsKPKApatY7ce8CXpa5fM
IbAkzSaZ+e9c9n688fKj6X0PvCfmAdd6887rlLF7Zl6AKn6VlSqsaCJXuIW7
BLvsjhsSYMWVwEpVqqjBkfVvrq7XEmlCdRlm0trXaAWjyT1CD0XrjpVtgKVO
uhsT4DDNkDFE.vjIlewwlQTZXDX1wCRtU0dRQmb607Or2NJJr0LOyJGs3uKF
ZLcv22LDbaNdtjlUvpqAZGXCHm+JaNsrrcaN4oduj4bIH7Kw+SH8m4yjTKXR
rfIdpEVQWkOnKwG7k3Ch7e.jgBz0rePn0LEWrRNbHA2YJCJEY9kLsiTl9iDx
.lxn.K.4WEGKnh0vfANSoAKDWMTxjPxulpf6MWvngrVRW8DpWvn6QLaAir4I
SRFrBHbzPSES2kqyjflugu4hCJDRGnIt+8VRNEM1iS6ghu+HjUQF6myqZ41p
kstcSqp.vQUkwp0ManJtTb5lRNaSa3YYLwoOYTvyJk5GvZDAX1Eid8US8QR5
LjwTR5xzt0DYTkjMnf5BSnwGSn9D5P8WSIXrq5Ypoqab78tlu5Y2pZi5QPM9
F.ndxA+OAXeMSMA
-----------end_max5_patcher-----------
In this case (you are looking at the app object), the output is as follows:

Code: Select all

print: info id 1
print: info type Application
print: info description This class represents the Live application.
print: info child view View
print: info property canonical_parent NoneType
print: info function get_bugfix_version
print: info function get_document
print: info function get_major_version
print: info function get_minor_version
print: info done
so all you need is some route objects to parse the output.

nick

Tone Deft
Posts: 24152
Joined: Mon Oct 02, 2006 5:19 pm

Re: anyone completely lost with the BASICS of the Live API?

Post by Tone Deft » Fri Apr 16, 2010 4:00 am

the code won't paste into m4L. :?
In my life
Why do I smile
At people who I'd much rather kick in the eye?
-Moz

Markemark
Posts: 250
Joined: Mon Jun 22, 2009 3:51 pm

Re: anyone completely lost with the BASICS of the Live API?

Post by Markemark » Fri Apr 16, 2010 4:12 am

Tone Deft wrote:the code won't paste into m4L. :?
----------begin_max5_patcher----------
458.3ocuU1saBBCEG+Z3onoWyHzBUY6tsWiEioJUsKPKApatY7ce8CXpa5fM
IbAkzSaZ+e9c9n688fKj6X0PvCfmAdd6887rlLF7Zl6AKn6VlSqsaCJXuIW7
BLvsjhsSYMWVwEpVqqjBkfVvrq7XEmlCdRlm0trXaAWjyT1CD0XrjpVtgKVO
uhsT4DDNkDFE.vjIlewwlQTZXDX1wCRtU0dRQmb607Or2NJJr0LOyJGs3uKF
ZLcv22LDbaNdtjlUvpqAZGXCHm+JaNsrrcaN4oduj4bIH7Kw+SH8m4yjTKXR
rfIdpEVQWkOnKwG7k3Ch7e.jgBz0rePn0LEWrRNbHA2YJCJEY9kLsiTl9iDx
.lxn.K.4WEGKnh0vfANSoAKDWMTxjPxulpf6MWvngrVRW8DpWvn6QLaAir4I
SRFrBHbzPSES2kqyjflugu4hCJDRGnIt+8VRNEM1iS6ghu+HjUQF6myqZ41p
kstcSqp.vQUkwp0ManJtTb5lRNaSa3YYLwoOYTvyJk5GvZDAX1Eid8US8QR5
LjwTR5xzt0DYTkjMnf5BSnwGSn9D5P8WSIXrq5Ypoqab78tlu5Y2pZi5QPM9
F.ndxA+OAXeMSMA
-----------end_max5_patcher-----------

Post Reply