Using Behringer BFC2000 with Multiple Rackspace with a select switch

Good job @Yann !

One comment: the “Elsif” conditions you have in each widget changed callback aren’t doing anything, as you immediately follow it with “End”.

Also, your function calls to change presets will occur on both widget activation AND deactivation. I’m assuming you intended to put this within the IF condition that’s checking that the widget was activated.

1 Like

Thank you rank13. I corrected these mistakes and it behave much better indeed. I also used David-san radio button script which works better I believe.Thanks David.
Now I have an issue. I created another (empty for now) Rackspace and when I go back and forth between the Rackspace the SyncBCF function does not work correctly and my faders are all changed to value 127. It’s likely my misunderstanding of basics. What happens with the variables when I switch Rackspace.

BCF2000_Mixers(12.3).gig (1.0 MB)

//$<AutoDeclare>
// DO NOT EDIT THIS SECTION MANUALLY
Var
   MIXA : PluginBlock
   MIXB : PluginBlock
   BCF2000_Out : MidiOutBlock
   CH_A1_Volume : Widget
   CH_A2_Volume : Widget
   CH_A3_Volume : Widget
   CH_A4_Volume : Widget
   CH_A5_Volume : Widget
   CH_A6_Volume : Widget
   CH_A7_Volume : Widget
   CH_A8_Volume : Widget
   CH_A1_Pan : Widget
   CH_A2_Pan : Widget
   CH_A3_Pan : Widget
   CH_A4_Pan : Widget
   CH_A5_Pan : Widget
   CH_A6_Pan : Widget
   CH_A7_Pan : Widget
   CH_A8_Pan : Widget
   CH_A1_Solo : Widget
   CH_A1_Mute : Widget
   CH_A2_Solo : Widget
   CH_A2_Mute : Widget
   CH_A3_Solo : Widget
   CH_A3_Mute : Widget
   CH_A4_Solo : Widget
   CH_A4_Mute : Widget
   CH_A5_Solo : Widget
   CH_A5_Mute : Widget
   CH_A6_Solo : Widget
   CH_A6_Mute : Widget
   CH_A7_Solo : Widget
   CH_A7_Mute : Widget
   CH_A8_Solo : Widget
   CH_A8_Mute : Widget
   Button_A : Widget
   Panel_Name: widget
   CH_B1_Volume : Widget
   CH_B2_Volume : Widget
   CH_B3_Volume : Widget
   CH_B4_Volume : Widget
   CH_B5_Volume : Widget
   CH_B6_Volume : Widget
   CH_B7_Volume : Widget
   CH_B8_Volume : Widget
   CH_B1_Pan : Widget
   CH_B2_Pan : Widget
   CH_B3_Pan : Widget
   CH_B4_Pan : Widget
   CH_B5_Pan : Widget
   CH_B6_Pan : Widget
   CH_B7_Pan : Widget
   CH_B8_Pan : Widget
   CH_B1_Solo : Widget
   CH_B1_Mute : Widget
   CH_B2_Solo : Widget
   CH_B2_Mute : Widget
   CH_B3_Solo : Widget
   CH_B3_Mute : Widget
   CH_B4_Solo : Widget
   CH_B4_Mute : Widget
   CH_B5_Solo : Widget
    CH_B5_Mute : Widget
    CH_B6_Solo : Widget
    CH_B6_Mute : Widget
    CH_B7_Solo : Widget
    CH_B7_Mute : Widget
    CH_B8_Solo : Widget
    CH_B8_Mute : Widget
    Button_B : Widget
    
 //Other Declarations
  
    CC_Array_A : widget array
    CC_Array_B : widget array
 
    buttons : widget array = [Button_A ,Button_B ]
    last : Integer // buffer variables to store the last pressed button
    
 Initialization
  var i : Integer
    CC_Array_A = [CH_A1_Volume,CH_A1_Solo,CH_A1_Mute,CH_A1_Pan,
                  CH_A2_Volume,CH_A2_Solo,CH_A2_Mute,CH_A2_Pan,
                  CH_A3_Volume,CH_A3_Solo,CH_A3_Mute,CH_A3_Pan,
                  CH_A4_Volume,CH_A4_Solo,CH_A4_Mute,CH_A4_Pan,
                  CH_A5_Volume,CH_A5_Solo,CH_A5_Mute,CH_A5_Pan,
                  CH_A6_Volume,CH_A6_Solo,CH_A6_Mute,CH_A6_Pan,
                  CH_A7_Volume,CH_A7_Solo,CH_A7_Mute,CH_A7_Pan,
                  CH_A8_Volume,CH_A8_Solo,CH_A8_Mute,CH_A8_Pan]
 
    CC_Array_B = [CH_B1_Volume,CH_B1_Solo,CH_B1_Mute,CH_B1_Pan,
                  CH_B2_Volume,CH_B2_Solo,CH_B2_Mute,CH_B2_Pan,
                  CH_B3_Volume,CH_B3_Solo,CH_B3_Mute,CH_B3_Pan,
                  CH_B4_Volume,CH_B4_Solo,CH_B4_Mute,CH_B4_Pan,
                  CH_B5_Volume,CH_B5_Solo,CH_B5_Mute,CH_B5_Pan,
                  CH_B6_Volume,CH_B6_Solo,CH_B6_Mute,CH_B6_Pan,
                  CH_B7_Volume,CH_B7_Solo,CH_B7_Mute,CH_B7_Pan,
                  CH_B8_Volume,CH_B8_Solo,CH_B8_Mute,CH_B8_Pan]
 
 //Check & store state of buttons - if all off, assume the first as "ON"
    For i = 0; i < Size(buttons); i = i + 1 Do
        If GetWidgetValue(buttons[i]) == 1.0 Then
            last = i
        Else
           last = 0
        End
    End
    
 End
 
 
 
 //Functions/////////////////////////////
 //Change Preset Function
 Function ChangePreset (Preset:integer)
 var SysexMsg : SysexMessage
     SysexMsg = # F0 00 20 32 00 14 22 00 F7;// Preset select sysex String
 
 SM_ChangeValue(SysexMsg, 7, Preset);//Change byte 7 to preset value
 SendSysexExternal(BCF2000_Out, SysexMsg);
 End
 
 //Synchronize BCF and Widgets Function
 Function SyncBCF (CC_Array : widget array)
 var x        : integer
     For x=0 ; x<32 ; x=x+1 Do 
       ResyncWidget(CC_Array[x]);
     End;
 End
 /////////////////////////////////////////
 
 
 On WidgetValueChanged(w : Widget, index: integer, newValue : double) from Button_A , Button_B 
     var i : integer
     if newValue == 1.0 and index <> last then
         // Deselect other buttons
      for i = 0; i < Size(buttons); i = i + 1 do
             if i <> index then SetWidgetValue(buttons[i],0.0) end
     End
      last = index
     end
     select last == 0 do
             SetWidgetLabel (Panel_Name, "MIX A")
             ChangePreset(0)
             SyncBCF (CC_Array_A)
            last == 1 do
             SetWidgetLabel (Panel_Name, "MIX B")
             ChangePreset(1)
             SyncBCF (CC_Array_B)
    End

