🔥 Lifetime deal! Get Control Surface Studio for Just £67 👉 Click Here To Get It
Time left... mailtimers.com
⚠️ Lifetime licenses are ending soon, get yours before they're gone ⚠️
Your shopping cart is empty.

How to add listener for current clip slot

Submitted by infinitystairs on Sun, 01/23/2022 - 20:02
infinitystairs
Pro User
Control Surface Studio User

Hi, I am trying to build a Reaction that listens for the current clip slot to have a clip or not have a clip. I want to send LED feedback to my controller's delete clip button to tell it to light up if the current clip slot has a clip in it, and to turn off if the clip slot doesn't have a clip (or after I click delete and it no longer has a clip).

I think I have my Actions working correctly, but I can't figure out how to write a Listener that notices if the current slot has a clip?

Topic Category: 

4 Responses

Comments

infinitystairs
Pro User
#1

self.song().view.highlighted_clip_slot.add_has_clip_listener seems like it should work, but it is not firing when I record into a clip slot or double click to add an empty clip into a slot.

Wim
Control Surface Studio User
#2

Hello infinitystairs,
Try as listener:
self.song().view.add_detail_clip_listener
and for condition 1 (when clip is empty):
self.song().view.highlighted_clip_slot.has_clip == False
condition 2 (when clip has audio or midi):
self.song().view.highlighted_clip_slot.has_clip == True
Success!

infinitystairs
Pro User
#3

Thanks @303_! This ALMOST does the trick. The button lights up when I select a clip slot that has a clip in it. The two scenarios that do not trigger the listeners that I'd also like to trigger it:

- If I start recording into a clip, the listener does not fire until after I'm done recording and the clip starts playing back. Do I need an additional listener to catch a clip that started recording?

- If I double click into an empty clip slot to create a new clip, the listener does not fire. If I click away from that slot and back into it, then the listener finally fires. Is this a bug?

Wim
Control Surface Studio User
#4

Arrghh, getting closer still..
First issue, you could try adding listener "self.song().add_record_mode_listener" or "self.song().view.highlighted_clip_slot.clip.add_is_recording_listener"? You probably already tried that..
I think both issues are related, it seems that after creating a new clip, the listener is not listening anymore ;)
Tried numerous ways to retrigger the listener, but no luck.
No idea if this is a bug or simply the way Ableton works, it might be inherent to the way this listener works.
Someone with more experience in that area might explain this behavior.