Bitwig Scripting : Get plugin parameters

Post Reply New Topic
RELATED
PRODUCTS

Post

Hi guys,
I'm currently working on a project where I need to change a parameter (from 0 to 1 and 1 to 0) of a plugins of certain track.
I tried everything I could with the getParameter function but it looks like they are all nameless and empty. I followed host -> trackBank -> cursorDevice -> cursorRemoteControlPage -> getParameter but like I said, when I println their name or value, they are all nameless and with a value of 0.
I don't have any error printed in the terminal
I markInterested() the name and the value
I'm running out of idea now :?
If someone have any idea of what i'm talking about please help me ^^

Post

I guess you are talking about a VST plugin? Did you map the parameter to a remote control? If not everything will be empty. See here:
https://www.youtube.com/watch?v=UeK9cGfNDeo

With the new hardware API you can also directly access VST parameters. See my tutorial series here:
https://www.youtube.com/watch?v=kTf_SSIyBEg

Post

Thanks a lot for your quick answer Moss
I'm currently looking to it.
About the binding:
The only things i did i cursorDevice.createCursorRemoteControlsPage(8) then (for example) i get the first param with getParameter(0) and i try to println the name and the value
but i'm not sure that's the right way to do it.
To be clear, my goal here is to change one parameter of a plugin in a track when the arm button of this track is clicked.
With what i explained in my first message, am I doing it the right way ?

Post

Basakio wrote: Tue Jun 01, 2021 9:09 am Thanks a lot for your quick answer Moss
I'm currently looking to it.
About the binding:
The only things i did i cursorDevice.createCursorRemoteControlsPage(8) then (for example) i get the first param with getParameter(0) and i try to println the name and the value
but i'm not sure that's the right way to do it.
To be clear, my goal here is to change one parameter of a plugin in a track when the arm button of this track is clicked.
With what i explained in my first message, am I doing it the right way ?
In theory yes, but hard to tell without seeing your code.

Post

Thanks again moss for your quick answer
I tried a few things those days but nothing seems to work
I'm just trying to print the number of parameter (with goal to finaly get the parameters name) inside the VST plugin in all my tracks
when i'm executing this, it send me 0 for all of them, when their is actually 37 parameters :/

Code: Select all

loadAPI(13);
host.defineController("Ugo", "Edit Param", "0.1", "daef111e-2042-4b33-a203-2b7e7b09e09a", "Ugo");
host.defineMidiPorts(1,0)
function init() {
   //############################Script initialisation####################################
   host.getMidiInPort(0).setMidiCallback(onMidiPort1);
   noteIn = host.getMidiInPort(0).createNoteInput("Notes")
   noteIn.setShouldConsumeEvents(false)
   
   //############################Get track list initialisation####################################
   cursorTrack = host.createCursorTrack("lid","Cursor Track",0,0,false)
   trackBank = host.createMainTrackBank(100,0,0)

   //############################TODO####################################
   trackTab = []
   cursorDeviceTab = []
   cursorRemoteControlsPagetab = []
   for (i=0;i<100;i++){
      //array of tracks
      trackTab.push(trackBank.getTrack(i))
      //array of cursorDevice
      cursorDeviceTab.push(trackTab[i].createCursorDevice("Primary"))
      //array of cursorRemoteCrontrolsPage
      cursorRemoteControlsPagetab.push(cursorDeviceTab[i].createCursorRemoteControlsPage(8))

   }
   
   specificPluginDevicetab = []
   parameterTab = []
   for (i=0; i< cursorDeviceTab.length;i++){
      trackTab[i].arm().markInterested()
      cursorDeviceTab[i].name().markInterested()
      specificPluginDevicetab[i]  = cursorDeviceTab[i].createSpecificVst2Device(1)
      cursorRemoteControlsPagetab[i].pageCount().markInterested()
   }

   for (i=0; i< parameterTab.length;i++){
      parameterTab[i].name().markInterested()
   }

   //############################Start delayed function after 200 ms####################################
   host.scheduleTask(function() { delayed(); }, 200);
}

