Get specific clip in mixer view independent of selection

Post Reply New Topic
RELATED
PRODUCTS

Post

I want to get a clip object independent of the currently selected object in the mixer view.

I can only get a clipLauncherSlotBank via

host.createTrackBank(1, 0, 1).getItemAt(0).clipLauncherSlotBank()

but not the clip.

I can also get a pinnableCursorClip via

host.createCursorTrack("8dbcc337-9a41-4ab5-9dd9-97cd74c3437f", "Test", 0, 1, false).createLauncherCursorClip(16, 128)

but how can I then set the cursorTrack to a specific track and/or the pinnableCursorClip to a specific clip?

Post

what do you mean by setting the cursorTrack to a specific track? how do you want to do that lookup? by name? there are a couple ways to do that...

I did make this channel finder in the Java API that does this... (might need some attention, i have not used it in a while)
https://github.com/kirkwoodwest/Bitwig-API-Utils

With cursor tracks, cursor devices and cursor clips... I tend to new pin channels manually or with a custom helper to pin them by track index derived from a large track bank.
----------------------------------------------------------------------
http://instagram.com/kirkwoodwest/
http://soundcloud.com/kirkwoodwest

Post

I basically want to have a reference to a specific clip in mixer mode, which I can then modify independently of the user selection (add notes to the clip, etc.). For example if the clip is inside of track 0, scene 0 and the current selection is on track 1 I could still modify the clip at (0, 0) with a MIDI controller. I thought I could get the reference to it via host.createTrackBank(1, 0, 1).getItemAt(0).clipLauncherSlotBank(), but there isn't a method in cliplauncherslotbank that let's me get the clip object.
So I thought I could get the clip reference via a PinnableCursorClip, but I don't know how to set the track index and scene index for it.
I looked through your channel finder api, but can't find a way to get a specific clip after I found the track by name.

Post

Keep wrote: Tue Mar 21, 2023 8:41 pm I basically want to have a reference to a specific clip in mixer mode, which I can then modify independently of the user selection (add notes to the clip, etc.). For example if the clip is inside of track 0, scene 0 and the current selection is on track 1 I could still modify the clip at (0, 0) with a MIDI controller. I thought I could get the reference to it via host.createTrackBank(1, 0, 1).getItemAt(0).clipLauncherSlotBank(), but there isn't a method in cliplauncherslotbank that let's me get the clip object.
So I thought I could get the clip reference via a PinnableCursorClip, but I don't know how to set the track index and scene index for it.
I looked through your channel finder api, but can't find a way to get a specific clip after I found the track by name.
Yes, these 2 classes are confusing. Nevertheless, you can implement it by getting the slot from the clipLauncherSlotBank and calling select on it. Then pin the cursor clip. You might need to wait a few milliseconds till the selection gets active. ControllerHost.scheduleTask is your friend for that.

Post

AUTO-ADMIN: Non-MP3, WAV, OGG, SoundCloud, YouTube, Vimeo, Twitter and Facebook links in this post have been protected automatically. Once the member reaches 5 posts the links will function as normal.
This works as long as the desired clip is selected in the studio i/o panel.

Image

I don't even have to pin it. But is there a way to modify the clip even if it's not the selected in the studio i/o panel?

Code: Select all (#)

   @Override
   public void init() {
      ControllerHost host = getHost();
      host.getMidiInPort(0).setMidiCallback((ShortMidiMessageReceivedCallback) this::onMidi0);

      int trackIndex = 6;
      int sceneIndex = 0;
      TrackBank trackBank = host.createTrackBank(trackIndex + 1, 0, sceneIndex + 1);
      Track track = trackBank.getItemAt(trackIndex);
      ClipLauncherSlotBank clipLauncherSlotBank = track.clipLauncherSlotBank();
      ClipLauncherSlot clipLauncherSlot = clipLauncherSlotBank.getItemAt(sceneIndex);
      clipLauncherSlot.select();
      CursorTrack cursorTrack = host.createCursorTrack("8dbcc337-9a41-4ab5-9dd9-97cd74c3437f", "Test", 0, sceneIndex + 1, false);
      this.pinnableCursorClip = cursorTrack.createLauncherCursorClip(16, 128);

      host.scheduleTask(() -> {
      	 cursorTrack.isPinned().set(true);
         pinnableCursorClip.isPinned().set(true);
      }, 1000);
   }
  
   public void onMidi0(ShortMidiMessage msg) {
      pinnableCursorClip.setStep(0, 0, 127, 0.125);
   }
   
Last edited by KeepOn on Wed Mar 22, 2023 11:23 am, edited 1 time in total.

Post

KeepOn wrote: Wed Mar 22, 2023 6:56 am I don't even have to pin it. But is there a way to modify the clip even if it's not the selected in the studio i/o panel?
No. But remember that you can create multiple cursor clips which you can pin on different slots.

Post

Ah, ok I will try that.
Thank you very much for your help!!!

Post Reply

Return to “Controller Scripting”