Ableton issue – clip_slots[X].add_is_triggered_listener
Good day!
I see an issue and would like to understand the logic of Ableton or CSS.
I am creating custom session box. And i create a reaction for each pad of a session box. It has a listeners and they renew each time session box moves. And i see an issue with this listener:
self.song().tracks[self.track_num(0)].clip_slots[self.scene_num(0)].add_is_triggered_listener
When a certain clip_slot is within my session box – and it has such listener – it works fine. But then that clip_slot is out of my session box and has no such listener, and it was triggered (i supposed that it is a continued action and not input relative, as if clip_slot is triggered it is triggered until start beat comes on or clip is deleted and so on…) and after that i focus on that clip_slot and a listener added – it shows nothing… like a clip_slot is not triggered.. but it actually is…
So clip_clot is in a triggered state for a certain amount of time. And if a listener was added in that period (but not right at a start) it just shows nothing…
Is there a proper way to organize this?
Or is there a way to create a dynamic reaction that listens to all clip_slots? and regenerates when scene/traks adds to the project?
So i will be able to add a custon flag for each clip_slot wheather it is triggered.
I suppose that there is an option to create time listener and scroll through every clip_slot on every track…. But i would like to make it not time relative, but all state clip_slots relative.
May be .add_is_triggered_listener is just action or input relative? …
Thanks!
Unfortunately there isn’t a listener which monitors all clip_slots.
Listeners aren’t dynamic in the sense you mentioned. They only attach to a specific clip slot. The LOM doesn’t provide a way to auto listen to all clip slots.
Well, we really need such option. To add an attribute to each clip_slop wheather it was triggerd and then it was stopped. Not imput relative.
Let me explain.
The goal is to create a launchpad/session_box that is not input relative (but script relative) that will show with leds real and actual states of all clip_slots. There is a focus function – so we will send out midi messages for the clips_slots that are visble to session_box only. And as there are no such attribute for a clip_slot as .will_stop_on_start = true -> we need to create that. There is no problem to add such attribute for a clip_slot that have listeners (that are session_box focused). I add a custom attribute to self.p_clip_slot_1_1 = 1 if a clip_slot
track_index = self.get_sessbox_track_offset() + 0
scene_index = self.get_sessbox_scene_offset() + 0
# Get the required clip slot
clip_slot = self.song().tracks[track_index].clip_slots[scene_index]
will stop on start (it happens when a clip_slot was triggered and then it was played – this truely represents that a clip_slot will stop on nex start beat).
And a blinking function lauchs for a certain clip_slop sending yellow blink if that flag is active.
So the problem arrives as we launch a clip_slot outside the session_box focus and then stop it until the start beat. In this case such clip_slot should have that flag as when we focus on it (after is was set to .will_stop_on_strart_beat but before start beat). But to create such attrribute we need a listener to that clip_slot. But we have no such as it is outside a session_box view.
We can create such attribute with setting this clip_slot to .will_stop_on_start by input – but it is really a bad choice and also this can be done from other script – so the script that will correspond to led feedback will never know that tha flag was added.
Is there an option for cross script communication? I suppose that not ..
So we have 2 options:
– store clip_slot.will_stop_on_start states inside m4l device inside ableton somwhere
– create a listeners to all clip_slots that should add such flags
I would prefer to keep it clean an store that data inside the script.
But how the listener is actually created?
Can we define a function in action block that will act like a listener but will not be triggered by time?
Or can we add a code to the listener section that will listen to all slip slots?
Chat GPT says strange things about the listener section in CSS – is says that listeners should be defined not the way as they are defined…
Sign up
User registration is currently not allowed.
is there a way to create listeners dynamicly to all clip slots on mode load for example?