function delayed() {
   for (i=0;i<100;i++){
      if(cursorDeviceTab[i].name().get() !== "" && cursorDeviceTab[i].name().get()!==null){
         println("name: "+cursorDeviceTab[i].name().get())
         println(trackTab[i].arm().get())
         println("param:"+cursorRemoteControlsPagetab[i].pageCount().get())
      }
   }
}

if you can give me some advices, I can't figure out what I am doing wrong please.
Last edited by Basakio on Thu Jun 10, 2021 12:39 pm, edited 1 time in total.

Post

The first line in init() has an undefined method:
host.getMidiInPort(0).setMidiCallback(onMidiPort1);

After removing that line it starts and prints out what you coded. But your code does not print parameters but parameter pages.

parameterTab is never filled if that what you are after.

Post

Thanks moss.
you're right parameterTab is not filled, i forgot to delete this for loop.
I'm printing 3 things here, the name of the track, if it is armed and how many parameters this track have (this part does'nt work)
Can you guide me on how should i print the number of parameters in those pages please and how to get the name and the value of each one?

Post

I've look a little more into it, and i can change the parameter of my VST Plugin but for this i need to manually add (on Bitwig interface) a Remote control page and map the parameter i want on it .
It's not really what i want, i want this process to be fully automated so i can change the VST Plugin parameter just with script.
if someone have any idea on how to do that, it would be much appreciated

Code: Select all

loadAPI(13);
host.defineController("Ugo", "Edit Param", "0.1", "daef111e-2042-4b33-a203-2b7e7b09e09a", "Ugo");
host.defineMidiPorts(0,0);
function init() {
   cursorTrack = host.createCursorTrack(0, 0)
   cursorDevice = cursorTrack.createCursorDevice()
   Page = cursorDevice.createCursorRemoteControlsPage("nom", 8, '')
   var param = Page.getParameter(0);
   param.value().addValueObserver(128, function(newVal) {
      println('Param ' + 0 + ' of changed to = ' + newVal);
  });
}
can Device.addDirectParameterValueDisplayObserver() be usefull here ?

Post

i'm unsure how to make a generic interface to the vst parameter list. it seems like at some point in the API this was possible... then it wasn't. and now in the later versions there has to be specific code matching the VST guid. would be nice to just get the guid or id somehow and let the control surface deal with the parameter matching.

Is there a way to make a generic device matcher?
----------------------------------------------------------------------
http://instagram.com/kirkwoodwest/
http://soundcloud.com/kirkwoodwest

Post

I think your right when you say that "it seems like at some point in the API this was possible" because some deprecated function seems like they match what i'm looking for (That's why I tried to change the API version but then I need function from later version ... it never ends).
I fount it strange because I think it's something very usefull but i never found someone stuck with this probleme.
I've scripted on like 5 different DAW this past months (to make the same script on those 5) and i never encounter this probleme before, on other DAW, every scripter play with plugin parameters, it's something basic.

Post

It indeed is something basic. So far my experience learning the plugin apis is that
1. there is no sane english walkthrough of the history of the apis.
2. bitwig wrote an intro doc for version 1 of the apis (api level 1).
3. modern bitwig (4.0.1 as of today) ships with a local set of html doc files organized by a robot into api levels without much discussion about the apis and their development.

4. If you use bitwig to scaffold a new controller script it comes out (as of today) as api level 14 but most scripts in the wild and most scripts that ship with bitwig itself are api level 1 even today. Why is bitwig going through 13 more api level standards and yet never moving their own scripts up to api level 14? What's wrong.


What I would like to see Bitwig have done is another API document and SOME CODE SAMPLES in the documentation.

Per this thread, for Working with VST plugins, an example of what can be done would help everyone.

I definitely (as this thread is about this specific case) want to be able to read VST Plugin parameters. Whatever things VST3 makes possible, should be exposed to the scripting api. VST3 standard has its own presets standard, and we should have access to VST3 presets from scripting. Imagine I have a guitar effect chain inside a Guitar VST3 plugin (maybe Guitar Rig 6). I may want to tell the VST3 to load a preset or I may want to detect that there's a parameter called PRESET which can have a value written in the range 0-127.

Every other DAW scripting environment lets me enumerate the VST plugins.
Good API documentation should be example based. Maybe folks like Moss can suggest (with some hope bitwig devs will listen to) some refinements to the API.

Post Reply

Return to “Controller Scripting”