Current Track Index?

Post Reply New Topic
RELATED
PRODUCTS

Post

I've been playing around and adapting Tom's touchOSC script with plenty of success and plenty of frustration too.

I thought it would be a simple task to add a track selector set of buttons to easily select which is edited in the bankview and have an onscreen indicator of which is active. I'm completely perplexed at how hard it is to achieve due to the only options to manipulate the channel cursor are previous, next, first and last. There is a scrollToIndex for the bank but why not the same for the track? So I've managed to work around it by selecting first and then looping selectNext the required number of times but I feel like I must be missing something surely?

So the 2nd half of the problem is sending back any changes made in Bitwig to update my Select buttons. I cannot figure out how this is possible, there doesn't seem to be any relevant observer to set up to monitor a track selection? I'm really hoping someone can help and hoping even more that there is a simpler method to all of this :)

If anyone is interested in what I'm doing, I'm basically building an 8x8 grid with Volumes, Pans, Mutes and Solo for the iPad Pro. The Volumes etc are interchangeable with drum Pads and Keyboard but the Grid and Transport is always visible. I've disabled the device stuff that was there for now as I upgraded the script to API 5 and that code was deprecated but I'm hoping to get it working again at some point. I upgraded to use some of the newer additions in the hope it would solve my Track Index problem, but alas no..

I'm enjoying messing around with it a lot though, and already pretty happy with how it's working as a controller.

Post

Like this?

/**
* Select a track in the current bank page.
*
* @param index The index in the page
*/
public void select (final int index)
{
final Track t = this.trackBank.getChannel (index);
if (t == null)
return;
t.selectInEditor ();
t.selectInMixer ();
}

Post

Thanks Moss that really helped! So I don't need to use a separate cursor at all for selecting the track, that makes much more sense to me now and I have selectInMixer working.

But which observer would I use to detect the other direction when a track it is selected via the mouse? I thought it might be addTrackScrollPositionObserver but it doesn't seem to work.

Post

Astralp wrote:Thanks Moss that really helped! So I don't need to use a separate cursor at all for selecting the track, that makes much more sense to me now and I have selectInMixer working.

But which observer would I use to detect the other direction when a track it is selected via the mouse? I thought it might be addTrackScrollPositionObserver but it doesn't seem to work.
You need to monitor the "select" state of all tracks of a bank page. Assign an observer to each track of the bank (e.g. 8) or use the new markInterested()/get() combi.

Post

Thanks again, you've saved my sanity.

I got it working with addIsSelectedInMixerObserver is that what you meant? I can get on with all the other stuff I have to do now in peace, thanks again.

I couldn't find any info on the new method.

Post

I just learning that what I told you is to be considered as deprecated!

The correct way is now to use the cursorIndex() of track bank. This has the advantage that you can pin the cursor track (this means you can navigate it independent from the selections in Bitwig). You can either do that from the isPinned() property of cursor track or from the Bitwig UI (in the IO pane).

Post Reply

Return to “Controller Scripting”