simplest controller script with ~16 parameter knobs that I could peek/edit for my Xsession pro?

Post Reply New Topic
RELATED
PRODUCTS

Post

I saw it at a pawn shop for $5. Easy buy for a few extra knobs, faders and buttons and decently small size. Perfect for on-the-go transport, cursor and parameter page controls.

However, I've not coded in about 3 years (and even then it was a simple file replacement package in vb.net) and I was HOPING to get away with a little copy, pasta and experiment just for the remaining 16 midi cc's that I'd like to map to Bitwig's colored parameter pages for selected devices.

All other controls were easy to map through the Shortcuts in Preferences.

I've scanned the Intro that Mr. Hezle was awesome enough to put up for us, but as I read a bit further than the first few posts, I started to get the impression that my hopes of doing this quick parameter page 16 knob link within the "quick" description. :P

Any help would be greatly appreciated. Even a sample script with only parameter pages for the selected device would probably be perfect (if that exists, of course).

Even a "go read this post/page/link/manual for the parameter page to CC linking part" would rock.

Thanks in advance for any guidance!

Post

So you want to assign fixed CCs to parameter pages?
In that case I would suggest using the "Common Parameters" and either the "Envelope" or one user parameter page, so you can access them all at the same time (user parameter pages can only be accessed one at a time).
For this you need a Cursor Device - the easiest would probably be the currently selected device in the GUI.
So in init(), you would create:

Code: Select all

//create the cursorDevice for later access:
cursorDevice = host.createEditorCursorDevice();
Then in your onMidi function you could use (in the most simple case):

Code: Select all

if (data1 >= YourLowestCC && data1 =< YourHighestCC) {
switch (data1) {
    case YourLowestCC:
        cursorDevice.getCommonParameter(0).set(data2, 128);
        break;
    case YourLowestCC+1:
        cursorDevice.getCommonParameter(1).set(data2, 128);
        break;
....
}
This is just from the top of my head - it's been a while since I did any scripts for BWS.
The CCs are 0-based.
You can also check the API docs on the device, there are all the definitions for the different kinds of parameter pages.

I hope this helps!

Cheers,

Tom
"Out beyond the ideas of wrongdoing and rightdoing, there is a field. I’ll meet you there." · Rumi
UrbanFlow.art · Instagram · YouTube

Post

Thank you, good sir! You are my savior! If I get into this and end up digging deeper, I'll post the script for it. Though, the first time I've heard of it was when I saw it in the pawn shop. :\

Post

Woo! That was fun. :P

It's been quite a while since I've done any code. Well, other than simple powershell scripts for an large organization's bulk workstation management.

Took me longer than I'd have liked, but I've got 2 parameter pages done. I got hung up for the longest time on simply getting my script in the list. Figured it out shortly after finding out about the scripting console window (maybe the devs can consider moving that section higher in the guide).

I didn't realize that I was going to lose the quick shortcuts I'd made in preferences, though. Oh well, guess I'll have to do a full script for it. :shrug:

I'm happy about it though. I've wanted to do an advanced controller script for the BCR2000 for quite some time. Perhaps a custom mode for the automation preset sequencer group track preset that I've been messing with. Ideas were seeping in while I was learning the syntax and guidelines of the little I just did. I'm sure that our users with the Behringer box-o-knobs may get a kick out of something like that.

Either way, I've got enough to keep me busy for a while.

Thanks for the help and boost I needed to get into controller scripting. I'm psyched! :hyper:

Post

Awesome! :-)
You can do a lot of stuff, not only straight forward controller scripting but also some fun creative things...

As for the script:
- You can build in different modes, one for the parameter pages and one for the shortcuts - I guess you do not want them both to be triggered at the same time... The Xsession seems to have forward/back knobs, so you could implement several modes and cycle through them, one for mixing, one for devices etc. I often use the Popup Notifications to make it easier to know where you are, for example:

Code: Select all

