Hi,
I'm having a lot of trouble with trying to set up this dynamic matrix. If my approach is wrong feel free to correct me.
I'm trying to set up a matrix of dynamic faders that could be read from my custom module. I want to read data from a DAW and create some touchscreen matrix faders. I want to use a matrix so I can dynamically set the number of faders to correspond to the number of faders shown in the DAW in realtime (adding/subtracting).
I've learned now we can't make use of OSC listeners within the matrix props. However, I was thinking from reading previous posts on the forum that we could use local variables.
I've got a cloned fader matrix with the props listed below.
JS{
var props = {};
var labels = ["O FX 1", "O FX 2", "A Level", "B Level", "Low Cut", "Res", "Pan", "Level"];
var colors = ["orange", "orange", "pink", "pink", "aqua", "aqua", "grey", "red"];
// Ensure widgetId is correct
props.widgetId = "cntn_CLONE";
// Define nested properties
props.props = {
variables: {
text: VAR{faderLabel} || "NA_#{$}",
n: $ + 1,
def: $ * 2 + 50,
color: colors[$],
out: [1, 50 + $],
ctrl: [`ctrl ${50 + $}`],
},
};
return props;
}
Is it not possible to set the VAR{faderLabel
value from the custom module? I tried the following below in my custom module.
receive("/SCRIPT", `setVar("text_fader_1", "faderLabel", "${myValueFromCustomModuleHere}")`)
Strange enough, this works if I call the VAR from within OSC from another source using,
console.log("fader 1 label: " + getVar("text_fader_1","faderLabel"))
However, none of the fader labels actually get updated. Is this a bug, or my approach is wrong?