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

Post Reply New Topic
RELATED
PRODUCTS

Post

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);
    });

Post

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

Code: Select all

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

Post

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);

Post

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.

Post Reply

Return to “Controller Scripting”