Can't find user preset?
-
Hi all,
I'm (more than likely) doing this wrong, can someone advise a newbie? I'm using the following code to load a preset via a button rather than using the preset browser. I have 2 presets in the UserPresets project folder, yet when I compile the script or click the button, I get an error that the preset file doesn't exist.
const var Button1 = Content.getComponent("Button1"); inline function onButton1Control(component, value) { Engine.loadUserPreset("two"); }; Content.getComponent("Button1").setControlCallback(onButton1Control);
-
Missing file extension perhaps -
.preset
? -
@d-healey I've tried that but Hise crashes, so I thought I was doing it wrong!
-
@paper_lung Looks like you need to provide the full (relative) file path or a file object
https://docs.hise.audio/scripting/scripting-api/engine/index.html#loaduserpreset
-
@d-healey Ok thanks - I've tried the following, but it's still saying it doesn't exist.
Engine.loadUserPreset("{PROJECT_FOLDER}UserPresets/two.preset");
-
@paper_lung What about just
/two.preset
? I'll test it myself when I'm at the computer. -
@d-healey Yeah I've tried that as well, but it still can't be found.
-
Here's an example project that shows how to do it.
-
@d-healey Thanks, this is very helpful. Am I correct that this is switching between 2 different presets? If I added more buttons and set them as the same radio group, what would I need to change? This way, only 1 preset/button would be active at a time.
-
@paper_lung Yes this was just a simple demonstration so button on = preset 1, button off = preset 2.
You can use whatever system you like for the UI, knobs, buttons, panels, menus.