updating for 2.0 - pointing old envelope and common sections to pages

RELATED
PRODUCTS

Post

Ok, Nick set me on the right track and it's working now:

I will list the snippets here that lead to a working Remote Control. You don't have to follow this exactly and can of course use the other functions available, only the cursorDevice creation seems to be crucial:

Code: Select all

In Init:
        //the selected track in arranger
	cursorTrack = host.createArrangerCursorTrack(8,8);
	followMode = CursorDeviceFollowMode.FOLLOW_SELECTION;
        //Using this form to create the cursorDevice seems to be crucial!
	cursorDevice = cursorTrack.createCursorDevice("YourID", "YourName", 8, followMode); 
        // Cursor pages for the Remote Controls:
	cursorPage1 = cursorDevice.createCursorRemoteControlsPage("CursorPage1", 8, ""); // I use no filter here

You can then set the cursor page with:
    cursorPage1.selectedPageIndex().set(0); // here I select the first one.

In onMidi you can then set a value with:
    cursorPage1.getParameter(0).set(data2,128);
I successfully used multiple pages at once.

I hope this helps!

Cheers,

Tom
"Out beyond the ideas of wrongdoing and rightdoing, there is a field. I’ll meet you there." - Rumi
ScreenDream Instagram Mastodon

Post

Tom, nice to see you´ve got it working.

Any Plans to update the Scripts you´ve written for BWS ver.1? Specially the Arturia Keylab Script would be interesting (at least for me). Tried to get my Head around that script but i´m totally Lost (have to say: I´m no Programmer) so i´m unable to figure out what goes where.

Post

Hey astartes,

I wrote that script while working for Bitwig, but that gig ended in 2014.
I personally do not own a Keylab, so can't really test and update the script reliably (I hate not being able to check what I do right away ;-) ).

And yeah, it got rather involved with all the modes and stuff. I would need some time myself to get into it again ;-)

What I currently do is writing a custom script for a mixing engineer with quite specific needs.
I may update my own basic scripts later after this gig, when the API has settled a bit more, ATM there are still some weird things going on, since 2.0 changed quite a lot (in a very good direction overall, but still...).

Cheers,

Tom
"Out beyond the ideas of wrongdoing and rightdoing, there is a field. I’ll meet you there." - Rumi
ScreenDream Instagram Mastodon

Post

Hi Tom,
Thanks for posting these tips here.
Your code showed exactly what I needed, independent remote controls pages, not controlled from the user interace.

The thing I needed though is adding an observer on remote controls value, and I can't seem to get this to work. I've tried 2 possible ways of doing this, none of them works.

I have adapted your code and made this:

Code: Select all

cursorTrack = host.createCursorTrack(3, 0);
followMode = CursorDeviceFollowMode.FOLLOW_SELECTION;
cursorDevice = cursorTrack.createCursorDevice("YourID", "YourName", 8, followMode);
remoteControls = cursorDevice.createCursorRemoteControlsPage("first", 8, "first");
remoteControls.selectedPageIndex().set(0);

remoteControls.getParameter(0).value().addValueObserver(function (obj) {
  println(obj)
});
Extending from the 8 knobs default controller script I have also tried this:

Code: Select all

	for ( var i = 0; i < 8; i++)
	{
		var p = remoteControls.getParameter(i).getAmount();
		p.setIndication(true);
		p.setLabel("P" + (i + 1));
      p.value().addValueObserver(function (obj) {
        println(obj)
      })
	}
Any idea what could help me achieve that?
Thanks!

Post

Sorry, I'm currently on the road for two weeks, not having the script with me and I can't remember the exact syntax.
I seem to remember though, that you don't need to put value() in front of the addValueObserver. Check the docs to see where in the hierarchy the observer is set.
I may remember wrong though, I went through too many variations myself... ;-)

Good luck and Cheers!

Tom
"Out beyond the ideas of wrongdoing and rightdoing, there is a field. I’ll meet you there." - Rumi
ScreenDream Instagram Mastodon

Post

I might try with the new Java API. It is all very frustrating as documentation says very little and the behaviour isn't always completely predictable and unified across the API!

Using it on a RemoteControl object now yields a deprecation warning:
"Error starting driver: This has been deprecated since API version 2: Use value().addValueObserver(callback) instead"
And disabling those failure-on-deprecated it still doesn't work.

The weird thing is that it works by using a CursorRemoteControlsPage that is dependent to the user selection in BWS ui:

Code: Select all

	cursorTrack = host.createCursorTrack(3, 0);
  followMode = CursorDeviceFollowMode.FOLLOW_SELECTION;
	cursorDevice = cursorTrack.createCursorDevice("YourID", "YourName", 8, followMode);
	remoteControls = cursorDevice.createCursorRemoteControlsPage(8); // <- one argument instead of (String name, int parameterCount, String filterExpression)
...

    p.addValueObserver(function (obj) {
      println(obj)
    })
This works but then moves with the user selection, which is not what I want.

Anyway, thanks for the help :) I'll write an email to BWS support.

Post

Yeah, that's probably the best ;-)

Cheers,

Tom
"Out beyond the ideas of wrongdoing and rightdoing, there is a field. I’ll meet you there." - Rumi
ScreenDream Instagram Mastodon

Post Reply

Return to “Controller Scripting”