Automagically set Warp Mode based on BPM?

jaynyc's icon

I want to constantly monitor all playing clips and automagically set Warp Mode according to this pseudo code logic:

FOR each PlayingClip DO
[
    IF ((MasterTempo - PlayingClip.BPM) > 1) OR (PlayingClip.BPM - MasterTempo) > 1)
       THEN PlayingClip.WarpMode:= "ComplexPro"
    ELSE
       PlayingClip.WarpMode:= "Repitch"
]
Next PlayingClip

I have never programmed in Max4Live before.... is this possible?

Thank you

--Jay

ShelLuser's icon

I can't comment on your code since I don't do javascript in Max. I maybe able to 'translate' your stuff into plain Max usage but I'm sure that someone more proficient with javascript may be able to comment on that.

What I can bring in is that it should be doable. When you say 'warp mode' I assume that you mean the "warp" button which you can find in an audio clip right?

That one is indeed controllable; "live_set tracks x clip_slots x clip" (where x is the right number of course). Then simply use the 'warping' property; a boolean which you can get, set or observe. This controls the warp button.

However; you can't go "beyond" this afaik. So; you can toggle warping but cannot do stuff like setting the warp mode itself or controlling those parameters.

So that part of your script is not possible at this time.

Keep in mind: I can't rule out not to have overlooked something, but I'm pretty positive about this one.

jaynyc's icon

i meant setting the warp mode to a specific one, like Beats, Repitch, ComplexPro, etc.. shoot, i guess the API doesn't support selection of Warp Modes?

What is the best way to ask Ableton to include this in a future update?