Skip to content

Trigger clip if not playing #116

Answered by leolabs
bendorge asked this question in Q&A
Feb 10, 2024 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

Hey @bendorge,

Here's a simple example that starts the clip in the first slot of the first track if it's not playing:

const ableton = new Ableton();
await ableton.start();

const tracks = await ableton.song.get("tracks");
const clipSlots = await tracks[0].get("clip_slots");

const firstSlot = clipSlots[0];
const isPlaying = await firstSlot.get("is_playing");

if (!isPlaying) {
  await firstSlot.fire();
} else {
  await firstSlot.stop();
}

Let me know if this helps!

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@bendorge
Comment options

@leolabs
Comment options

@bendorge
Comment options

Answer selected by bendorge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants