I've got a matrix of fader widgets that depend heavily on other variables. When I use advanced syntax to get the value of said variables, it seems to work, but the JS Console screams at me about undefined properties. I've looked at other similar topics, and still don't have clarity on whether or not the following script is allowed in a Matrix props field:
JS{{
const p = {}, colors = @{seq_colors}, column = parseInt($ / 4), rowInColumn = $ - (column * 4),
instruments = @{seq_instruments},
keys = Object.keys(instruments),
instrumentName = keys[column],
controls = instruments[instrumentName].controls,
controlNames = Object.keys(controls)
if(controlNames.length == rowInColumn){
p.interaction = false
p.visible = false
} else{
const controlName = Object.keys(controls)[rowInColumn],
controlNum = controls[controlName]
p.html = controlName
p.id = "seq_" + instrumentName + "_" + controlName
}
p.colorWidget = colors[column]
p.design="compact"
p.address = '/live/control'
p.css = `div.html{
z-index:-1;
font-size:2em;
position:absolute;
top:50%;
left:50%;
transform: translateX(-50%) translateY(-50%) rotate(-90deg);
opacity:.8;
}`
//Fader Bank Props
p.visible = true
p.interaction = true
return p
}}