Behringer BCF2000 script

Hi! I made my own script for BCF2000. Mostly it works ok. But i can’t figure out why it doesn’t load assignments for buttons which recalls mapping pages. But if I reload this script - it works as suspected. If anybody can help me to see a mistake in script - it would be great!

Script is attached.

BCF2000.zip (5,2 КБ)

Hi there, glad I see a script that tries to implement more than the usual suspects (mixer/Quick Controls) :slight_smile:

On to the issue:
You try to create pages twice, I guess it’s just a miss.
Here’s an example:

In line 438, you have:

makePageMixer()

This alone confuses the compiler, since a new page is generated but you don’t set it to a variable.
Then, in line 644, you have the correct assignment:

var Mixer = makePageMixer()

All in all, you should keep lines 644-648, where you properly define your pages, and delete the lines where a page is generated but it doesn’t get assigned to a variable. Talking about lines 438, 470, 489, 581 and 637.

I’ve tested here with removing the above lines, and the script will load correctly, i.e. with the proper page activation buttons in the mixer page shown.

1 Like

Wow!!! Thank you so much!!! Your answer is solved my problem! Thank you so much!
But i still have another issue with feedback to device. I can’t get feedback work for pages activation (lines 656, 659, 674, 677, 693, 696, etc).
I have a very initial skills in programming, so can’t find a solution myself.

I know :slight_smile:

The thing is that you have again, twice defined some functions.

Let’s check the mixer page mOnActivate.

You have at one point:

Mixer.mOnActivate = function (activeDevice) {
        midiOutput.sendMidi(activeDevice, [0x90,44,127]);
}

This is OK.

But then later on, you have:

Mixer.mOnActivate = function() {
    for(var i = 0; i < 8; ++i) {
    makeEncoderPanFeedback(pushEncoders[i],0x30+i)
    }
}

Again, the compiler can be confused. So, you should really merge your commands in one function and remove the other. I think you should keep the first one.

Now, the second one is not something I like. I’m pretty sure you’ve copied/pasted this to some extent, but it’s not OK for the compiler. Totally delete the second code segment mentioned above. Concerning feedback for the encoders, you can create a new function that can send the necessary midi messages, based on the currently selected page. I can help you with this too, once you explain to me a bit, why you need these different feedback values.

For example, I see in the mixer page you want a pan (?) feedback and I see this:

newValue=newValue*10.99+17;

Then, in the EQ page, I see a makeEncoderSpreadFeedback function, where you have this:

newValue=newValue*5.99+49;

I understand that you somehow try to normalize values here, but I really want more details.

I need a different feedback values to make possible a correct indication of a current value for a different pages. BCF2000 uses MCU protocol in this case, and I want to set encoder LED rings to a different modes for a different page applications (for example, “spread” mode for an EQ Q, “pan” mode for a mixer PAN) I assigned all these modes in lines 232-273.
MCU protocol uses the same CC number for all of these indication types, and it splits the entire CC values range to a few sub-ranges. For example, CC value range 17-28 is a “pan” mode, CC values range 49-55 is a “spread” mode.

So anyway this part currently works OK.

As I’ve mentioned earlier, you have two mOnActivate for each page. If you feel that the feedback for the ring leds parts work OK, that’s fine (though I still know that this is not the proper way to do it, and eventually if the compiler for whatever reason gets updated, there will be problems), so just merge the parts of the two mOnActivate into one. This way, the feedback for the pages activation should work too. And use the proper arguments for the function (In one you are OK):

yourPage.mOnActivate=function(activeDevice,activeMapping){

}

And again you help me a lot!!! Thank you!!! You the best)))

Currently it works almost great.

I have yet some issues regarding feedback. Can I ask you about them later?

Certainly. Be sure to tag me though in order to get notifired, cause I’ve just found your post accidentally.

Thank you!
Mostly, the only problem I have now, is that unassigned encoders at some pages, and their feedback (LED rings) doesn’t work as I suspect. When I switch from a page where all the encoders are assigned to a page where some encoders unassigned, then unassigned encoders LEDs shows the recent value (from a recent page) . And i do not know how to make them “blank”.
I understand that I need to send a constant midi CC values on page activation, but don’t know how to implement this in code.

Inside your mOnActivate function of your pages you can initially send the “reset” midi messages:

yourPage.mOnActivate(activeDevice,activeMapping){

   //initially send the reset messages
   yourMIDIOuput.sendMIDI(activeDevice,yourMIDIMessageArray)
   yourMIDIOuput.sendMIDI(activeDevice,anotherMIDIMessageArray)
   //.....

   //proceed with the rest of the code in this function

}

Your solution helped a lot. Currently all works as expected. The only thing I do not know how to implement - while I’m at a mixer page and have less than 8 channels - the unused channels LED rings still shows a nonexistent value. I understand that this happens because I still have a feedback for these channels, but I do not know how to reset these channels LED rings automatically if there are no channels in cubase mixer for them.

There is an event, the mOnColorChange for the channels of a mixer bank zone, that when triggered, except for the color variables, it also exposes whether a track is active or not. This means that if a track is disabled OR there’s no track at all at the bank zone position, this property will be false.

Here’s a snippet:

var mapping=deviceDriver.mMapping

var page=mapping.makePage("just a page")

var mixConsoleBankZone=page.mHostAccess.mMixConsole.makeMixerBankZone("zone")
mixConsoleBankZone.excludeInputChannels()
mixConsoleBankZone.excludeOutputChannels()

for(var i=0;i<8;i++){

    var channel=mixConsoleBankZone.makeMixerBankChannel()

    channel.mOnColorChange=function(activeDevice,activeMapping,r,g,b,a,isActive){
 
        console.log("channel "+this.i+" active="+isActive)
        //isActive will be false when a track is disabled OR when the particular slot of the mixConsoleBankZone is empty
 
    }.bind({i})

}

Thank you for this snippet!
But I still can’t understand how to use “isActive” value in my script…

Hello ! Unfortunately I have absolutely no clue about the programming . But I recently upgraded from Cubase 11 to 14 and I have a BCF2000 . Would you mind uploading an updated version with the changes that were described above ? I would really like to try that instead of the Mackie control way .BTW : In which BCF mode ( bC , MC C , LC … ) does the BCF to be operated for the script to work ? Thank you very much

Yes, of course! Script is attached.
Behringer_BCF2000.zip (4,7 КБ)

MC C mode.

Thank you very much !