Problem with buttons bound to Mixer channel selected

I’m actively working on a MIDI Remote API driver in JavaScript. I have assigned 8 buttons using hostMixerBankZone.makeMixerBankChannel( ).mValue.mSelected (I think I pasted that correctly, but could be a typo).
I have this mapping on two test pages. When I first press one of the buttons, Cubase does go to the appropriate channel. However, all of the 8 buttons on the GUI appear to go selected, lose their channel color, and no longer function.
If I use my mouse to select a track in Cubase, the appropriate button for that track is selected and all of the assigned buttons change to the correct color and also begin to function as expected. I can press them at will and Cubase selects the correct track.
If I move to a different page that is mapped the same way, the behavior repeats. First press goes to the correct Cubase track and the buttons again stop functioning. Same deal, press a new track in Cubase project, buttons function again until changing page.
I don’t know if it related at all, but I also notice that the console.log( ) I placed in the page mOnActivate callback is getting called TWICE for each page change.

By appearance of the behavior, it seems that the state machine is having issues on a page change on the first press of a button mapped to the mSelected action. Again, problem remains until I manually select a different track in Cubase, then returns to normal function as expected.

Update: This “first selection” problem is not unique to the buttons for selecting tracks.
If I manually select a track with the mouse in Cubase, the same symptoms occur in the driver. On a second selection, the buttons start working correctly, same as the original issue. Note the symptoms above are the same.


Do you use 2 MIDI Remote devices by any chance?

No, I’m working on a driver for the SL MK3. No other remote script active.
I also have an MCU, but it’s not enabled or powered at the time.
It seems to be an initial state issue but is repeatable upon changing driver pages.
At one point I had one page mapped to page and another mapped to subpage. I had assumed this is simply swapping in mapping tables, but could be a contributor. I’ve moved both to the page level and while slightly less confusing, similar behavior. The difference is that at the subpage level it seemed that I could get into a state where it would work fine across subpages, then occur again on a page switch. Clicking a track in Cubase seems to correct the issue until the next page change. Rinse, and repeat. :slight_smile:

To clarify, I have two pages, each with the same mapping, but not two devices.

This is on a Windows 11 PC, not a Mac.