Intro to Controller Scripting - Bitwig Studio 1.0.x

RELATED
PRODUCTS

Post

@tor.helge: JS does "initialize" variables you don't give a value to "undefined" and var x = [] is just an empty array with no size and content, so if you want to make sure that everything already contains something sensible, I would actually initialize the array as you do. You don't have to though, just make sure you know exactly what you are doing if you don't. You can't access x[42] if you don't.

Be aware that JS has no block scope!The "i" you are declaring is always the same "i", be sure you want that.

Code: Select all

var i = "test"; // assign "test" to "i"
var i; // "i" still contains "test"...
JS has only function scope, and variables you declare with var in a function are "local", but without var they are global... :dog:

You could have one for loop and have both declarations for macro and knob values in it.

As for the value scaling: I think the problem is, if your faders are close to top or bottom there actually is hardly anything to interpolate and you get jumps again.
That's where the concept falls flat on it's face (and why the guy in the video puts his slider conveniently in the middle ;-) ).
But it's still much better than not having it.

Alternatively you could build a kind of limited/damped acceleration into it, where a value can never change faster than a certain amount per call until the actual fader value is reached, after which it would "connect" and go with whatever speed you move...

I'll have to try that idea out actually, could be a very nice way of bridging the gap for non-motorized faders etc.

As for the "automagical" part, yeah, that's what the observers do ;-)
But in a non-hard-linked way which prevents dropouts in the main engine since it has fully control over when it updates the values. Observers fill in the values once on init and then only if something changes. Same with the "set", it decides when to update the internal value, but other than a "get", it can do so on it's own convenience where a "get" would need to be served right away, which could lead to problems if for some reason used excessively.

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

astartes wrote:@Thomas: Your Script for TouchOSC is great. Big Thanks for this. Just tested it with your Layout and the one i´m working on. Works as expected.
I Ported your Layout to the size of an iPad and (for now) copied over one of the Pages you made to my Script (to get the correct mappings in the Editor). I´ll use your Controlscript for further Work if you don´t mind.
You are welcome, but I'm not finished yet... ;-)
I added colour coding to the sliders etc. since that is such an essential concept in BWS, changed rotaries to sliders since I personally find the handling of the rotaries in touchOSC not very usable and overall added a lot of other stuff to your concept that I personally would want in there...

Feel free to change whatever you like!

My basic goal is, to create a kind of template that can be used with other similar systems and that covers all the most used stuff, so that if you use the same CCs, it will work.

I could also imagine to abstract it some more over time so that the user can define the CCs used for controllers where they are hardwired.

Meta-Generic if you want ;-)

My goal is: No coding required for standard usage, leaving the API to those who enjoy it. :party:

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

Ok, now it's in a rather usable state:

TouchOSC for Bitwig:
https://github.com/ThomasHelzle/TouchOSC-Bitwig

Basic Layout and Idea by Astartes, Extended and Improved upon by Thomas Helzle (which is me ;-) ).

- Mixer Page with Transport Controls.
- Macro Page with Track- and Device Navigation, Preset Selection with Visual On-Screen Feedback.
- Device Mapping Page with Map Navigation.
- XY-Pad Page (for MIDI-learn, use the Setup Page).
- Drum Pad Page 4x4 with Velocity on Y-Axis and Transpose Buttons.
- Keyboard Page 1 Octave with Velocity on Y-Axis per Key and Transpose Buttons.
- Setup Page, ATM only used for XY-Pad MIDI-Learn.
- Two MIDI inputs, "TouchOSC Keys" & "TouchOSC Pads".
- Current Layout optimized for my Phone, 960 x 540px.

Enjoy!

Cheers,

Tom
Last edited by ThomasHelzle on Tue Jun 10, 2014 10:01 am, 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

As an Android owner of TouchOSC, I sincerely thank you for your deeds!

Post

