Modifying the 8 knob script to 16 knobs over 2 pages

Post Reply New Topic
RELATED
PRODUCTS

Post

I want to use the generic script with a new keyboard that has 2 8 knob user pages (and can add more) - they go from cc14 to 29 but the 8 knob script just covers 20-27 and one page. How can I modify it - I can probably just change the cc numbers easily enough but not so clear on adding pages and making that work with devices
Last edited by aMUSEd on Sat Sep 23, 2017 1:54 pm, edited 1 time in total.

Post

OK got the first part working, I can control using 8 knobs, but still not clear how to enable 16 knobs across 2 user pages (I also have 8 buttons I could use theoretically)

Post

Is this just a case of changing the 14-22 to 14-29 and changing this

remoteControls = cursorDevice.createCursorRemoteControlsPage(8);

to this

remoteControls = cursorDevice.createCursorRemoteControlsPage(8,8);

edit no BWS says that's wrong

it accepts

remoteControls = cursorDevice.createCursorRemoteControlsPage(16);

but only the first 8 knobs are actually doing anything it seems, it doesn't map them over the 2 user pages
Last edited by aMUSEd on Sat Sep 23, 2017 7:57 pm, edited 1 time in total.

Post

So where does it specify how to tell BWS to split a series of 16 consecutive CC numbers over 2 pages of 8 knobs? Surely that is not so hard? All the scripting documentation is aimed at people who already understand this, they need to make it more easy for non scripters.

Post

Could you link your script with what you have so far? Maybe we can get it solved together, i'm no expert tho.

Post

Sure - but it's just Tom's 8 knob generic script slightly edited

https://www.dropbox.com/s/n50n9z0g46h3f ... ol.js?dl=0

So far it loads and doesn't give any errors but only the first 8 knobs are actually working

Post

hm, no idea sorry.

I do have an adjustment of an older script by Tom here:

https://codepen.io/anon/pen/GMNqZO?editors=0010

It uses the old primary device and links the knobs to the macros, maybe it can give you some inspiration. Especially in the function onMidi(status, data1, data2) i got a defined case for every controller. Might not be an elegant solution, but does work. I thought this could maybe integrated in your script, but not sure.

Post

Thanks - I'm not sure how either :( I can see this is a multi channel script but not how it enables the macro knobs. I wish they had made this a lot more user friendly, I rather think they shot themselves in the foot by making it so complex, yes it can potentially do a lot but it also shuts most users out of the process of making them which I guess is why the number of people actively involved in making these seems to be very small.

Post

This is the definition of the variables at the top. You might need to define all 16 then with their cc:

Code: Select all

var _knob1    = 102;
var _knob2    = 103;
var _knob3    = 104;
var _knob4    = 105;
var _knob5    = 106;
var _knob6    = 107;
var _knob7    = 108;
var _knob8    = 109;
in function init() this gets initialized in my script

Code: Select all

primaryDevice = cursorTrack.getPrimaryDevice();
wich would probably be your:

Code: Select all

cursorDevice = cursorTrack.createCursorDevice();
maybe then change this

Code: Select all

for ( var i = 0; i < 16; i++)
	{
		var p = remoteControls.getParameter(i).getAmount();
		p.setIndication(true);
		p.setLabel("P" + (i + 1));
	}
to this

Code: Select all

for ( var i = 0; i < 16; i++)
	{
		var p = cursorDevice.getMacro(i).getAmount();
		p.setIndication(true);
		p.setLabel("P" + (i + 1));
	}
and in function onMidi

Code: Select all

function onMidi(status, data1, data2)
{

    printMidi(status, data1, data2);

    if (isChannelController(status))
    {
        switch (data1)
        {
                case _knob1:
                cursorDevice.getMacro(0).getAmount().set(data2, 128);
                break;
                case _knob2:
                cursorDevice.getMacro(1).getAmount().set(data2, 128);
                break;
                case _knob3:
                cursorDevice.getMacro(2).getAmount().set(data2, 128);
                break;
.
.
.
.
}
that's all what matters in my script to make this work i think. Since primaryDevice is now deprecated, cursorDevice is supposed to be used.

Not sure what the remoteControls actually do in your script, but i would focus on the selected device (cursorDevice) and its macros i guess.
Last edited by llze on Sat Sep 23, 2017 11:03 pm, edited 1 time in total.

Post

What makes me rethink this is, that there are only 8 macros, so you be better of with the parameters then instead. So instead of getMacro(i) better use getParameter(i) maybe.

But it could also not work like that at all, due to this difference with get and create hehe. Sorry if it isn't much help, maybe someone could chime in and educate on this.

Code: Select all

primaryDevice = cursorTrack.getPrimaryDevice();
cursorDevice = cursorTrack.createCursorDevice();

Post

Thanks - sorry didn't have time to do much with this, the whole thing is confusing, it should just be a clear option and well documented in user friendly language

Post

aMUSEd wrote:Thanks - sorry didn't have time to do much with this, the whole thing is confusing, it should just be a clear option and well documented in user friendly language
I just looked into that since I wanted to do something similar. it seems that no matter how much parameters you define you only get the ones present on 1 page. I guess that's intentional. E.g. look on a page which has 9 parameters when you have defined 16; there you will get all 9.

Post Reply

Return to “Controller Scripting”