M4L clip launcher - gate mode problem

Toni O's icon

Hi all

I need to modify an M4L patch which makes use of OSC data from a Kinect device. The original was shared for free here. I've pasted it below too.

When you set a clip's launch mode to gate in Ableton, it plays when you hold down a midi key. When you release it the clip stops playing. I'm trying to achieve the same by modifying this Max Clip Launcher patch. The problem with the Clip Launcher is that you have to "call stop" to stop the clip playing.

I don't want to have two separate events - it won't work in my situation. I need the clip to play in gate mode, so that when the tracked user is in a certain world-relative position the clip must play, and it must stop when the user moves out of that spot i.e. clip launch mode = gate.

I read about this in a forum post,which looks like the way to go:

"With set_fire_button_state (1 or 0), you imitate the mouse down and mouse up which is needed for the clip launch modes other than trigger and toggle."

I've tried everything I can think of using this object, but I am not knowledgeable enough about what objects to use. I need to make it automatically go from 1 to 0 without having to explicitly stop the clip with another event. It’s probably a simple solution.

Max Patch
Copy patch and select New From Clipboard in Max.

I'd appreciate any help!

Lee's icon

Not quite sure what you mean by "automatically" - you need to provide 2 events, one is the mousedown and the other is the mouseup - these are triggered by the person moving into the spot and moving out.. no?

Toni O's icon

Yes, you are right. I think my problem is I don't know what object to use in this situation. I need to say - if you are in the spot then call fire and if not then call stop. So I need to "call stop" when the initial action becomes false. I've tried a few different things but I can't get it right.

Evan's icon

[sel 0 1]? then send the bangs to the appropriate 'call' messages?

Toni O's icon

Thanks for the suggestion. I think I found the solution - I needed to change the live.text object used to launch the clip from button to toggle. Now when I'm in the spot the clip plays, and when I leave the spot it stops. I didn't need the set_fire_button_state at all.