Intro to Controller Scripting - Bitwig Studio 1.0.x

Post Reply New Topic
RELATED
PRODUCTS

Post

shadiradio wrote:Bill - are you sure? The user location works for me on OS X and Windows *but* I noticed that the location in the doc is wrong. Try "~/Documents/Bitwig Studio/Controller Scripts" instead of "~/Bitwig Studio/Controller Scripts" on Mac.
Thank you!

The path "~/Documents/Bitwig Studio/Controller Scripts" works.

Looks like that's a mistake in the scripting-guide.
Bitwig Certified Trainer

Post

Sorry, there was an error in the last version of the Arturia "The Laboratory" keyboard script.

Updated version here:

http://cl.ly/1Q141B2a2i2W/Arturia_The_L ... rol.js.zip

I've also updated the links in the other posts.
Bitwig Certified Trainer

Post

ThomasHelzle wrote: But if you save scripts in the user directory, it doesn't update automatically and you have to reload BWS, which isn't any fun. So while developing, I keep my scripts in the program directory and when finished, move them to the user directory.
You can type "restart" into the console and it will reload the script(s) from disk, even if they are in the user directory. no need to restart BWS.
Bitwig Certified Trainer

Post

Thanks for the tutorial Thomas! :tu:

Here's a script for M-Audio's Axiom Pro 49 Keyboard:
m-audio.rar
Unzip to your Bitwig Studio Location (usually C:\Program Files(x86) )\resources\controllers
Please reply back if it does/does not work for you. Thanks!

Enjoy!

Happy Musiking!
dsan

I should probably add - this works for playing the keyboard in a track w/vst loaded. I have not fully tested functionality; however, using BWS "Learn" I have been able to control track parameters (volume, pan). I assume other parameters to function likewise.
You do not have the required permissions to view the files attached to this post.
My DAW System:
W7, i5, x64, 8Gb Ram, Edirol FA-101

Post

Great stuff guys!
For the time being: this is the place I'd say.
Over time a central repository would be nice though. Not sure what the plans may be there...

You can also think about posting your scripts in the Bitwig Resources thread and update the same post each time you update the script, so users don't need to go hunting through the whole thread ;-)

Thanks everybody!

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

dsan@mail.com wrote:Thanks for the tutorial Thomas! :tu:

Here's a script for M-Audio's Axiom Pro 49 Keyboard:
m-audio.rar
Unzip to your Bitwig Studio Location (usually C:\Program Files(x86) )\resources\controllers
Please reply back if it does/does not work for you. Thanks!

Enjoy!

Happy Musiking!
dsan

I should probably add - this works for playing the keyboard in a track w/vst loaded. I have not fully tested functionality; however, using BWS "Learn" I have been able to control track parameters (volume, pan). I assume other parameters to function likewise.
I tried it with my Axiom 61 - it works as far as playing the keyboard - but mod and pitch bend does not work. Any ideas how I could make this work?

Thanks for the patch!

Cheers,
Klaus

Post

Xerxes: There is something special about Pitch Bend in Bitwig. In the inspector for the track, there is a switch called "Convert Pitch-bend". I tried through the beta to get this to be disabled by default, but it isn't.
What it does it converting normal Pitch Bend to per-note-pitch-expression.
Since this only works for the factory instruments ATM, I don't think it's a good idea to have it as the default, because it prevents all VSTs to work with normal Pitch Bend.
So try if it works when you disable that checkbox...
Not sure what the problem with the other controllers may be.

Cheers,

Tom

Edit: This now (1.05) seems to detect if a factory instrument is used and only enable it in that case.
Last edited by ThomasHelzle on Wed Apr 02, 2014 3:02 pm, edited 1 time in total.
"Out beyond the ideas of wrongdoing and rightdoing, there is a field. I’ll meet you there." · Rumi
UrbanFlow.art · Instagram · YouTube

Post

ThomasHelzle wrote:Great stuff guys!
For the time being: this is the place I'd say.
Over time a central repository would be nice though. Not sure what the plans may be there...

You can also think about posting your scripts in the Bitwig Resources thread and update the same post each time you update the script, so users don't need to go hunting through the whole thread ;-)

Thanks everybody!

Cheers,

Tom
The linux version has no jackd midi keyboard connection,
so re-naming is useless for now. The input is rumoured to be fixed
in v1.03, but the website is in time-out mode, so I requested
download mirrors in another topic.
I'm trying hard to imagine a scenario where beta testers
could have missed this. :? A bit like a guitar without strings :hihi:

Post

Website works fast and snappy here?
But here's a direct link to 1.03 for Linux: http://packs.bitwig.com/downloads/bitwi ... -1.0.3.deb

I reported that bug actually with my Presonus Firebox. The plan was that I would bring it to their office so we could have a debugging session.
But then the device blew up (had it for ages) and so this didn't happen.
Shit happens...

Give them some time ;-)

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

ThomasHelzle wrote:Xerxes: There is something special about Pitch Bend in Bitwig. In the inspector for the track, there is a switch called "Convert Pitch-bend". I tried through the beta to get this to be disabled by default, but it isn't.
What it does it converting normal Pitch Bend to per-note-pitch-expression.
Since this only works for the factory instruments ATM, I don't think it's a good idea to have it as the default, because it prevents all VSTs to work with normal Pitch Bend.
So try if it works when you disable that checkbox...
Not sure what the problem with the other controllers may be.

Cheers,

Tom
Thomas,

You are a genious! All works now :) And yes, this should either be off by default, or an option in the settings.

Thank you!
Klaus

Post

xerxes[no] wrote:.......I tried it with my Axiom 61 - it works as far as playing the keyboard - but mod and pitch bend does not work. Any ideas how I could make this work?

