Intro to Controller Scripting - Bitwig Studio 1.0.x

Post Reply New Topic
RELATED
PRODUCTS

Post

Short: I don't know ;-)

Long: I wonder if it is supposed to work this way? My first impulse was, to have 6 Scripts where each one discovers one Device. At least that is how I did it with the virtual VMidi ports...
But I can see how it would make a lot of sense to do it all in one go.

Does any of the factory scripts discover multiple Devices?

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

Yep They do, but they don'y seem to get any info about the device.

It doesn't matter too much at the moment as the max number of NoteInputs you can have is 64, so mapping all my gear like this just isn't going to work, there are just too many channels and devices.

I emailed BW and Dom replied saying that they will look in the future at improving this side of BW, and may put in a small fix to up the count from 64 before that.

Post

ThomasHelzle wrote: 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.
Does this have anything to do with why CC64 (sustain) and other CC's don't record with external controllers? Using my MPK49 which has a built in script, you can't record the sustain pedal input. Do the scripts have to explicitly let it?

Post

I have no problem with Stuff like the ModWheel and other common Controllers, but the Sustain Pedal seems to get "translated" into long held notes instead of a proper CC64 Track. Try recording some notes....
That of course is totally crazy and needs to be changed.
There's quite a difference between a pressed Pedal and long notes as any piano player will confirm...
Maybe create a new topic if there isn't one already and make it into a bug report.
I reported it as well.

If you also have problems with other CCs, I'd report it to tech support too, but CC64 is the only one I'm aware of that is seriously broken/misinterpreted in BWS. You can always look into the script and see how it's constructed...

Cheers,

Tom

Edit: See laters posts for solutions for these problems. I was using my custom scripts for so long that I forgot the generic script behaviours... :oops:
Last edited by ThomasHelzle on Fri Apr 04, 2014 12:33 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

Thanks Tom, will try some more CC64 experiments this evening.

Post

There was a discussion about non-working CCs with external Hardware, and I think the solution fit's well into this thread, so I copied it below (Original Thread: http://www.kvraudio.com/forum/viewtopic ... 9&t=407828 )

There is indeed something "missing" in the factory scripts for use with hardware.

The Controller Scripts split the incoming Midi into two streams or layers. One serves instruments with notes and CCs etc. and the other is responsible for things like "Learn Controller Assignment" and the more nifty stuff controllers can do.

Somehow the factory scripts (as of v1.05) assume that stuff you use for GUI automation shouldn't go to the notes and the other way around, although that in practice isn't how people usually work IMHO - You may control a macro knob with the mod wheel in one project and use it for classical mod wheeling of a synth in another.

So in my LMK3 Script (Which is basically the same as the Generic Keyboard and can be used for any Keyboard, the name doesn't matter) there is one additional Line that makes all the difference:

Code: Select all

 Doepfer = host.getMidiInPort(0).createNoteInput("Doepfer LMK3", "?0????");
 Doepfer.setShouldConsumeEvents(false);
So the first change is, that the return value from the "createNoteInput" command is assigned to a variable ("Doepfer" in this case) that afterwards can be used to address that Note Input.
The second and most important change is the line that says that this Note Input shouldn't consume the events it's sending (by setting it to false), which basically means that events go to both the Midi and the GUI assignment stream/layer.

There actually is a third change: the generic script doesn't use a "Filter" after the Device name in the first line. If that is omitted, a generic selection of Note Data is sent through (it's somewhere in the Controller API docs if you want to know more).
Since I want ALL data to go through but only on Midi Channel 1 (I don't use anything else with the LMK3) I set the Filter pattern to all Questionmarks (which means "let through whatever comes in on this byte") but the second byte, which is set to 0, since that corresponds to Midi Channel 1 (it's a zero-based hex list going from 0 to f for the 16 possible values).
So if you would want to let everything through on all channels, you would set it to all Questionmarks.

I hope the Factory Scripts will be improved.

Cheers,

Tom
Last edited by ThomasHelzle on Wed Apr 02, 2014 3:29 pm, edited 2 times 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

I provide this script for the M-Audio Axiom series:

- it uses the transport section of the Axiom to stop/record/play/forward/rewind/loop.
- it uses the knobs S10 to S18 on the Axiom Pro 61 to select scenes 1 to 9
- filter is enabled to record aftertouch and controller messages (if the knobs on the Axiom are moved)

m-audio.rar
Last edited by 4damind on Wed Apr 02, 2014 3:30 pm, edited 1 time in total.

Post

I provide this script for the Nord Lead 2x series (usable for all Nord Leads)

