Switch Labels Using OSC Listener

Hi,

Is this a bug, or is my formatting incorrect? v1.25.6 is the current version I'm using.

I have a switch with this set in the value.

#{{
  "^house-laptop": 0,
  "Harp": 1,
  "^chart-line": 2,
  "^drum": 3,
  "^map": 4,
  "AV": 5,
  "^sliders": 6,
  "PB": 7,
  "OSC{/dorico_connectionStatus_label, ^circle-xmark Dorico ^dorico}": 8
}}

However, look what is being outputted for the final value which includes the OSC Listener.

{
 "^house-laptop": 0,
 "Harp": 1,
 "^chart-line": 2,
 "^drum": 3,
 "^map": 4,
 "AV": 5,
 "^sliders": 6,
 "PB": 7,
 "__VARS.^circle-xmark Dorico ^dorico": 8
}

Cheers,
DMDComposer

In JS{} and #{}, the other advanced syntax blocks are seen as variables (not as the literal value stored) so this can't work, try this instead:

JS{
var values = {
  "^house-laptop": 0,
  "Harp": 1,
  "^chart-line": 2,
  "^drum": 3,
  "^map": 4,
  "AV": 5,
  "^sliders": 6,
  "PB": 7,
}
var extra_key = OSC{/dorico_connectionStatus_label} || '^circle-xmark Dorico ^dorico'

values[extra_key] = 8

return values
}
1 Like

Ahh, that makes sense now.

Your solution worked perfect too, thank you for the solution and explanation Jean!

Cheers!