I modified the code handling messages from the Behringer CMD PL-1 to enable it to separately control VFO A and VFO B, and toggle between the two using one of the other buttons.
To set up the two VFOs (two wheels, really, as far as the SW is concerned) is a little different from how you normally do it for one – there is an order you have to follow. This is because you have to first set up the button for doing the A/B wheel mode switch and then exit MIDI setup and actually use it to change mode before going back and setting up the wheel again for VFOB. So, here’s how it goes:
Inside MIDI setup, press the button you want to use as the toggle function and name it as usual, choose “Button” and then choose the new function I added, which is all the way at the bottom of the list and is called “Toggle Wheel from VFOA to VFOB”. Save, hit OK, and exit MIDI setup.
Now that the toggle button is set up, you have to press it, once and only once, *outside the MIDI setup*, to change the wheel’s mode from A to B. Then you go back into MIDI setup with the wheel mode having been changed, and set up the wheel for changing VFOB – it will now appear to be a different wheel to MIDI setup (because its ID has changed). Spin left/right, name it, and choose Wheel as before for VFO A, but this time choose “Change Freq VFO B,” and save. Then you’re done.
This is all because while you’re inside the MIDI setup, the PL-1 controls don’t actually execute their respective commands – there is a completely separate MIDI message handler for the setup process. Thus, if you set up the AB switch button and then press it again without exiting setup, it just brings you back to setting up the button but does not execute the switch of the wheel from A to B mode.
I’ve thought about making a special case for the A/B switch function that allows the mode switch to execute within MIDI setup. But on second thought, the way it works now is logically consistent, even though it makes for a different setup sequence.