only when plugin is visible?
-
@d-healey the simple gains got everything sorted!
I did this to manage the eprom selection with the button colums
function onControl(control, value) { if (snareProms.contains(control)) { var index = snareProms.indexOf(control); for(e in snareProms) e.setValue( e == control); Console.print(snareMaps[index]); } }
there's the same problem with the controls all being triggered onInit unless I make them not a preset parameter. If I replace the console output with loading the samplemap the plugin get a bunch of commands to load maps at once, would that bother the sampler or be a performance problem? as I understand it the map is just parameters and the sampler lazy loads the samples anyways after it has read the map... however, setting an initial selection doesnt work that way again.
is there a workaround to have my selections saved in a preset that still works?
-
@Morphoice control callbacks should be inline functions and there you can use local instead of var.
-
@d-healey stops working when I make it an inline function
this is the general onControl function if you go to Callbacks>onControl
not something I put in onInit script -
@d-healey I'm just reading this https://docs.hise.audio/scripting/scripting-in-hise/javascript.html#variables so I guess I should declare my loop and index variables in onInit and get it out of the function
-
@d-healey or in that case maybe avoid them completely by doing
if (bassProms.contains(control)) { for(e in bassProms) e.setValue( e == control); Bass.asSampler().loadSampleMap(bassMaps[bassProms.indexOf(control)]); }
that works too
-
@Morphoice said in only when plugin is visible?:
you go to Callbacks>onControl
Don't use that, it's long deprecated. Assign individual callbacks to each control.
-
@d-healey ah damn. that would be a lot of controls given the number of buttons to pick the soudns
-
@Morphoice you can apply the same callback to multiple controls in a loop
-
@d-healey funny enough I've been doing that from the start, then discovered the onControl function and though "great, that new feature saves me a lot of code" and moved it all there