Selecting the next / previous preset ?

Post Reply New Topic
RELATED
PRODUCTS

Post

Does anyone know if it is possible to select the next / previous preset via the controller API? I've made some attempts and got as far as popping up the browser. I basically want to be able to click the "replace content pop-up brower" button on a device, select a preset and click OK. And then from that point I want to be able to mimic these two next/previous buttons on my controller without actually loading up the pop-up browser again. I want to just cycle presets with my controller.
You do not have the required permissions to view the files attached to this post.

Post

I vaugely remember an interface called "PopupNavigator" or something of that nature. It appeared to be in a similar family as "RemoteControlBank" and "ClipLauncherSceneOrSlotBank," in that it existed to create an interface between popup browsers and controllers.

I've never used it, and have no idea what it's limits are. Let us know what interfaces you've tried using and how it goes!

Post

Yes, look at the documentation of the PopupBrowser class. There are filter columns and the result column. What you are looking for is the result column. All these columns use the bank concept which you should be already familiar with from tracks and devices.

Post

Thanks for the responses. This is what I've been using and it works well enough. The pop-up browser must already be opened and preview enabled to have any effect.

Code: Select all

protected PopupBrowser mPopupBrowser;
...snip...

@Override
public void init()
{
   ...snip...
   mPopupBrowser = getHost().createPopupBrowser();
}

// called from onMidi0 after match
  protected void nextPatch() {  mPopupBrowser.selectNextFile();  }
 
 // called from onMidi0 after match 
  protected void prevPatch()  {   mPopupBrowser.selectPreviousFile();  }



Post

were you hoping to find a way to do something like?

Code: Select all

// pseudo code
browser.open();
browser.moveSelection(btn === "up" ? 1 : -1);
browser.selectAndClose();
...because that would be really cool

Post

rbuse wrote: Tue Mar 22, 2022 4:53 pm Thanks for the responses. This is what I've been using and it works well enough. The pop-up browser must already be opened and preview enabled to have any effect.

Code: Select all

protected PopupBrowser mPopupBrowser;
...snip...

@Override
public void init()
{
   ...snip...
   mPopupBrowser = getHost().createPopupBrowser();
}

// called from onMidi0 after match
  protected void nextPatch() {  mPopupBrowser.selectNextFile();  }
 
 // called from onMidi0 after match 
  protected void prevPatch()  {   mPopupBrowser.selectPreviousFile();  }


The old TouchOsc template for Bitwig has preset switching without opening a browser, the script is here https://github.com/astartes72/TouchOSC- ... control.js on line 307 . I would like to use this for the keyboard, can you help me to clean up this script so that it does not monitor devices and only switches presets? He is still workig.

Post

Okay, I did it myself, cleaned up the whole script and made 3 copies since this is my first time doing anything on js. Perhaps in the future I will make one functional script, but for now this is how it is. All three scripts do the same thing, switch presets)) The only difference is how they work with notifications. ▲ PS ▼ Not - switches presets without notification. ▲ PS ▼ Only Preset - Shows notifications only when presets are switched. ▲ PS ▼ All - there are a lot of notifications)) it shows them when switching presets and when selecting tracks, also when selecting devices with the mouse. All three scripts use numbers CC 33 this is the previous preset and 34 this is the next preset. I also recorded a video of how using a regular keyboard using Shift+Z and Shift+X you can switch presets using these scripts. For the controller we do everything the same as in the video https://youtu.be/VHMCj6DUKgw I posted the scripts in my telegram channel https://t.me/BitwigTOSC

Post Reply

Return to “Controller Scripting”