Ableton Live API – How to copy and paste clips

Since the Ableton Live 9.6.2 update, it is posible to copy and paste clips with the Ableton Live API.

Here´s how to do it with to use it with your Python scripts:

 

from pushbase import special_session_component

def copyclip(self, source_track, source_scene, destination_track, destination_scene):

function = special_session_component.ClipSlotCopyHandler()
function._start_copying(self.song().tracks[source_track].clip_slots[source_scene])
function._finish_copying(self.song().tracks[destination_track].clip_slots[destination_scene])

 

And if you also want to embeed in a function the traditional (and limited) way to duplicate the selected clip to the next scene, you can do it with this function:

 

def duplclip(self):

trk = self.song().view.selected_track
trk_id = list(self.song().visible_tracks).index(trk)
clp=self.song().view.selected_scene
clp_id = list(self.song().scenes).index(clp)
self.song().tracks[trk_id].duplicate_clip_slot(clp_id)

 

And that´s all. I´m working on an improved new version of Akamed Looping script, and I will upload it as soon as it is finished.

Cheers.