2 Ableton: arguments for set_stop_track_clip_buttons() = ?

Learn about building and using Max for Live devices.
Post Reply
Aldanor
Posts: 50
Joined: Thu Nov 02, 2006 10:44 am
Contact:

2 Ableton: arguments for set_stop_track_clip_buttons() = ?

Post by Aldanor » Tue Jul 20, 2010 3:20 pm

Hello,

Given there is no documentation whatsoever for Live API (and, particularly, for JavaScript Live API), one can only guess the arguments for each and every function. Most of times it's obvious, but sometimes it's absolutely not.

set_stop_track_clip_buttons function (control surface -> transport component, afaik) expects some sort of an array of control pointers (IDs of these controls? paths?), but whatever I try (via JS, api.call("..")), it just gives me the "Invalid syntax" error message.

Thanks.

P.S. Should we expect any sort of documentation for Live API anytime soon?

mojofunk
Posts: 433
Joined: Mon Aug 24, 2009 3:37 pm
Location: Buffalo NY
Contact:

Re: 2 Ableton: arguments for set_stop_track_clip_buttons() = ?

Post by mojofunk » Tue Jul 20, 2010 3:37 pm

You win the "most cryptic thread title" award!

edit: I didn't notice which part of the forum this came from . . .

Gravis
Posts: 104
Joined: Sat Jul 28, 2007 4:47 am

Re: 2 Ableton: arguments for set_stop_track_clip_buttons() = ?

Post by Gravis » Tue Jul 20, 2010 8:40 pm

I too would like to know when JS API examples will be released as it'll help all of us out a lot i think.

With regard to what you're trying to do, im not exactly sure i know what you want. Are you trying to stop all clips in a track? if so then ...

<pre><code>
----------begin_max5_patcher----------
578.3ocwV1rbaBCDG+L7TngoGodP7M4V6qPO1IiGAnZqVPhAIZcZl7tW8gwl
5.iArSxAPnUvp+6OsZQOaa4jyNf4NfG.eGXY8rskk1jxf0w9VN0nCEUHt90b
x6DBF0w0LDoTajk+yOCiC5sR6pIzJrP+EviFaPhh8D5tss3BgYFgAwda7bAP
urTUquW+cvimcEqSbouLlDO0fMNxIGQ24.dTM5K11pat2d73u33IzKyDOl1O
h3QNA431QiGXu0evnBJpVOYNeokfp.ekUUt9vMDpZiLKloSFt9CleN4u54Gp
9nIn.gJbbuEXTvpqwJmXFSfOnkty2DrF.ppBH1iAEUjFt7Ij.fZwflJzSx3D
PnRaD4.snhe06gJBEWv5nhggyPHGDeugbfWnFqvDecqutqe1jT1aBJuB9Ui4
bzN7q3WghcbID2JeXqFfikwEtpLN+YTv.FngQVrtW7U2fM2LtUtmC+GY79JJ
UQ9Mdib.k7GgNQd2a5DZnBDlpKmFkck8ie7zQFE6GkM28ZUQwoCybhfWgMAK
kMtGuVEilZi1NlfATjZKGKLkh3fOAGEYg28zo9x6IwGSqdS2socptB6EGHQq
Mk8+GfbVWaQuqNcBDvYwUh4BBEIHx+uO3sTUkF7V6IkkX5vBm0jxFl7eOGkw
DKnyWU9yQUwu2pBNGUoRpdOUU37Tk2xTk72FYahTYvwI51P4AVN0+V07ELZJ
Muv0WIJRMZDZzZTRx492rlmOmgKPymzXrQ6govy8uXyt8K1+C3OMjKC
-----------end_max5_patcher-----------
</code></pre>


to do via Javascript ...


track = new LiveAPI(this.patcher, "live_set tracks " + x);
track.call("stop_all_clips");

Where "x" is the track you want.

Hope that helps :)
iMac G5 2.16 | Echo AudioFire12 | Xone 92 | Live 8 + M4L | Trigger Finger | Monome 256 | Kenton Killamix Mini | Truth 3031A

Aldanor
Posts: 50
Joined: Thu Nov 02, 2006 10:44 am
Contact:

Re: 2 Ableton: arguments for set_stop_track_clip_buttons() = ?

Post by Aldanor » Wed Jul 21, 2010 12:08 am

Gravis wrote:I too would like to know when JS API examples will be released as it'll help all of us out a lot i think.

With regard to what you're trying to do, im not exactly sure i know what you want. Are you trying to stop all clips in a track?
Nope, I'm trying to reprogram stop buttons on APC40. I sure can attach observers to all X_Stop_Track_Clip_Button controls, but I have no clue how to enable/disable the whole group using Transport component.

amounra93
Posts: 432
Joined: Sat Jan 24, 2009 8:16 pm
Location: Arcata, CA
Contact:

Re: 2 Ableton: arguments for set_stop_track_clip_buttons() = ?

Post by amounra93 » Wed Jul 21, 2010 4:22 am

I know exactly what you are looking for, but I can't tell you an answer. The API is python, and is looking for a tuple, which I don't think can actually be produced in js (an array isn't the same thing AFIAK).

We found when working with the python stuff (old thread dealing with solution to sysex send/receive and custom python scripts...don't have time to look it up right now) that using tosymbol will allow you to take several messages and combine them into a tuple. Still, I don't know the way to phrase this. Python is looking for button names, but normally when dealing with the Control_Surfaces portion of the API and single objects that don't need to be cast into a tuple, you can feed the Component call (actually function in the python script) the id of the Control and it will work.

Sorry, you may already know all this. I've been trying to figure this out to, just don't know the answer yet. It is much more convenient to do things to the python scripts from within m4l without modifying the actual scripts, but in several instances, I've had to get down and dirty and actually change the scripts.

And, agreed, if someone would give us some examples, then all would be golden. My guess, though, is that there aren't any examples, because no one has done much with the control_surfaces portion of the API.
I sure can attach observers to all X_Stop_Track_Clip_Button controls, but I have no clue how to enable/disable the whole group using Transport component.
You can disable them by setting them with id 0, or (usually...I'm not looking at the API_explorer right now) you can call set_disable 1 to disable them. Usually other stuff will reenable them, though (like certain shift functions, etc.)

I just disable the whole session component when I'm using that portion of the grid, so I haven't been pressed for a method yet. If there isn't a solution soon, you might consider adding a function to the script, so that it can be easily disabled by calling an additional method, and then reenabled when your done. Check out Hanz Petrov's stuff.

Cheers
http://www.aumhaa.com for Monomod and other m4l goodies.

Post Reply