Batchplay sequence loop from a click

Hi, I am an artist and novice developer working on a plug-in that I will post for free on github, etc. Reading through this board has been very helpful – thank you all.

Here’s the issue:
I am using multiple addEventListeners to trigger a series of batchplay sequences on a button “click”. Now, I need to figure out how to run the sequence of batchplay actions multiple times from just this one click event.

Not sure how to approach this. Maybe I would have to know when the last batchplay has completed, then maybe retrigger a click event?
Any advice on best approach would help.

Thanks!

1 Like

You could use synchronous BP or await for asynchronous.

batchPlay(
  [descriptor1, descriptor2, descriptor3],
  {synchronousExecution: true}
)

batchPlay(
  [descriptor4, descriptor5],
  {synchronousExecution: true}
)

batchPlay(
  [descriptor6, descriptor7],
  {synchronousExecution: true}
)

This way all three will be executed one after another and not all at the same time

Thanks so much for the reply! I will have to do a little homework on this, but I imagine it should work.