Latest News: Bitwig Updates Bitwig Studio to 5.2
Modifying the 8 knob script to 16 knobs over 2 pages
- KVRAF
- Topic Starter
- 35295 posts since 14 Sep, 2002 from In teh net
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.
- KVRAF
- Topic Starter
- 35295 posts since 14 Sep, 2002 from In teh net
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)
- KVRAF
- Topic Starter
- 35295 posts since 14 Sep, 2002 from In teh net
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
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.
- KVRAF
- Topic Starter
- 35295 posts since 14 Sep, 2002 from In teh net
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.
- KVRAF
- 4633 posts since 21 Jan, 2008 from oO
Could you link your script with what you have so far? Maybe we can get it solved together, i'm no expert tho.
- KVRAF
- Topic Starter
- 35295 posts since 14 Sep, 2002 from In teh net
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
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
- KVRAF
- 4633 posts since 21 Jan, 2008 from oO
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.
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.
- KVRAF
- Topic Starter
- 35295 posts since 14 Sep, 2002 from In teh net
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.
- KVRAF
- 4633 posts since 21 Jan, 2008 from oO
This is the definition of the variables at the top. You might need to define all 16 then with their cc:
in function init() this gets initialized in my script
wich would probably be your:
maybe then change this
to this
and in function onMidi
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.
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;
Code: Select all
primaryDevice = cursorTrack.getPrimaryDevice();
Code: Select all
cursorDevice = cursorTrack.createCursorDevice();
Code: Select all
for ( var i = 0; i < 16; i++)
{
var p = remoteControls.getParameter(i).getAmount();
p.setIndication(true);
p.setLabel("P" + (i + 1));
}
Code: Select all
for ( var i = 0; i < 16; i++)
{
var p = cursorDevice.getMacro(i).getAmount();
p.setIndication(true);
p.setLabel("P" + (i + 1));
}
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;
.
.
.
.
}
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.
- KVRAF
- 4633 posts since 21 Jan, 2008 from oO
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.
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();
- KVRAF
- Topic Starter
- 35295 posts since 14 Sep, 2002 from In teh net
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
- KVRAF
- 4145 posts since 13 May, 2004
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.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