- filter is enabled to record controller messages (if the knobs on the Nord Lead are moved)

clavia.rar

Post

4damind wrote:I provide this script for the M-Audio Axiom series:

- it uses the transport section of the Axiom to stop/record/play/forward/rewind/loop.
- it uses the knobs S10 to S18 on the Axiom Pro 61 to select scenes 1 to 9
- filter is enabled to record aftertouch and controller messages (if the knobs on the Axiom are moved)

m-audio.rar
Hi 4dsmind,
Thanks for your contribution.

I am sorry to say I cannot get it fully working.

At first I could get no response, so I took a look at your code and noticed there were no midi inputs.

I use Pro 49, so changed your line of code to (4,1) - 4 inputs, 1 output. This gave me the ability to play the keyboard; however, transport controls, sliders and knobs remain unusable.

When pressing S10, this does start playback in BWS; however, I am unable to stop playback except by clicking on the stop button in BWS.

Any ideas?

Thanks!

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

Post

dsan@mail.com wrote: Hi 4dsmind,
Thanks for your contribution.

I am sorry to say I cannot get it fully working.

At first I could get no response, so I took a look at your code and noticed there were no midi inputs.

I use Pro 49, so changed your line of code to (4,1) - 4 inputs, 1 output. This gave me the ability to play the keyboard; however, transport controls, sliders and knobs remain unusable.

When pressing S10, this does start playback in BWS; however, I am unable to stop playback except by clicking on the stop button in BWS.

Any ideas?

Thanks!

Happy Musiking!
dsan
This script is working here perfectly and it's using 1 output port because the Axiom doesn't receive data (to have it completely bidirectional working with faders and stuff, it needs more work).
Maybe there are different CC values between the Axiom series. You can enable the printMidi(status, data1, data2); line to see in the javascript console the output if you press this buttons. If the values are different you must change this in the script (and rename this script to Axiom Pro 49 and provide it).

[edit]
You are correct, the input was not enabled but the output :D
And I know why this script is working for me. It seems it's cached (also the settings of in/output) so it's very important to restart Bitwig, remove the controller and add it again... Anyway, I updated this script

Post

Greetings,

A working script for my Akai LPK25 :

http://linux-sound.org/misc/lpk25.control.js

Very basic but autodetects the keyboard and allows note events to reach BW. I can play the internal synths and record now. Please advise if you extend the script, I'd like to access more of the unit's features.

Best,

dp

Post

4damind wrote:...This script is working here perfectly and it's using 1 output port because the Axiom doesn't receive data (to have it completely bidirectional working with faders and stuff, it needs more work).
Maybe there are different CC values between the Axiom series. You can enable the printMidi(status, data1, data2); line to see in the javascript console the output if you press this buttons. If the values are different you must change this in the script (and rename this script to Axiom Pro 49 and provide it).

[edit]
You are correct, the input was not enabled but the output :D
And I know why this script is working for me. It seems it's cached (also the settings of in/output) so it's very important to restart Bitwig, remove the controller and add it again... Anyway, I updated this script
Thanks! I'll see what I can do with the code to get a Pro 49 working and provide a copy here if I can get it working. You have provided a good starting point. :tu:

I have successfully created and provided previously a script that will allow playing of the Pro 49 keyboard and MIDI "Learn" functions.

Your script is better as it negates having to use MIDI "Learn". Built in is better :D

Oddly, I noticed both your and my scripts have an identical unique identifier number. I thought that to be really strange. :shrug:

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

Post

dsan@mail.com wrote:Oddly, I noticed both your and my scripts have an identical unique identifier number.
That could be the problem. Each script really needs to use a UNIQUE IDENTIFIER, otherwise Bitwig may get confused. And it is so simple:
http://www.famkruithof.net/uuid/uuidgen
The page creates a new one on each load... ;-)

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:
dsan@mail.com wrote:Oddly, I noticed both your and my scripts have an identical unique identifier number.
That could be the problem. Each script really needs to use a UNIQUE IDENTIFIER, otherwise Bitwig may get confused. And it is so simple:
http://www.famkruithof.net/uuid/uuidgen
The page creates a new one on each load... ;-)

Cheers,

Tom
Yes - it has to be different for BWS to recognize they are different machines; otherwise when the code is executed BWS will only show the first one.

I think I know why they are identical :hihi:

Thanks Tom!

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

Post

Btw...
IMO after 1.0.5 something changed with automatic reloading of scripts? I remember with
1.0.4 I saw in the monitor that the script was reloaded after external changes, this is not working anymore?

Post Reply

Return to “Controller Scripting”