Set Panel.value in a ScriptProcessor with setAttribute
-
So it would be useful to be able to set the value of a panel in a ScriptProcessor, in the same manner we can with the other widgets,
so currently we can:
const var ScriptProcessor1 = Synth.getMidiProcessor("Script Processor1"); const var myValue = 1; ScriptProcessor1.setAttribute("myButton",myValue);
but we cant:
const var ScriptProcessor1 = Synth.getMidiProcessor("Script Processor1"); const var myObj = {"A":"B"}; ScriptProcessor1.setAttribute("myPanel",myObj);
If this was implemented we could pass arbitrary large "blobs" of data into ScriptProcessors - rather than have to wrangle them through sliderpacks, and thus we could have a valuable level of abstraction of Code from Display (MVC)
-
@Lindon
setAttribute()
goes through the HISE parameter API which truncates the value to a float number so this won't be possible.There's other methods of shuffling complex data around if you absolutely have to do this (global variables etc), but maybe there's a design change that prevents you from shuffling JSON objects around, which is always a good thing.
-
@Christoph-Hart said in Set Panel.value in a ScriptProcessor with setAttribute:
@Lindon
setAttribute()
goes through the HISE parameter API which truncates the value to a float number so this won't be possible.There's other methods of shuffling complex data around if you absolutely have to do this (global variables etc), but maybe there's a design change that prevents you from shuffling JSON objects around, which is always a good thing.
Sadly I cant think of how I could reduce this data set - its an ARP - 128 steps, each step has around 20 attributes - so I'm drawing the arp display in a panel, and letting the user modify it there, but now I'd like to get the data its generating out of the deferred UI thread, and into its own ScriptProcessor where I can do the actual note generation and modification...
More than willing to look at an alternate way --- I just cant think of one that captures this large data set and passes it into my processor... other than the dreaded Globals...
-
@Lindon yeah, use globals and the FixObjectArray as I've mentioned in the other thread, it's exactly what it's made for.