|
Post by Stray on Aug 12, 2019 5:03:03 GMT -5
Good catch! Thanks for pointing this out.
|
|
|
Post by tommakesthings on Nov 5, 2019 0:15:25 GMT -5
As a first time user action coder, I ran into the following problems, but solved them before I finished posting to the forum. Not sure if there is a resource for beginners, but in it you might add the following:
1) don't duplicate the ExampleActions.py in the same folder, as it throws errors in Ableton log. 2) make sure you use spaces and not tabs in your python coding, otherwise it will show an error in the log and not run. 2a) I was using notepad++ as my text editor, and it was automatically indenting with tabs instead of spaces, which is how I kept running into this problem.
|
|
|
Post by Stray on Nov 5, 2019 23:28:50 GMT -5
Thanks for sharing. Yes, there are a bunch of things you'll need to know about Python in order to make effective use of user actions. I'll see if I can find a link to a good beginner course of some sort and add it to ExampleActions.py.
|
|
|
Post by oneiroi on Feb 8, 2020 12:42:37 GMT -5
Stray, how about creating a thread for sharing user actions? I think this could be beneficial both for finding actions already created by other users, as well as for learning about Python syntax and all that. Could be a very helpful ressource.
|
|
|
Post by rickywander on Feb 8, 2020 17:24:07 GMT -5
oneiroi I Love This Idea. I already thought about this many times. I would not only add user actions but also Action lists and tools the like.
|
|
|
Post by Stray on Feb 8, 2020 19:48:01 GMT -5
I'm not opposed to the idea although threads get pretty cluttered, so I'm not sure that's the best option. Maybe a Slack channel or something of that sort or, for code, Github. I'll give it some thought.
|
|
|
Post by oneiroi on Apr 9, 2020 10:55:15 GMT -5
I'm not opposed to the idea although threads get pretty cluttered, so I'm not sure that's the best option. Maybe a Slack channel or something of that sort or, for code, Github. I'll give it some thought. What about a sub-board for users sharing their set-ups, user actions and so on? Or if that's too specific, it could be a "Tips and Tricks" sub-board where you could also include your various tips threads. I feel like there are so many great ideas and ressources from users out there, if the forum could incorporate a little structure to encourage that, we could greatly benefit from it. There have been some threads here and there of users sharing their ideas and set-ups, but they get lost in the thousands of threads about specific questions and "is-this-possible" threads, which is the main use of this forum. Personally, I would keep it in this forum since the great majority of the ClyphX community is already using it, but that's just my two cents.
|
|
|
Post by Stray on Apr 13, 2020 14:11:04 GMT -5
Good idea! That's done. I'll leave this post here though since moving it would change its address, which could cause external linking issues.
|
|
|
Post by southerlybuster on Jul 26, 2020 0:50:38 GMT -5
First off, a big thanks to Stray for his brief guided tour on how to get Python programs going with ClyphX Pro. I tried it and works ok.
At the moment I am exploring what can be done with Python in Ableton (Lite, Release 10) with Clyphx Pro. I am not new to Python programming. At the heart of most Python programming, where it interfaces with host software, Ableton Live is just one of them, is knowing what the functions and properties are for the host software, good documentation of those properties and functions, and a break down of the structure to be able to reach and call all of this reliably.
My mate Google search only found and does not really document it all.
So I have been doing lots of self.canonical_parent.log_message(dir(self.xxxx.xxxxx.xxxxx)) calls and looking at the Ableton Live Log.txt file to see what pops up. Interesting. Most of the objects have a .__doc__ descriptor, but usually is too brief to fully understand what it does to be confident to use it.
I mean I could write a python program to recursively print out all of these properties and functions, like values, data types, __doc__'s and so forth, but hoping not to reinvent the wheel, and importantly I suspect will be all for nothing since the .__doc__'s are too brief to figure it all out reliably.
So is there a guide to the Ableton Live Python object library as obtained via ClyphX Pro? I suspect Ableton would rather not publish this as they really want to sell you Max and for that you need the Ableton Live Suite package -- in a couple of years I will be there but not yet, saving up, later on this year plan to upgrade to Ableton Live Standard, then later Suite.
|
|
|
Post by kirkwoodwest on Aug 10, 2020 17:20:07 GMT -5
So is there a guide to the Ableton Live Python object library as obtained via ClyphX Pro? I suspect Ableton would rather not publish this as they really want to sell you Max and for that you need the Ableton Live Suite package -- in a couple of years I will be there but not yet, saving up, later on this year plan to upgrade to Ableton Live Standard, then later Suite.
Yes. You are probably correct but great news... Julien Bayle has been decompilying the live API for years now since v7? ... check it! julienbayle.studio/PythonLiveAPI_documentation/Live10.0.1.xml
|
|
|
Post by southerlybuster on Aug 12, 2020 3:34:37 GMT -5
I have been busy writing some rudimentary Python code to list out the objects from self, such as self.song(). I use the python dir() function, then output to a log file, suitably tab delimited so I can view in a spread sheet. A lot of this aligns with the Ableton LOM I mentioned in one of my previous posts. For simple properties this works fine to run and get this data, also for the simple methods where the arguments are explained well enough in the Ableton LOM (Ref. [1]). Now here comes the tricky part, some of the properties are marked in the LOM as being reached via the get and set. So for example self.song().selected_scene can be retrieved via the get, or tell it what it should be via a set. self.song() object has a .get_data() method, similarly a .set_dat() method -- has any one successfully used this and if so could you please share an example, as I have not been successful yet. I have looked long and hard and could not find a method to directly set the selected scene and selected row, maybe I missed it.
The dir() gives the arguments of the .get_dat() as song object key object default value object
My eventual goal is to use one action to remember (to a global python variable) the current scene and track, and to use another ClyphX action to retrieve that saved scene and track to make it the selection. Perhaps there is an easier way. I'll keep on tinkering ....
Thanks kirkwoodwest, I did have a look at the jullienbayle documentation.
References: [1] Ableton LOM, docs.cycling74.com/max5/refpages/m4l-ref/m4l_live_object_model.html
|
|
|
Post by rickywander on Aug 12, 2020 9:41:19 GMT -5
As you said "My eventual goal is to use one action to remember (to a global python variable) the current scene and track, and to use another ClyphX action to retrieve that saved scene and track to make it the selection. Perhaps there is an easier way. I'll keep on tinkering"
maybe this could help
%CURRENT_TRACK_NAME% = song.view.selected_track.name
%SCENE_NAME% = song.view.selected_scene.name
Once triggered you can refer some Actions to those.
|
|
|
Post by southerlybuster on Aug 13, 2020 3:37:48 GMT -5
Ricky, Thanks, hmm but not quite. Here is a snipped of the user action written in python:
#Redefine what the current track and scene is OR the clip within a particular track, according to what was previously saved # ... code here ... #Zoom extents of clip self.song().view.highlighted_clip_slot.clip.view.show_loop() #Show the clips detail view self.canonical_parent.application().view.focus_view("Detail/Clip")
The ... code here ... is the bit I am stuck on, given a track ID (or name) and scene ID (or name), to reset what the selected track and scene is. song.view.selected_track.name gives then name of the track, but does not allow me to change the selection from one track to a new selected track, I do not want to rename the selected track.
|
|
|
Post by southerlybuster on Aug 14, 2020 4:23:57 GMT -5
Rickywander, Thanks, I had another look. Still could not figure out the get_data and set_data Ableton Live LOM methods, but as it turns out your suggestion sparked an idea that does work, to set the new highlighted scene via the built in ClyphX Pro command SEL SCENE scene_name:
#Top level definition in the python code, to define the global variable, here the scene name I want to remember nof_showclip_scenename="" ... #In the user function definition #Declare as global variable global nof_showclip_scenename ... #Remember what the currently hightlighted scene is if args=="this_clip": nof_showclip_scenename=self.song().view.selected_scene.name ... #Restore the previously selected scene as the new highlighted scene if args=="show_conditional": self.canonical_parent.clyphx_pro_component.trigger_action_list('SCENE SEL ' + nof_showclip_scenename) #Zoom extents of clip self.song().view.highlighted_clip_slot.clip.view.show_loop() #Show the clips detail view self.canonical_parent.application().view.focus_view("Detail/Clip")
Problem solved!
|
|
|
Post by thx538 on Dec 20, 2022 0:25:07 GMT -5
Hello, I just registered and considering buying ClyphXPro for Live 11. I have a bunch of user actions developed within ClyphX and will need to migrate them ... ! fine thanks to these instructions ! Within those actions I have some listeners, registered and triggered to capture various events, as below
insert code class ClyphXUserActions(ControlSurfaceComponent): __module__ = __name__ __doc__ = ' User actions ' here
... def playing_slot_listener_0(self): self.playing_slot_listener(0) ....
def playing_slot_listener(self, tnum): track = self.song().tracks[tnum] DO SOMETHING HERE
def __init__(self, parent): ControlSurfaceComponent.__init__(self)
self.song().tracks[0].add_playing_slot_index_listener(self.playing_slot_listener_0)
def fired_slot_listener(self, tnum): track = self.song().tracks[tnum] if track.fired_slot_index != -1:insert code here DO SOMETHING ELSE
def on_selected_track_changed(self):
def arm_listener(self, tnum):
etc. etc. ... for MUTE, SOLO and other events I guess this code can be migrated as well. Thanks for your confirmation and additional instructions if needed.
|
|