Thanks for the patch!

Cheers,
Klaus
Klaus, glad to hear it works on your Axiom 61. Let me know if you need the name updated for your device.

Did you get mod wheel working ok?

Tom, thanks for the pitch bend info!

Happy Musiking!
dsan
My DAW System:
W7, i5, x64, 8Gb Ram, Edirol FA-101

Post

I had a user ask about the VMidi Script I posted in the Resources Thread and I think this could be helpful to more people (and even extended upon by others with more insight) so I post it here as well:

--------------------------

One thing that threw me off completely at the beginning was, that BWS internally has what I would call "Two Channels" for controller data.

The first is what is sent to internal instruments and VSTs and the second what is used for assigning Controllers to GUI elements and the deeper Controller integration.

The first "Channel" I would call the "Note Channel". It includes what we create for instance with a line like this in the VMidi 1 Script:

Code: Select all

VMidi1  = host.getMidiInPort(0).createNoteInput("VMidi 1 - Channel 1", "?0????");
VMidi2  = host.getMidiInPort(0).createNoteInput("VMidi 1 - Channel 2", "?1????");
VMidi3  = host.getMidiInPort(0).createNoteInput("VMidi 1 - Channel 3", "?2????");
...
We create a NoteInput, give it a name and assign a filter to it, in this case I let everything through but filter by Midi Channel, which happens to be the second byte. Check the script to see it for all the channels:
Toms CopperLan Controller Script for Bitwig Version 2

This data goes to the internal instruments and VSTs and includes all the usual data like Note On and Off with Velocity, ModWheel, PitchBend etc. This is also used by the modulation assignments inside for instance the PolySynth or Midi Learn INSIDE OF VSTS. So overall the part that you use to directly play an instrument.

Since this is filtered by Midi Channel, you have all CCs available for all 16 Channels separately (if your controller allows you to send them per-Channel). That should be plenty to go around...


Normally, everything that is being sent to the "Note Channel" is NOT sent to the GUI/Controller Channel.

To prevent that, I added for each Note Input the line:

Code: Select all

VMidi1.setShouldConsumeEvents(false);
VMidi2.setShouldConsumeEvents(false);
VMidi3.setShouldConsumeEvents(false);
...
This command tells the Note Input to NOT consume the events but hand them on to the other areas of the script. In our case, this allows the VMidi Script to also assign CCs to Macro Knobs and other GUI elements which use the GUI/Controller Channel data.
But while this basically works, I so far haven't found a way to filter that part per Midi Channel. What we would need for that would be to know what Note Input is active at the moment, or in other words, which of the 16 Entries in the Dropdown the user has actually selected. so that we could filter for that in the OnMidi Callback.

One other thing in this script is the PolyphonicAftertouch:
With a line like this:

Code: Select all

VMidi1.assignPolyphonicAftertouchToExpression(0,   NoteExpression.TIMBRE_UP, 5);
VMidi2.assignPolyphonicAftertouchToExpression(1,   NoteExpression.TIMBRE_UP, 5);
VMidi3.assignPolyphonicAftertouchToExpression(2,   NoteExpression.TIMBRE_UP, 5);
...
We tell a specific Note Input on a specific Midi Channel to convert PolyAT to a Note Expression, in this case TIMBRE_UP (which means it's upwards going from 0 to 127) and over a range of 5 halftones (which I think is non-consequential for Timbre and may only be of relevance for PITCH).

This PolyAT situation is far from perfect IMO.
Since PolyAT is the only real per-Note-Expression already existing in Midi and widely available in good VSTs, I think there should be a direct Note Expression Lane for it. Everything else is only making things way more complicated than needed.
Timbre is only available for the internal instruments and even if there should be a way to re-translate it into PolyAT somehow, why go to such lengths for something that should be there by default in the first place ;-)

I guess I'm annoying the hell out of the Bitwig Developers with that one already ;-)


If anybody has an idea how to get at the information, which Channel is actually selected so that we can filter the GUI/Controller Channel by Midi Channel as well - I'm all ears!

And if you find out anything else interesting about the API, let us know!

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

Any chance of a script for Korg Taktile 49 support? or how do i go about making one myself?

Post

Sweet!!!!

Post

Hi Guys,

Has anyone worked out how to get hold of the device name in Init() when the devices have been discovered?

for instance I have:

Code: Select all

host.addDeviceNameBasedDiscoveryPair(["Cirklon Port 1"], ["Cirklon Port 1"]);
host.addDeviceNameBasedDiscoveryPair(["Cirklon Port 2"], ["Cirklon Port 2"]);
host.addDeviceNameBasedDiscoveryPair(["Cirklon Port 3"], ["Cirklon Port 3"]);
host.addDeviceNameBasedDiscoveryPair(["Cirklon Port 4"], ["Cirklon Port 4"]);
host.addDeviceNameBasedDiscoveryPair(["Cirklon Port 5"], ["Cirklon Port 5"]);
host.addDeviceNameBasedDiscoveryPair(["Cirklon Port 6"], ["Cirklon Port 6"]);
Then in the Init() I am creating multiple NoteInputs for each channel:

Code: Select all

function init()
{
  CK1  = host.getMidiInPort(0).createNoteInput("CK - Channel 1", "?0????");
  CK2  = host.getMidiInPort(0).createNoteInput("CK - Channel 2", "?1????");
  CK3  = host.getMidiInPort(0).createNoteInput("CK - Channel 3", "?2????");
  .......
}
I need to change that string so it is something like:

"Cirklon Port 1 - Channel 1"

For the life of me I cannot see any methods in the docs of how to get a device name.

Thanks

Andy

Post Reply

Return to “Controller Scripting”