Load JS via comboBox in UI
Hi guys, is there a way to load an external .js on runtime file via a comboBox ? On the following snippet Script1.js or Script2.js should be loaded into ScriptProcesor1. Any clue?
(just like loading a samplemap but for js)
I don't think what you want is possible. Tell me more about the goal you want to achieve and we can figure out the best way to do it.
@d-healey LOL! just following your directions about how to ask for help on forum. You said "Post a snippet"....... I posted a Snippet :P
What I want to do is to load large js code files (like 10.000 lines each case) allowing user to switch between them.
Those .js handles sinewave module data basically.
@hisefilo I edited my post before you replied, now only me and you know the secret ;)
Ah I get it. You can load JSON files into HISE so that might be a better solution. Another option which might work is to have the scripts pre-loaded into two MIDI processors and use the menu to bypass/unbypass them.
@d-healey yes! The bypass option was my first attempt. Initialization with 4 o 8 script processor with 10.000 lines each is a problem. Will investigate json thing
@hisefilo Another option is to use JSON objects in a separate file and include them in your main script. So there won't be any need for loading or bypassing, the data will just be available whenever you need it, and you combo box can enable the use of the correct data for the selected option. I use something like this for setting up articulations and sample maps for my multi instrument projects.
Yes this is the best option - put them into an .js file that will be included (and embedded) into the plugin - the other way requires your installer to put some js files at a certain location which is another source of issues.