host.showPopupNotification("Current Mode: Mixing");
- I guess the shortcuts were linked to the script you used before (BWS remembers scripts by their GUID) - didn't use that so far though.

Oh and I forgot to mention: the colour indications you wanted to see have to be set to "true" if you want the controlled parameters in BWS to show up coloured and follow your device. Here is an example function for device macros (could also be a mode for your script ;-) ), but it's basically the same for most parameters:

Code: Select all

function setMacroIndications(device, state){
   for(var i = 0; i < 8; i++ ){
      device.getMacro(i).getAmount().setIndication(state);
   }
}
Cheers,

Tom
"Out beyond the ideas of wrongdoing and rightdoing, there is a field. I’ll meet you there." · Rumi
UrbanFlow.art · Instagram · YouTube

Post

I remember talking with you about the BCR2000's sysex that is currently being sold to turn it into a standalone hardware sequencer and you had explained that it would probably be possible to do what it could do with Bitwig's controller scripting. That's when my interest in controller scripting started, for sure. However, not knowing the BCR2000's capabilities too well, I decided to veer my attention there at the time. I'm very happy that I finally had the opportunity and time to test the waters this first script, though!

If you don't have BCR2000, I'd strongly suggest obtaining one. If you have one or end up obtaining one, I also suggest using an app called "BC Manager" (http://mountainutilities.eu/bcmanager) to program it rather than the software provided by Behringer. It makes the task of programming 32 pages of 32 rotary controls and 32 buttons (actually, it's a bit more because 8 of those rotary and buttons can alternate between 4 different presets per page) a much less daunting procedure. My favorite feature would be that it enables you apply any type of change (small or large) to all selected objects/controls in an instant.

Anyway, thanks again for the guidance with controller scripting! I'll probably be visiting this subforum quite often from now on and may have a question or two in the future, if you don't mind. I know you don't work for Bitwig anymore, so I promise not to get angry if you don't reply :ud: ...

... though I do truly appreciate when you do!! :D

Post

It was actually a happy accident that I saw your post in the side bar, I'm no longer as active on KVR as I used to, since I once again work mainly in 3D nowadays ;-)
ATM I'm diving headlong into SideFX Houdini: http://www.screendream.de/design/generativa/

I don't have a BCR but a BCF - which has partly broken rotaries - and I never use it. Funny enough, I'm not really much of a controller person myself, although I found the scripting side quite interesting, at least in the cases where the manufacturer don't cripple their devices on purpose or try to be extra clever (= crippling them even worse ;-) ).

As for the sequencers script: the only thing you have to be aware of is, that the controller JavaScripts aren't 100% timing accurate. Not a problem for most normal modulation but not good enough for sequencing, since there isn't a way to sync things to BWS.

People like you are actually the most fun to help, since you only need some hints and can go from there on your own - that's basically how I myself operate as well. It's a bit more problematic with people who basically need the script written for them since they don't understand the concepts - that's more of a job in it's own right.

It's also a good idea to look at other existing scripts, maybe not the really huge ones like Moss' Push script, since that's rather overwhelming, but small or medium scripts from the factory or user library can be helpful to figure out things.

I wish you a lot of fun on your journey! ;-)

Cheers,

Tom
"Out beyond the ideas of wrongdoing and rightdoing, there is a field. I’ll meet you there." · Rumi
UrbanFlow.art · Instagram · YouTube

Post

I guess it helps that I was scripting at 14 yrs of age (in mIRC, which at the time I had no idea that I was actually coding). I had made a theme script for all incoming messages and a file server script with unlimited triggers. Don't know how efficient it was as it searched through a .ini file on every message received :P .... I hope that the .ini file was in RAM because disk usage would have been the worst.

Anyway, thanks again and thanks for the good wishes!

Post

I got a BCR2000, any help to make it work with 16 or 24 knobs at the same time?? Im not a scripting guy so I dont understand much of that.

Post Reply

Return to “Controller Scripting”