saveInPreset vs custom prefFile vs what?
-
I have a problematic with something that should be simple...
- I have an oversampling knob, going from 2x to 16x (plus its on/off button).
- I don't want it to be save in presets for obvious (at least to me) reasons
So I write the value in a pref file and recall it upon load, easy peasy.
Now, when I have several instances in a DAW, they might require different OS factors. But when the DAW session load, all instances are loading the last OS factor saved in pref file (and even the OS on/off state which is even worse)...
No saveInPreset, No pref file possible, so what's left?
-
@ustk one option is to add a "oversampling lock" button that will prevent changing the oversample factor when loading presets. Then you make the oversample factor part of the user preset system and the people can engage that button if they want to use a "sticky" setting.
I would go for the pref file solution and live with the fact that multiple instances will share the same value - if an end user ends up having to distinguish the oversample factor across instances, it'll most likely be more efficient to set it to the highest setting and then bounce the track.
-
@Christoph-Hart The problem the 2nd solution is that the conflict happens between different DAW projects too so it's not a viable solution.
Solution 1 seems a good idea
-
@Christoph-Hart said in saveInPreset vs custom prefFile vs what?:
one option is to add a "oversampling lock
I think we solved this problem a while back with the is internal preset thingy in the preset handler
-
@d-healey I must explore this solution!
-
@ustk This is the discussion - https://forum.hise.audio/topic/6410/restoring-properties-with-daw-session/17?_=1754778579355
-
@d-healey I was right on it
I'll check more deeply tomorrow, but for now I don't see where knowing if it's DAW or not can allow to block a knob from being recalled. Unless using a trickery to save the prev value on preCB and restore on postCB... A bit dirty but why not...
-
@ustk Yeah if I remember correctly in the preload callback you check if it's an internal load, if it's not then you store the value of the control in a variable.
Then in the post callback you again do the check but this time you load the value from the variable.
-
Can we simulate a DAW session loading within Hise to test
isInternalPresetLoad()
?
I thought yes, but I've probably hallucinated...
Compiling and codesigning for this kind of test can be cumbersome -
What ever I try, saveInPreset enabled/disabled, use or don't use
isInternalPresetLoad
, I can't get this to work.
It either make the component to persist on preset load but not on DAW init, or the opposite, or nothing...I need to make the components persistent for both cases, preset load AND DAW recall.
my base structure is:
// will hold some parameters that need to be protected when a preset is loaded or the DAW loads the session const var protectedControls = [oversamplingBtn, oversamplingKnb]; const var protectedControlStates = []; //! Pre load CB uph.setPreCallback(function(presetFile) { // Protect the controls we don't want to see changing during user preset load AND DAW session load if (this.isInternalPresetLoad()) { for (i=0; i<protectedControls.length; i++) protectedControlStates[i] = protectedControls[i].getValue(); } }); //! Post load CB uph.setPostCallback(function(presetFile) { // Protect the controls we don't want to see changing during user preset load AND DAW session load if (this.isInternalPresetLoad()) { for (i=0; i<protectedControls.length; i++) { if (isDefined(protectedControlStates[i])) { protectedControls[i].setValue(protectedControlStates[i]); protectedControls[i].changed(); } } } });
I also tried to "pre-save" the component values in
protectedControlStates
from their respective CBs.If anyone has a clue or even better, a snippet, that would be amazing
-
@ustk I'll try and make a snippet this evening if I have some time.
-
@d-healey Lovely
-
@ustk Here ya go
HiseSnippet 1335.3ocsWEtaaaCDlxMJaVcaccnO.Z4GENCAA1IwIEqXHINIt0nMsFwocCnXnfVjxhvRjFhTIwMK.CC6AXOB6IX.6IX6oX+X+quA6e6mcGojkjSbSaMvzORBuu638wi2c7R2XgGUJEwHKmiGOhhr9D6di4pf8BvLNpy9HqEsUznQnViGgkRJAYYciGnwrpt.x78Oa2BGh4dzBQHzyELO5iYQLUgzt67HVXXaLgdLKpj1arSGOAeOQnHA3wMrqiFg8FhGPeBVqVEazCwx.j0WYiWqAcMRy9qu0VM8o0a1rNsYispi2zu9FD+6sYy062uAgtIv5CHLkHtmBqnRXSaIHi6EHNkm5fmyjr9gT8hFndfmSEi1KfER5NInHQHqE5VDhtQZH5N1GxHrb4EgpO2.3VXQ4flUkqiRM9.njUIJsPJktscOuX1HUAhlO2ztCWQi8wvcSYpjpKpBoh8dBPCtZ0H7PZ6XXQtE01rd8Ubger78cbhoCbGxE8eNNLgBqg6Kox8QfjFtei6jMY.UsmHZjfCKpsjAcoky0NYT.n6A7ALNcUuXJDFdljF2MlJopGh4jPZbMs5fhqBh.f8vgg8gbgZ9IbOESvqMxn89XEdYmyq5Tk46V6KUAL4pLog5bbX5N9XAlTa4kcpVMm3f6MjRSTi.s6tnrKER0aymsYgTvmNUOAG6V3LXOuF2eemIb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eP4dQO0
-
@d-healey Thanks Dave! I thought this was it. It holds for DAW session recall but not for preset change strangely, despite it works in Hise. Tried with ProTools and Live
-
-
@d-healey In fact the logic is not hard, it should never change the parameters, whether it’s a preset change or DAW session load.
So since in both cases the pre and post CB are called, it should always protect the parameters. But it’s not happening for some reasons…Have you tried to build and test with a DAW?Oh you tried already…
Yes I have set a default preset -
@d-healey said in saveInPreset vs custom prefFile vs what?:
Does Live use VST3?
Yes, and I tried with AU too
I'm building again in case I've made a mistake -
@ustk said in saveInPreset vs custom prefFile vs what?:
Yes I have set a default preset
Restoring properties with DAW session
Mystery solved. I had a default preset set in project preferences. This completely breaks the save in DAW behaviour. Removing the default preset solves the i...
Forum (forum.hise.audio)
-
@d-healey Oh what what what?
Seems not to be an ideal behaviour though...Starting again and report
-
@ustk Alright so after removing the initial preset I still have the same behaviour (protected with presets but not with DAW load)
I'll try again tomorrow with a fresh mind... Thanks, Dave!