Creating MIDI clips in arrangement view via Live API in JavaScript very slow

Dr. Tristan Behrens's icon

Hello everyone,

I am facing some issues with the Live API. Could it be that creating MIDI clips in arrangement view via Live API in JavaScript is very slow?

I found it rather complicated to create clips in the arrangement view. This is how I did it:

- Select a track.

- Find a clip slot in the track.

- Create a clip in the clip slot.

- Duplicate the clip to arrangement view.

- Delete the clip from the clip slot.

I did not find a way to directly create a clip in arrangement view. That is I why I took the detour via session view.

A sketch in code:

// Get a track.
var track = new LiveAPI("live_set tracks " + trackIndex);

// Get a clip slot.
var clipSlot = LiveAPI("live_set tracks " + trackIndex + " clip_slots " + clipSlotIndex); // Get a clip slot.

// Create a clip.
clipSlot.call("create_clip", 4);

// Duplicate the clip to arrangement view.
track.call("duplicate_clip_to_arrangement", clipInClipSlot, startBeats);

// Delete the clip.
clipSlot.call("delete_clip");

Any ideas?

Cheers,

Tristan