Help with... selectClip on cursorClip. ?

Post Reply New Topic
RELATED
PRODUCTS

Post

I'm looking to select a specific clip in the ClipLauncher and don't know how to do it on the cursor cursor clip.

From the Api Manual...

Code: Select all

CursorClip
void selectClip (Clip clip)


I'm not sure where to derive the clip from? I have a list of clip slots in the clip launcher bank and don't know how to get to it...
----------------------------------------------------------------------
http://instagram.com/kirkwoodwest/
http://soundcloud.com/kirkwoodwest

Post

Kirkwood West wrote: Wed Aug 12, 2020 5:07 am I'm looking to select a specific clip in the ClipLauncher and don't know how to do it on the cursor cursor clip.

From the Api Manual...

Code: Select all

CursorClip
void selectClip (Clip clip)


I'm not sure where to derive the clip from? I have a list of clip slots in the clip launcher bank and don't know how to get to it...
AFAIK CursorClip is currently the only clip. Yes, pretty weird.
To solve your question you need to use Slots. Get the slotbank from the trank, then get the slot and call select on it.

Post

So what i'm trying to do here is set the name of the clip in a clip slot...

This is some really funky code... It works but is unreliable if there are any gui interventions while this bit of code is running.

Code: Select all

   
   var track = this.trackBank.getItemAt(0);
   var launcherslotBank = track.clipLauncherSlotBank();
   var slot = launcherslotBank.getItemAt(this.playingSlotIndex)
   launcherslotBank.showInEditor(this.playingSlotIndex);
   this.cursorClip.setName(string);
To be honest i'm not sure why this actually works...
1. i have a trackbank of 1 with 128 scenes.
2. Get the launcher slot bank...
3. get the current slot playing in the bank. (this doesn't seem to be really used in the code)
4. LauncherSlotBankshowInEditor( index )...
5. set the name.

Maybe i even asked this on the forum before. Its unfortunate that name() on the clip launcher slot seems to be a read only value and the only way to change it is to use a cursorClip.
----------------------------------------------------------------------
http://instagram.com/kirkwoodwest/
http://soundcloud.com/kirkwoodwest

Post

I knew that this was discussed before to some degree...

Get name of clip
viewtopic.php?f=268&t=526350&p=7742586

How to get Clip instance without cursor ?
viewtopic.php?f=268&t=503002&p=7089715

In addition to being able to set the name of a clip from the clip launcher, it seems like there is only one active cursor clip at a time? does this mean bitwig is limited to only one device to edit a clip at once?
----------------------------------------------------------------------
http://instagram.com/kirkwoodwest/
http://soundcloud.com/kirkwoodwest

Post

Kirkwood West wrote: Wed Aug 12, 2020 11:15 pm So what i'm trying to do here is set the name of the clip in a clip slot...

This is some really funky code... It works but is unreliable if there are any gui interventions while this bit of code is running.

Code: Select all

   
   var track = this.trackBank.getItemAt(0);
   var launcherslotBank = track.clipLauncherSlotBank();
   var slot = launcherslotBank.getItemAt(this.playingSlotIndex)
   launcherslotBank.showInEditor(this.playingSlotIndex);
   this.cursorClip.setName(string);
To be honest i'm not sure why this actually works...
1. i have a trackbank of 1 with 128 scenes.
2. Get the launcher slot bank...
3. get the current slot playing in the bank. (this doesn't seem to be really used in the code)
4. LauncherSlotBankshowInEditor( index )...
5. set the name.

Maybe i even asked this on the forum before. Its unfortunate that name() on the clip launcher slot seems to be a read only value and the only way to change it is to use a cursorClip.
Step 4 might not be finished when 5 is executed. Remember these are all asynchroneous calls, even if they look like synchronous ones! Therefore, you should wrap the last call into a host.scheduleTask, which means it gets called in the "next processing round".

Post

Kirkwood West wrote: Wed Aug 12, 2020 11:28 pm In addition to being able to set the name of a clip from the clip launcher, it seems like there is only one active cursor clip at a time? does this mean bitwig is limited to only one device to edit a clip at once?
No, but you must create/configure the cursor to not follow the Bitwig selection otherwise they will all point to the same clip.

Post

Got it! will put some tasks in there to fix. maybe one day the items.name() in the clipLauncherSlot will use the SettableStringValue class instead of Value. Would simplify this a bit. :)
----------------------------------------------------------------------
http://instagram.com/kirkwoodwest/
http://soundcloud.com/kirkwoodwest

Post Reply

Return to “Controller Scripting”