This almost works correct, but every so often when switching Cantabile sends the off event for the previous state after it sends the on event for currently selected state:
Edit:
After playing around it seems on song load it only has an on value, why would song states have an off value for a program change? Is that correct behavior?
If I understand your top picture you wouldn’t need the condition box filled in and the index itself would be the PG change number. example - index number = pg number like your binding but no toggle value because no condition to test. So you would have no double values to worry about this way. Also you would only need the one binding I think.
You are correct about the single binding with no toggle value. It does work. However I need to be able to specify a value. I showed a simple example above but I need to be able to set specific programs independent of state index.
In that case one idea that works is to use a loopback port to allow you to process the condition test to a single output value as shown in the picture. The state index of 0 sends a cc3 momentary switch to the loopback and it returns through the Main Keyboard input and triggers the desired PG change. I show 2 instances of it in the example.
You could use whatever CC numbers that you wanted. If you were going to do this a lot then I would make a special loopback port for it in options so there would be no chance of messing up the Main Keyboard input with unwanted CC switches.