//     Prevent a button to be switched off manually
   If newValue == 0.0 and index == last Then SetWidgetValue(buttons[index],1.0) End
End

The fader widgets in GP are changing, or the faders in the BFC2000?
I don’t have the controller, but when I switch to the empty rackspace and back, I don’t get that occurring.

Two comments:

  • Adding ‘Print’ functions at various points in your code is extremely helpful to check what is being called (these are output to the Script Logger window). I can see that every time you change your Preset, it’s actually calling the Sync function twice. This is because when you change the Mix A/B buttons, the Widget Changed callback is being called twice - once for the widget that is activated, and once for the other widget that is deactivated. My thought is that you need to move the “End” of your initial if newValue == 1.0 and index <> last then to just before your final IF statement to Prevent a button to be switched off manually.
  • The ‘Initialization’ section is only ever called once when your gig first loads. You may be better moving the section for Check & store state of buttons - if all off, assume the first as “ON” to a callback On Activate, which is called every time you switch to the rackspace.

Thanks rank13.
Actually it’s the Controller Faders that are changing not the widgets.
I will try your suggestions and come back with the results.
Thanks again.

Thanks ! Moving the end statement improved the behaviour and now the SyncBCF is not executed twice. I got it. It did not change the Rackspace switching issue though.

Now on the Rackspace switching issue what I can witness is that when I switch back to the “MIX A/B” Rackspace after switching to the second Rackspace, the Faders on my Controller are going back to the correct value for the last selected MIX (A or B). But then as soon as I press on of the two Buttons the Faders go to 127 values on the Controller and they stay stuck there whatever I select after.
If I switch again back and forth between the two Rackspaces then the same thing happens, the last selected MIX is correctly Synced. This only started to happen when I added the second Rackspace.
I hope my explanation is clear. If not I will thing of a better way to describe the behaviour

The second Rackspace is empty, I did not add any plugins not even the BCF2000_Out Midi plugin.

I did not try yet your second suggestion about using On Active Callback. I will soon