How to lock on a tracks first device RemoteControlsPage?

Post Reply New Topic
RELATED
PRODUCTS

Post

How can I just get the first Device of a Track but never ever loosing its focus? In the long run I create a RemoteControlsPage from the Device but unfortunately for everything i tired the RemoteControlsPage was always following the cursor device selection in the ui...

The documentation for track.createCursorDevice("Primary") states
independent from the device selection in the Bitwig Studio user interface
not true..

I even tried pinning with a PinnedDeviceCursor created from a TrackCursor.createCursorDevice(String, String, int, CursorDeviceFollowMode) and using CursorDeviceFollowMode::FIRST_DEVICE, still doesnt work..

Has anyone achieved something like that? Would appreciate any help :pray:

Post

its very confusing for me as well here... i'm doing similar stuff.

i set the follow mode to FIRST_DEVICE as well.

I just go into the user interface and pin the device manually. It seems to work but there has to be a better way.
----------------------------------------------------------------------
/CTRL → http://slashctrl.io
Music & mixes → http://soundcloud.com/kirkwoodwest

Post

Mh.. even pinning the device manually havent helped me out before but ill try again. Are you also using the device for creating a RemoteControlsPage?

Post

yes... its something like this...

Code: Select all

knob_count = 8;
cursorTrack = host.createCursorTrack("CURSOR_TRACK_1', 'control_id_1', 0,0, false);
cursorDevice = cursorTrack.createCursorDevice('CURSOR_DEVICE_1', 'CURSOR_DEVICE_1', 0, CursorDeviceFollowMode.FIRST_DEVICE); 
cursorRemotePage = cursorDevice.createCursorRemoteControlsPage('CURSOR_REMOTE_1', knob_count,'');
---------------------------------------------------------------
http://kirkwoodwest.com/

Post

heins wrote: Tue Jul 28, 2020 12:16 pm Mh.. even pinning the device manually havent helped me out before but ill try again. Are you also using the device for creating a RemoteControlsPage?
The device area is definitively not easy to undertstand.

I guess what you missed is that this is also dependent on the CursorTrack. So also the CursorTrack needs to be marked to not follow selection and you can also pin the cursor track.
To see the pin method look at PinnableCursor, which is both implemented by PinnableCursorTrack and PinnableCursorDevice.

Post

I wanted to pass this on since I was doing the similar thing as you. I made a strange script where you can target cursor remotes to specific channels. Requires a little bit of set up but you can see in the example how it can be done.

It uses a trackbank and moves it around until finding a track with the same name as the input. once it has the a match it selects that channel on the cursor track and sets the pin.

I hope the code is somewhat readable. its gets complex with the callbacks and use of scheduleTask. Also very very sad oop implementation. :hihi:

I really wish there was a more reliable way of doing this. There are some random ticks that have to happen in order for it to make it work and if there is more than one channel finder instance bitwig sometimes has difficulty finding it because its moving the bank each time, waiting, then checking the name, moving, wait, check.

(last edit i swear... if someone has a method of getting a full track list, their channels and name from a bitwig that would probably simplify this script greatly. i guess another option would be to create a massive track bank, observe their names and then from there you would have a list of channels to target)
You do not have the required permissions to view the files attached to this post.
----------------------------------------------------------------------
/CTRL → http://slashctrl.io
Music & mixes → http://soundcloud.com/kirkwoodwest

Post

Turns out I was not happy with how that cursor track selector worked. So I refactored it.

This version simply makes a bank of 128 and then when you use channelFinder.find() you specify the cursor track and the name of the track you want to target. It finds it and then moves the cursor track to it.

Its much simpler and faster this way. somehow i just wanted to avoid making a bunch of large banks just to do this... and of course there has to be a better way. Would love to see other approaches.
You do not have the required permissions to view the files attached to this post.
----------------------------------------------------------------------
/CTRL → http://slashctrl.io
Music & mixes → http://soundcloud.com/kirkwoodwest

Post

Kirkwood West wrote: Wed Jul 29, 2020 7:48 pm Turns out I was not happy with how that cursor track selector worked. So I refactored it.

This version simply makes a bank of 128 and then when you use channelFinder.find() you specify the cursor track and the name of the track you want to target. It finds it and then moves the cursor track to it.

Its much simpler and faster this way. somehow i just wanted to avoid making a bunch of large banks just to do this... and of course there has to be a better way. Would love to see other approaches.
Interesting idea! You can speed it up if you monitor the track names and put them in a map. This way you can look up the track in O(1) instead of O(N).

Post

Moss, would love to speed this up. But I'm not sure what structure to put these in, right now its just enumerated.

If i put them in an object with name and channel pair, and the name updates, i won't know where to update the channel name. so yeah i'm not sure how to put them in a map that can update with the observer. Also if there are duplicate channel names this might be a bad idea...

Another issue i'm having is on initialization it can't find the objects because they don't exist yet. I've put a delay in the main thread before I execute find. But its unreliable as some songs take more time than others... Another thing related to this is when looking up names if they aren't initialized yet... i think it only returns an empty string ''. So I don't have a specific way of differentiating a track with an empty name and a null or undefined string.

Was thinking of doing some sort of init flag and cache/delay any "finds()" until its ready. Then when the name updates via observer. i can finally execute the find.

I also added a feature to move TrackBanks to their respective name as well but will hold off on updating until i can get the init and indexing problem solved.
----------------------------------------------------------------------
/CTRL → http://slashctrl.io
Music & mixes → http://soundcloud.com/kirkwoodwest

Post

Kirkwood West wrote: Thu Jul 30, 2020 5:01 pm Moss, would love to speed this up. But I'm not sure what structure to put these in, right now its just enumerated.
This should do the trick.
You do not have the required permissions to view the files attached to this post.

Post

Thats is rad. did not know about arrow functions! thanks Moss!
----------------------------------------------------------------------
/CTRL → http://slashctrl.io
Music & mixes → http://soundcloud.com/kirkwoodwest

Post Reply

Return to “Controller Scripting”