Need help setting loop controls from js script
UPDATE: I kinda fixed it by removing the observer and using a metro instead. Seems to work as intended now
So I'm trying to build a "MD Assistant" plugin. Excuse me if this already exists but I couldn't find exactly what I was looking for.
So the plan is to have a device that lists all clips in the arrangement view for the device's track. I want to enable the user to specify the number of times the clip should be looped before continuing (like vamps). I want the clip (or track) to be muted for all passes except the last one. This way, I can put some callouts and countdowns on the track that will be sent to the musicians in-ears only. There should also be an option to end the loop prematurely if the MD wishes to do so. In that case, the loop should be disabled and the clip should play as normal.
I had a go on this with some help with copilot (total noob here, but have some JS programming experience), but it doesn't work as expected. A lot of transport.set instructions seem to get lost or are blocked with a warning that I need to defer my response (which I thought I was doing)
Any help in debugging this is helpful. It is still lacking a lot of the functionality. What I have here is populating the UI and if you set the counter to a non-zero value, the clip should loop exactly that many times before continuing.