clip launcher observer and addPlaybackStateObserver()

Post Reply New Topic
RELATED
PRODUCTS

Post

Hello,
I would like to write a script to manage toggle play/stop clip buttons for a diy arduino midi controller, so when I will press "button1" it will launch/stop the clip of 1st trackbank of the selected scene, "button2" will launch /stop the clip of 2nd track and so on...
I first tried to register a PlaybackStateObserver to watch change of states, and modified the tutorial script by Moss https://github.com/git-moss/Bitwig-Cont ... ter/Part-7
so I writed this code:

Code: Select all

ndler (trackbank, cursorTrack)
{
this.trackbank = trackbank;
this.cursorTrack = cursorTrack;

for (i = 0; i < this.trackbank.getSizeOfBank (); i++)
{
var track = this.trackbank.getItemAt (i).clipLauncherSlotBank ();
var p = track.addPlaybackStateObserver(function (slot_index, playingstate, queued) {
println("Slot Index:" + slot_index + " | State(0 stop-1 playing):" + playingstate + " | isQueued:" + queued)
});
}
this.trackbank.followCursorTrack (this.cursorTrack);
my problem is that "slot index" in the callback function returns the scene index and not the track index.
Any suggestions?
Thanks

Post

You already know the track index, it's `i`.

Post

Yes, it's true. Shame on me!

Post Reply

Return to “Controller Scripting”