How to call duplicate_clip_to from Javascript


    Jan 05 2018 | 3:38 am
    I'm trying to copy a clip from one clipslot to another. I'm trying to call duplicate_clip_to, as described in the documentation, but I'm having a problem passing the target clipslot as a parameter. How do you do this? What's wrong with my syntax??? thisClipSlot.call("duplicate_clip_to", thatClipSlot); Note: In this example, both clip_slot references are fine - I can call delete_clip on either, and that works.

    • Jan 10 2018 | 6:59 pm
      No luck. I ended up putting a $25 bounty on this question, and got an answer. Here's the magic line: clipslot1.call("duplicate_clip_to", "id "+clipslot2.id); The API clearly calls for a clipSlot object. Maybe I could have guessed about sending the ID string instead... but prepending "id " - who would have guessed that? Anyway, I'm sorted. Just wanted to post this in case someone else searches for this in the future.
    • Jan 10 2018 | 9:07 pm
      Must've been a smart guy that figured that out ;)
    • Jan 10 2018 | 11:03 pm
      Yeah, really smart. But a total douchebag. Man, these MAX developers are the worst! :-)
    • Aug 13 2019 | 11:32 pm
      I'm sorry I would like to know how to be smart enough to understand how this got solved! Who are the engineers behind this mystical language and what's the potion or spell I must cast to figure out how to do it myself?
      Also, thank you David Berzack for documenting properly.. you must not be an actual engineer!
      This is what brings me here... duplicate_clip_to_arrangement
      I tried:
      var clip = new LiveAPI('live_set tracks 0 clip_slots 0 clip'); var track = new LiveAPI('live_set tracks 0'); track.call('duplicate_clip_to_arrangement', "id"+clip.id, 1.1);
      NO LUCK. Please, if you're a knowledgeable person, help!
    • Aug 14 2019 | 6:53 pm
      concatenation with id needs a space! "id"+" "+clip.id OR "id "+clip.id
    • Aug 14 2019 | 7:54 pm
      Thank you Broc you rock :)
      track.call('duplicate_clip_to_arrangement', "id " +clip.id, 0.0);