How do I assign a midi controller fader to Master track volume?

MYMMYTH
KVRer
2 posts since 25 Sep, 2018

Post Tue Sep 25, 2018 1:59 am

AUTO-ADMIN: Non-MP3, WAV, OGG, SoundCloud, YouTube, Vimeo, Twitter and Facebook links in this post have been protected automatically. Once the member reaches 5 posts the links will function as normal.
Title says it.

I'm making a MIDI control script to use with Bitwig 2.4.

I have the functionality I want nailed-down already.
It works on any instrument track.
BUT, I've hit a wall.
How can I assign this function/physical fader to the Master track's volume?

Thank you in advance for any help.

- MYM.

Currently:

Code: Select all (#)

function initChannel() {
    trackBank = host.createMainTrackBank(1, 1, 1);

Code: Select all (#)

    trackBank.getChannel(0).volume().value().addValueObserver(function(volumeValue) {
        var LSB = (volumeValue * 16383) % 128;
        var MSB = (volumeValue * 16383) / 128;
        sendMidi(224, LSB, MSB);
    });

bassc
KVRer
8 posts since 11 Mar, 2014

Re: How do I assign a midi controller fader to Master track volume?

Post Tue Sep 25, 2018 12:53 pm

I'm quite new to this, but something like the following?

Code: Select all

masterTrack = host.createMasterTrackSection(0);
masterTrack.getVolume().addValueObserver( ... );

MYMMYTH
KVRer
2 posts since 25 Sep, 2018

Re: How do I assign a midi controller fader to Master track volume?

Post Tue Sep 25, 2018 8:10 pm

AUTO-ADMIN: Non-MP3, WAV, OGG, SoundCloud, YouTube, Vimeo, Twitter and Facebook links in this post have been protected automatically. Once the member reaches 5 posts the links will function as normal.
I had seen masterTrack in the Controller API Reference, but no amount of experimenting was getting it to work.

...Turns out I was applying it to the wrong code section [face palm]

'Lesson learned is to not try to solve such problems at 2am, but to get some sleep first.

Your solution worked perfectly. Thank you so much!

Functioning:

Code: Select all (#)

function initChannel() {
	masterTrack = host.createMasterTrackSection(0);
}

Code: Select all (#)

masterTrack.getVolume().value().set(data2 * 128 + data1, 16383);

bassc
KVRer
8 posts since 11 Mar, 2014

Re: How do I assign a midi controller fader to Master track volume?

Post Wed Sep 26, 2018 2:37 am

No worries. I have found the built in MCU controller js file to be a great reference point and that's where I grabbed it from for my script.

Return to “Controller Scripting”