this seems like a very simple problem but somehow I have so far failed to figure it out. What I want to do is the following:
I want to define an X-Control that for a specific track, lets say track 1, launches the clipslot (or as a second best, the clip) directly below the SCENE that is currently selected.
A naive approach is this:
NEXT_CLIP = NOTE, 1, 36, 0, 127, 1/PLAY >
But that will launch the clip in the track after the one that is currently selected. However, clips can be selected even though their SCENE is not selected. Also if I run this command many times it will step downwards in the clips of the track (since launching a clip selects the clip). That is not what I want, it should always launch the clip after the selected scene. SEL seems like an interesting possibility but I do not know how to add 1 to it. The command
NEXT_CLIP = NOTE, 1, 36, 0, 127, 1/PLAY SEL >
Does NOT work.
This problem got this ClyphX Pro newbie stumped. Help would be much appreciated!
OK, it works but it is too slow. If I press the button quickly several times in a row then it steps clip down and clip down and then up and up. Not the intended functionality. I need to find the number of the clip I want to launch... I am investigating User Actions and trying to adapt the QA-session that you made on Youtube www.youtube.com/watch?v=UqWX6d6A6BI
OK this is my new attempt, which seems to work. I will test run it for a while now. I created a user action with the following Python code: _______ # Import UserActionsBase to extend it. from ClyphX_Pro.clyphx_pro.UserActionsBase import UserActionsBase
# Your class must extend UserActionsBase. class PlayClipSlotAfterSelUA(UserActionsBase): """ ExampleActions provides some example actions for demonstration purposes. """
# Your class must implement this method. def create_actions(self): self.add_track_action('playclipslotaftersel', self.play_clipslot_after_sel)
def play_clipslot_after_sel(self, action_def, _): """ Play the next clipslot in the track, after the selected scene with the action 'track_index/PLAY scene_index'""" track_index = list(self.song().tracks).index(action_def['track'])+1 scene_index = list(self.song().scenes).index(self.song().view.selected_scene)+2 action = '%s/PLAY %s' % (track_index, scene_index) self.canonical_parent.clyphx_pro_component.trigger_action_list(action);
Thank you for the welcome! Yes I guess you mean saving the state of the currently selected scene in a variable every time it changes or something like that. I thought about it but came to the same conclusion as you.
OK now I have used my script a bit and I have realised that it 1) can not be used to launch a scene, which I wanted it to do as well, and 2) that it was handling the list of tracks when it did not have to. I changed it a bit. So maybe this is useful for someone. This is my user action: ____________ # Import UserActionsBase to extend it. from ClyphX_Pro.clyphx_pro.UserActionsBase import UserActionsBase
# Your class must extend UserActionsBase. class PlayAfterSelUA(UserActionsBase):
# Your class must implement this method. def create_actions(self): self.add_track_action('playaftersel', self.play_after_sel)
def play_after_sel(self, action_def, _): # Play the next clipslot in the track, after the selected scene