Custom browser - custom preset file format???
-
Battling a little with extension issues however.
@Christoph-Hart When saving a user preset am I stuck with the .preset extension??
-
@Christoph-Hart said in Custom browser - custom preset file format???:
@Orvillain said in Custom browser - custom preset file format???:
and no-one else really seems to have dove into this.
I have :)
No one else with the time to do a tutorial example ;-)
-
@Orvillain said in Custom browser - custom preset file format???:
and no-one else really seems to have dove into this.
I have too... :)
-
@Orvillain said in Custom browser - custom preset file format???:
No one else with the time to do a tutorial example ;-)
Seemed pretty trivial really - its just taking the values you have assigned to params of a given FX and encoding those with the FX name in a json object...
-
@Lindon said in Custom browser - custom preset file format???:
@Orvillain said in Custom browser - custom preset file format???:
No one else with the time to do a tutorial example ;-)
Seemed pretty trivial really - its just taking the values you have assigned to params of a given FX and encoding those with the FX name in a json object...
Cool, thanks for the help.
-
Here's a handy line:
FileSystem.getFolder(FileSystem.UserPresets).getChildFile("FXChains").getChildFile(PluginSharedData.lastSavedFXChainFileName).move(FileSystem.getFolder(FileSystem.UserPresets).getChildFile("FXChains").getChildFile(PluginSharedData.lastSavedFXChainFileName.replace(".preset", "")));I've got this in the post save callback. It's job is to take the FXchain file I just saved, and rename it to take off the .preset extension that HISE automatically adds whenever you use Engine.saveUserPreset command.
So now I can save two types of user preset: a global state preset, with a .preset extension... and an fxchain preset that collects module information for each of my FX slots, UI parameters, and bundles it all up into a .fxchain preset.
-
@Orvillain You can simplify your chain by including multiple directory levels in the
.getChildFilecalls. -
@David-Healey said in Custom browser - custom preset file format???:
@Orvillain You can simplify your chain by including multiple directory levels in the
.getChildFilecalls.Ohh, more like this I guess?
const base = FileSystem.getFolder(FileSystem.UserPresets); base.getChildFile("FXChains/" + PluginSharedData.lastSavedFXChainFileName) .move( base.getChildFile( "FXChains/" + PluginSharedData.lastSavedFXChainFileName.replace(".preset", "") ) );??
-
@Orvillain Yeah that's it! I'd break it up a little more to improve the readability and to remove some repetition.
const presetDir = FileSystem.getFolder(FileSystem.UserPresets); const filePath = "FXChains/" + pluginSharedData.lastSavedFXChainFileName; const file = presetDir.getChildFile(filePath); const target = presetDir.getChildFile(filePath.replace(".preset")); file.move(target);You could simplify it further by using
.renameinstead of.moveconst presetDir = FileSystem.getFolder(FileSystem.UserPresets); const file = presetDir.getChildFile("FXChains/" + pluginSharedData.lastSavedFXChainFileName); file.rename(file.toString(file.Filename).replace(".preset")); -
@David-Healey I'll implement that a bit later on. Right now I'm trying to figure out why when I load my fxchain "user preset" it peforms a full state reset!
updateSaveInPresetComponents
I think it is this call.... I'm willing to bet it has a default fallback mechanism where it resets controls to default, if it isn't specified in the data you feed it.
So I change my FXchain load mechanism to iterate over the components manually.