Calling “fire” on ClipSlot object, passing “launch_quantization” but not “record_length”

Patrick Hund's icon

I’m looking for help on a specific max 4 live problem. In a v8 object, I want to call the “fire” function on a ClipSlot object, passing the parameter “launch_quantization” with value 0 while omitting the parameter “record_length”. I couldn’t find an answer in the Max for Live docs.

I’ve tried it these approaches:

clipSlot.call(“fire”, null, 0);
clipSlot.call(“fire”, undefined, 0);
clipSlot.call(“fire”, …[,0]);

All of these result in an error message that I cannot call “fire” with the “record_length” parameter, because the clip slot is not empty.

It seems internally “null” or “undefined” is just converted to 0, causing the issue.

Both parameters are optional. I want to omit the first parameter “record_length” and provide the parameter “launch_quantization” — how can I do that?

I guess it is just a basic question about how the logic of the “call” method of LiveAPI objects works, but I couldn’t find a solution anywhere.

For what it’s worth, I’ve also tried this:

clipSlot.call(“fire”, { launch_quantization: 0 });

That just gave me a different error message, because for parameters, numbers are expected, not objects.

Source Audio's icon

usual Live nonsense.

I guess you need to first set clip launch_quantization parameter

and then fire clip slot

Patrick Hund's icon

So you mean set launch quantization on the clip that's in the clip slot, then fire the clip slot, then change the launch quantization on the clip back to its original value?

I guess that would work, but it's irritating to have to use such a tedious workaround when the Live API supports the launch_quantization parameter for fire on the clip slot for just this case, right?

fire

Parameter: record_length (optional)
launch_quantization (optional)

Fires the clip or triggers the Stop Button, if any. Starts recording if slot is empty and track is armed. Starts recording of armed and empty tracks within a Group Track if Preferences->Launch->Start Recording on Scene Launch is ON. If record_length is provided, the slot will record for the given length in beats. launch_quantization overrides the global quantization if provided.

Source Audio's icon

Live is not what I use, so can't tell if there is a better way to do that.

what works is this :

If you can also script that ... ?

Patrick Hund's icon

Well yes, your patcher does the workaround I've mentioned earlier — launch quantization on the clip that's in the clip slot, then fire the clip slot, then change the launch quantization on the clip back to its original value.

Sure, I can do that, but it's a workaround I have to use because apparently LiveAPI.call does not allow me to skip the first optional parameter record_length of the method fire and use only the second optional parameter launch_quantization.