Solved Add Module State to User Preset - Help!
-
I am getting some inconsistent behaviour from the
Engine.addModuleStateToUserPreset
. I am using it to save the FX network I have loaded into my hardcoded FX. I have this same exact code in another project and it works fine. However, in my new project, for some reason it will only save the state of FxSlot1, and not any of the others.I investigated other parts of my code but I haven't found anything which could be overriding this function, so I am a bit stumped as to why it won't save the network state (I also tried to save them individually but it also did not work).
const var SlotIdsPresets = ["FxSlot1", "FxSlot2", "FxSlot3", "FxSlot4", "FxSlot5", "FxSlot6", "FxSlot7", "FxSlot8", "FxSlot9", "FxSlot10", "FxSlot11", "FxSlot12"]; const var fxSlotConfigurations = []; for (i = 0; i < SlotIdsPresets.length; i++) { fxSlotConfigurations.push({ "ID": SlotIdsPresets[i], "RemovedProperties": ["bypass"], "RemovedChildElements": ["Modulator"] }); } // Function to add an effect slot to the user preset system function addFxSlotToPreset(slotConfig) { Engine.addModuleStateToUserPreset(slotConfig); } // Add each FX slot configuration to the user preset system for (i = 0; i < fxSlotConfigurations.length; i++) { addFxSlotToPreset(fxSlotConfigurations[i]); }
-
*Edit
It certainly has something to do with the specific project I am working on,Engine.addModuleStateToUserPreset
works fine as does the previous bit of code in other/new projects.*Edit 2
I removed (commented out) every script from my project and kept a simplified form of the script on the onInit. Still the issue persists so I am wondering if I need to look somewhere else? Some more details of the project is that I am using a FloatingTile Preset Browser with only 2 columns, I have EmbedUserPreset activated. I also have two copies of this same project (different folder locations).
-
@HISEnberg Found the solution to this and other odd behaviour I was experiencing after giving up and trying to build out my project. Started experiencing the "Sanity checked failed" , leading me to remove, and add back in all my hardcoded master FX. I suppose they continue to be quite sensitive to what version of HISE they are made with:
https://forum.hise.audio/topic/7752/can-t-find-effects-in-dll-sanity-check-failed/4
-
H HISEnberg has marked this topic as solved on
-
I suppose they continue to be quite sensitive to what version of HISE they are made with:
Yes, always use the exact same source code for compiling HISE, the FX DLL and the exported plugin.
Maybe I need to think about adding some failsafe that prevents HISE from compiling anything with another source code state than it was compiled (something like a counter that gets bumped with each commit and is embedded into the binary)...
-
@Christoph-Hart Yes a failsafe would have been great, I only really came across the solution here by chance and with how often HISE is updated I don't doubt I will be the last to experience this issue.
-
@Christoph-Hart Also I thought it would fix this other issue I am having but it seems to be related to something else.
I have a few FX networks that are modulation based (auto-panner, flanger, chorus, vibrato, etc.). These networks, compiled, work fine in other projects. However in this specific project, their modulation rates keep getting tossed to the maximum on every new note.
I really have no idea why (the ScriptFx works perfectly fine). Tracking their states in the Console shows them at the correct values. I removed any scripts I thought may be interefering with them. Are there any other modules (Midi, FX) or nodes in scriptnode that could cause this issue (maybe the converter, core.oscillator or temposync)?
-
H HISEnberg referenced this topic on