Menu issue: Menus reset when 2nd version of client loads & selects certain menus

Issue explanation: When I load the GUI (or any initial client) for the below JSON, it loads with the correct defaults for each menu and with all connected buttons in the 'off' position (each button-looking widget with a play/stop button underneath is a vertical menu; each is currently loaded to its default 'value').

When loading the GUI in an additional client, it immediately loads with all menu items reset and with all buttons in the 'on' position except for ONE menu:

When changing the menu values in any of these, it resets and clears out the initial client's menus and turns all buttons to the 'on' position:
The second client:


The initial client:

When I reset the initial client, it returns to normal:

It's odd because it seems every other widget I have operates as normal when being accessed from multiple clients on the same server — the xy_fader, the buttons, the knobs on the right all behave the same. But menus seem to be the ones affected here.

The buttons below the menus are also behaving correctly, as from the help I received from @ClelsonLopes to add this to their scripting field:

setTimeout(() => set('"button_below_this_menu"', 127))

Any ideas why the menus should be behaving so erratically?

This also appears in the launcher console:

(ERROR, MIDI) Traceback (most recent call last):
  File "midi.py", line 268, in 
  File "midi.py", line 231, in send_midi
  File "midi.py", line 231, in 
TypeError: type str doesn't define __round__ method
(ERROR, MIDI) Traceback (most recent call last):
  File "midi.py", line 268, in 
  File "midi.py", line 235, in send_midi
IndexError: list index out of range

Here's a simplified version of this session:
clearing_menu_demo.json (211.7 KB)

Thanks in advance for any help you can provide!

The problem is that all your menu widgets have the same address/preArgs, which make them sync accross clients (General mechanics - Open Stage Control). Simply give them different addresses or preArgs, or set their bypass property to true.

2 Likes

Thanks so much @jean-emmanuel !

Almost there!! I've cleared the address & target fields:
Screen Shot 2022-06-05 at 9.14.47 AM

However the issue I still face is that when loading a second client, the play/stop buttons automatically toggle to the 'on' position. Everything works perfectly in every other way — when I change menu values they sync between clients, when I toggle the play/stop buttons they stay synced between clients, but unfortunately if a second client loads, it kind of 'breaks' things because the buttons are set as 'on' in the second client but remain in the 'off' position in the initial client. I would like for the second client to load in the exact way the first client is loading.

When I tried setting bypass to true it made it so that the menu values don't remain synced across clients, so that didn't work.

Would it be better to keep the bypass property to true but make unique addresses/preArgs for each menu? EDIT: Nope, tried doing this and the same issue mentioned above occurred where the menu value no longer syncs across clients.

Any idea how I might achieve this? Thanks so much for your help so far!

Ahh I didn't get it exactly right, no matter what address you set, the widgets will sync accross client (unless bypass is true), thus triggering their scripts. For now I can't think of a solution, but I could add a way to make the onValue script aware of what triggered its execution, this way you could simply add a condition like
if (!event.fromSync) set(...)`
to avoid tis kind of issues.

2 Likes

That would be awesome!!! Are you suggesting that would be something you could change in a new version of O-S-C? So there's no JS to do something similar at the moment, sounds like? Thank you!!

Are you suggesting that would be something you could change in a new version of O-S-C?

Yes. An alternative that would work now would be to move the menu's script logic to a custom module's oscOutFilter function so that it only runs when a message is sent by the widget (since it only happens upon user interaction client sync shouldn't mess with it).

1 Like

I'll happily wait — opening up the custom module world is a major can of worms and I'm scared! hahah :blush: Thanks so much :heart: