Widget visibility based on another widget's value

hi

I was wondering if anyone can help me on this new issue that i have. ( UPDATE: btw it's v1.25.5 )

I'm trying to make a series of menu widgets visible/invisible based on a text widget's value. (the text widget is not mandatory, i can change it to variable/script widget if it helps)

the text gets its value from Cubase when i select a new track and it is a midi cc message via generic remote. ( i use this to change several menu's visibility for expression maps)

https://openstagecontrol.discourse.group/t/any-update-on-widget-variables/2147/3

after i read this post i did the same thing but the menu just disappears, but the text's value has properly changed:


in this case, text widget receives cc1 with value 127 on channel 7.

menu widget :
menu visibility variable

text syntax :
text code

At first sight I see 2 issues:

if (Array.isArray(value) && value[0] === 1 && value[1] === 127)
  • if value is expected to be an array value === 1 and value ===0 will always be false.

hi
what if instead of value === [1, 127] i put a string like value === "piano fx" , does that work ?
I did that and it doesn't work at all.

update: now the text gets its value (track name) from custom module sent via Mackie control when i select a new track in Cubase. ( i use this to change several menu's visibility that contain expression maps)

it worked for the first track but it has strange behavior for the other tracks. here is my code:

if (value === "piano fx") {
    setVar ('pianofxmenu' , 'my_visibility' , value = true)
} else {
  setVar ('pianofxmenu' , 'my_visibility' , value = false)
}

this works but other tracks with the same code don't work.
also, I checked everything else, the text gets value correctly as expected for every track.

Passing an assignment expression (value=true) as argument for a function call is not something I'd recommend, it doesn't look javascript-ish, passing true (although what you wrote happens to work).
Besides this I fail to guess the issue, what's your o-s-c version exactly ?

Hi
I did some changes and it worked . I use the latest version of OSC .