edirol pcr-300
cleaned up the code a little, fixed some bugs, and a added a lot of new features.. it might not be very elegant code, i gues (i don't know javascript very well, learning as i go along), but it seems to work quite well.. at least for my usage..

Image

* play - start/pause playback
* stop - stops playback
* rew - rewind one bar
* rec - toggle record on/off
* upper 8 buttons select track 1-8
* upper button 9 selects master track
* upper 8 knobs are mapped to 8 macro controls in primary devide on current track
* lower 8 buttons controls currently selected track: mute, solo, record arm, stop clip, back to arrangeement
* 8 sliders controls volume of 8 first tracks in arrangement
* slider 9 is master volume
* lower button 9 (arr/mix) switches between mixer and arrangement views
* bank buttons (c1-3) act as shift buttons, and with one of these pressed, the knobs and button rows can be assigned individually (so you have 8*3 knobs, and (8*2)*3 buttons, to freely assign to anything)
* with the v-link button/light ('dynamic mapping') on, the value knob/wheel can be used to scroll through presets in the primary device in currently selected track, and also, you have four extra buttons available (the ones to the right of the value knob)

experimental: 'value scaling' is used for the knobs..

set the pcr-300 to use (the feault) control map #0
i'll try to upload it to github soon..
in the meanwhile: Edirol PCR-300.control.js

- tor-helge

Post

ThomasHelzle wrote:Ok, now it's in a rather usable state:

TouchOSC for Bitwig:
https://github.com/ThomasHelzle/TouchOSC-Bitwig

Basic Layout and Idea by Astartes, Extended and Improved upon by Thomas Helzle (which is me ;-) ).

- Mixer Page with Transport Controls.
- Macro Page with Track- and Device Navigation, Preset Selection with Visual On-Screen Feedback.
- Device Mapping Page with Map Navigation.
- XY-Pad Page (for MIDI-learn, use the Setup Page).
- Drum Pad Page 4x4 with Velocity on Y-Axis and Transpose Buttons.
- Keyboard Page 1 Octave with Velocity on Y-Axis per Key and Transpose Buttons.
- Setup Page, ATM only used for XY-Pad MIDI-Learn.
- Two MIDI inputs, "TouchOSC Keys" & "TouchOSC Pads".
- Current Layout optimized for my Phone, 960 x 540px.

Enjoy!

Cheers,

Tom
Updated, Cleaned-Up and heavily Commented now.

-> Added a Clip Launcher! ;-)
:party: :phones:

Image

Enjoy!

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

BitwigToProcessing

Remote Connection between Bitwig and Processing


https://github.com/ThomasHelzle/BitwigToProcessing

A basic example on how to directly connect via TCP either as client or server directly to Bitwig Studio via a Controller Script. It doesn't do anything interesting but sending a Ping and a Pong back and forth to show how the data needs to be formated.

This allows for a lot of interesting things:

- Directly interact with visual tools like Processing, Cinder, VJ-Software...
- Directly connect to mobile devices...
- Directly connect to advanced controllers...
- Directly connect to other computers in the network...

The data transport is done via byte arrays.
When you send data to Bitwig Studio, you need to first send a 32 bit integer (encoded as 4 bytes) with the lenght of the byte array to follow.

On top of that you can implement whatever data transfer you need...

Cheers,

Tom

P.S. There currently is a bug where ControllerScripts aren't correctly reloaded while using the RemoteConnection. If you find that this happens for you, you have to reload BitwigStudio. It's logged already.
"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:
astartes wrote:@Thomas: Your Script for TouchOSC is great. Big Thanks for this. Just tested it with your Layout and the one i´m working on. Works as expected.
I Ported your Layout to the size of an iPad and (for now) copied over one of the Pages you made to my Script (to get the correct mappings in the Editor). I´ll use your Controlscript for further Work if you don´t mind.
You are welcome, but I'm not finished yet... ;-)
I added colour coding to the sliders etc. since that is such an essential concept in BWS, changed rotaries to sliders since I personally find the handling of the rotaries in touchOSC not very usable and overall added a lot of other stuff to your concept that I personally would want in there...

Feel free to change whatever you like!

My basic goal is, to create a kind of template that can be used with other similar systems and that covers all the most used stuff, so that if you use the same CCs, it will work.

I could also imagine to abstract it some more over time so that the user can define the CCs used for controllers where they are hardwired.

Meta-Generic if you want ;-)

My goal is: No coding required for standard usage, leaving the API to those who enjoy it. :party:

Cheers,

Tom
Thomas, i did a quick test with your unchanged TouchOSC Layout and my LaunchControl.... you acieved your goal quite well. ;-)
All Mappings (as far as they can be set up on the LaunchControl) are working. I have atm with the TouchOSC Script realized on the LaunchControl (All Pages in Usermode):
Page1:
Top Row Encoders: Pan
Bottom Row Encoders: Volume
Buttons: Transport Control

Page2 (Set up like the Macros in Ableton:
Top Row Encoders 1-4/Botom Row Encoders 1-4: Device Macros (CCs 20-27)
Top Row Encoders 5-8/Bottom Row Encoders 5-8: Device Mappings
Buttons 5 and 6: Previous/Next Mapping

Arrow- Keys Up/Down: Previous/Next Device
Arrow Keys Left/Right: Previous/Next Track

Post

The Launch Control is on my list of Controllers to tackle so it's interesting to hear how you mapped it.
I guess I personally would go for having macros and mappings on full rows, so that the colour-coding would work the same as with track volume and pan if you attach the stickers to the controller, but your layout makes more sense for the macros...
I guess I have to think some more about what the best general layout may be.

But it's great to hear that you were able to bend the script to your will! ;-)
In 1.1 we will get Settings for Controller Scripts, which should open up some more doors...

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

How you map the Encoders is up to you, thanks to the LaunchControl editor that you can DL for free from the Novation site.

For now i have mapped my whole Setup with the Touch OSC Script. The Impulse 49 works with it as well. All Buttons/Faders/Encoders that are mappable react (made 2 Presets on my Impulse, one for Mixer Volume/Pan, the other one for the Devices). Only the Transport Control won´t work cause these Buttons are Hardmapped and not Changeble. But that´s a thing i can live with, i have the Transport-Control at Hand on the LaunchControl or on the Tablet. Cliplaunch from the Imulse also wont work atm (again not a big Prob for me as i rarly use it...i have my Launchpad or the Tablet for that purpose, depending on whats next to me)

Post

For the transport controls you could change the CCs in the script if you make a copy with a new UUID, you would just need to make sure you get no overlap with other functions or switch them around too.
Or does it use MMC?

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 wrote a tutorial quite a while ago when I released the Bidirectional Script and now was finally able to put it on my blog:

Bitwig Studio Tutorial 4: Observers
Bidirectional Communication with your Controller.


Image

http://blog.thomashelzle.de/2014/06/bit ... observers/

This one became rather long and involved. I not only try to explain this more confusing part of the API but also threw in some basic explanations on programming for those new to the matter or coming from other languages.
Let me know if there are things that need more explanation (or less) or stay unclear, I'll try to do better then.

Enjoy!

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

Short Update regarding the Impulse 49 from Novation:
As i mentioned earlyer, the Impulse works with the TouchOSC Script (Faders/Encoders mapped to the corrosponding CCs). As i found out today some of the Transport Buttons react to the script as well:
Stop/Play send values for previous/Next Track
Loop/Record send Values for Previous/Next Device.

For Now you can work with the Touch OSC Script as decribed above and mapp the Transport Comtrols to the buttons underneath the Faders:
Stop: CC 117
Restart: CC 113
Play: CC 118
Record: CC 119
Overdub: CC 114

Post

Here's an Oxygen 49 script which is working for me (couldn't find one anywhere). Putting it up here for people who might be struggling like I did as the Oxygen 25 script I found on github only the transport worked and Generic script with 8 knobs didn't work for me as the MIDI cc for the knobs weren't all in order.

I'm not great at Javascript and this took me an hour or two of struggle and there is a error message in the console "Cannot call method set to null" but it doesn't seem to affect usage, but script is basically a mishmash of scripts.

What's working (for me anyway): Keyboard, transport controls, track selector, first slider controls volume of selected track, 8 knobs assigned to macro control

https://mega.co.nz/#!BsEXQBSA!YD3ECCI3s ... 1AcZ2ufGr8

Post

hi guys, i was trying to use a korg nanokontrol 2 in bitwig. I've used the auto detect function and it was correctly recognized. The transport buttons work, but it seems that the track buttons (solo/mute/arm) and sliders do nothing. Anyone know how to get them working?

Post Reply

Return to “Controller Scripting”