Roland JD-08 - 4 buttons using same CC code

I'm trying to write a GUI controller for the Roland JD-08 and I have come across a problem.

The JD-08 uses CC 111 to enable/disable each of the 4 Tone Bank layers by bit masking 4 buttons (Tone A = bit 0, Tone B = bit 1, Tone C = bit 2 and Tone D = bit 3). I have coded the GUI so the 4 button 'On' values are the same as the bit position (1,2,4 & 8).

To enable Tones B & D you would send MIDI Channel, 111, 10 to the JD-08. Likewise selecting Tone A only on the JD-08 would send MIDI Channel number, 111, 1 from the JD-08.

To try and get this to work I set up a variable to behave like a conventional bit register updated by the incoming MIDI and its 'onValue' routine then updates the 4 button states in the GUI by bit masking with the new CC 111 value and setting the button state to match. This works OK and responds correctly to the data incoming from the JD-08 - the button states change as expected.

For a GUI button press, an 'onValue' event is sent from the button clicked to the bit register variable with an XOR toggle with the previous value. The bit register appears to send out the correct MIDI CC 111 xxxx value to the JD-08. The 'onValue' event should then update all the button states as above, but this does not happen. All the buttons update correctly except for the one that generated the event. It only gets correctly updated when a second event is triggered by another subsequent button press causing a new 'onValue' event.

Is there some 'safety' feature that prevents the event originator from receiving an update in its own event loop? If so, is there a way around this?

All suggestions gratefully received.

There are some guards to prevent infinite loops but in this case it should work, could you please upload your session file so that I can test it ?

Thanks for the offer to look, family matters have intervened so it's going to have to be put aside for a few days or so. I might have a look at a custom module to intercept the messages and map the bit state values to a composite value and vice versa.

Thanks for the effort you are putting into this software, much appreciated.