Hi!
In order to retrieve text from the DAW into OSC I used a few examples of the forum and have a script widget with the following onValue script
locals.text = locals.text || Array(112).fill(" "); // persistent variable to store full text
var nValue = Number("@{parent.variables.n}"); // Replace this with the actual way to get the value in your environment
var targetString = "f0 00 01 06 02 12 0" + String(nValue - 1) + " 01";
if (value.includes(targetString)) {
var d = value.split(" ").slice(8).map(x => parseInt(x, 16)), // hex to int
pos = d[0], // first byte -> position
text = d.slice(1).map(x => String.fromCharCode(x)); // rest -> updated characters
text.pop(); // drop sysex closing byte
// update characters
for (var i = 0; i < 30; i++) {
locals.text[i + pos] = text[i]; // update
}
// update text widget
var currentText = locals.text.slice(0,56).join("") + "\n" + locals.text.slice(56).join("");
var lcdName = "lcd_" + String(nValue) + "_2";
set(lcdName, currentText);
}
updating a text widget (id:lcd_@{parent.variables.n}_2)
I was wondering if I can achieve the same purpose of displaying the daw text, but instead of updating a text widget, dynamically update the label of a button widget.
Thank you