HISE Logo Forum
    • Categories
    • Register
    • Login

    saveInPreset vs custom prefFile vs what?

    Scheduled Pinned Locked Moved Solved General Questions
    33 Posts 4 Posters 217 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ustkU
      ustk
      last edited by ustk

      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? 🤷

      Hise made me an F5 dude, browser just suffers...

      Christoph HartC 1 Reply Last reply Reply Quote 0
      • Christoph HartC
        Christoph Hart @ustk
        last edited by

        @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.

        ustkU d.healeyD 2 Replies Last reply Reply Quote 0
        • ustkU
          ustk @Christoph Hart
          last edited by

          @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 👍

          Hise made me an F5 dude, browser just suffers...

          1 Reply Last reply Reply Quote 0
          • d.healeyD
            d.healey @Christoph Hart
            last edited by

            @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

            Libre Wave - Freedom respecting instruments and effects
            My Patreon - HISE tutorials
            YouTube Channel - Public HISE tutorials

            ustkU 1 Reply Last reply Reply Quote 1
            • ustkU
              ustk @d.healey
              last edited by

              @d-healey I must explore this solution!

              Hise made me an F5 dude, browser just suffers...

              d.healeyD 1 Reply Last reply Reply Quote 0
              • d.healeyD
                d.healey @ustk
                last edited by

                @ustk This is the discussion - https://forum.hise.audio/topic/6410/restoring-properties-with-daw-session/17?_=1754778579355

                Libre Wave - Freedom respecting instruments and effects
                My Patreon - HISE tutorials
                YouTube Channel - Public HISE tutorials

                ustkU 1 Reply Last reply Reply Quote 1
                • ustkU
                  ustk @d.healey
                  last edited by

                  @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...

                  Hise made me an F5 dude, browser just suffers...

                  d.healeyD 1 Reply Last reply Reply Quote 0
                  • d.healeyD
                    d.healey @ustk
                    last edited by

                    @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.

                    Libre Wave - Freedom respecting instruments and effects
                    My Patreon - HISE tutorials
                    YouTube Channel - Public HISE tutorials

                    1 Reply Last reply Reply Quote 1
                    • ustkU
                      ustk
                      last edited by ustk

                      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 😬

                      Hise made me an F5 dude, browser just suffers...

                      1 Reply Last reply Reply Quote 0
                      • ustkU
                        ustk
                        last edited by

                        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 ☺

                        Hise made me an F5 dude, browser just suffers...

                        d.healeyD 2 Replies Last reply Reply Quote 0
                        • d.healeyD
                          d.healey @ustk
                          last edited by

                          @ustk I'll try and make a snippet this evening if I have some time.

                          Libre Wave - Freedom respecting instruments and effects
                          My Patreon - HISE tutorials
                          YouTube Channel - Public HISE tutorials

                          ustkU 1 Reply Last reply Reply Quote 1
                          • ustkU
                            ustk @d.healey
                            last edited by

                            @d-healey Lovely 😍

                            Hise made me an F5 dude, browser just suffers...

                            1 Reply Last reply Reply Quote 0
                            • d.healeyD
                              d.healey @ustk
                              last edited by

                              @ustk Here ya go

                              HiseSnippet 1335.3ocsWEtaaaCDlxMJaVcaccnO.Z4GENCAA1IwIEqXHINIt0nMsFwocCnXnfVjxhvRjFhTIwMK.CC6AXOB6IX.6IX6oX+X+quA6e6mcGojkjSbSaMvzORBuu638wi2c7R2XgGUJEwHKmiGOhhr9D6di4pf8BvLNpy9HqEsUznQnViGgkRJAYYciGnwrpt.x78Oa2BGh4dzBQHzyELO5iYQLUgzt67HVXXaLgdLKpj1arSGOAeOQnHA3wMrqiFg8FhGPeBVqVEazCwx.j0WYiWqAcMRy9qu0VM8o0a1rNsYispi2zu9FD+6sYy062uAgtIv5CHLkHtmBqnRXSaIHi6EHNkm5fmyjr9gT8hFndfmSEi1KfER5NInHQHqE5VDhtQZH5N1GxHrb4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KPmpCZ4ES+4OsS.kMH.JOssBrzidckIFfYUDjjPrZ5AXzi1kAn6vTdpA86WvsoZb4tHe.S0T+Zmp48kh21tKS4ELaNVYFbDZb++AGylE7SsOv2m5oJH3B1s+t4cvu2g6ORjnajdHF5UC8QsgZndPeNOJ3cNmFJ022UzsRSWWWuVGA5Q4Dyh2.eYfMzqsx.aLADdkvKV7RuzGL0Sa9wFI.m3lowqZends6zuTl9.CL76K87ldqthgqMuFt97Z3FyqgMmWC2bdMbq40v68tMT++lrahRDkV1fPG18.yqhVVGvwPFnIaE8eP4dQO0
                              

                              Libre Wave - Freedom respecting instruments and effects
                              My Patreon - HISE tutorials
                              YouTube Channel - Public HISE tutorials

                              ustkU 2 Replies Last reply Reply Quote 1
                              • ustkU
                                ustk @d.healey
                                last edited by

                                @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

                                Hise made me an F5 dude, browser just suffers...

                                d.healeyD 1 Reply Last reply Reply Quote 0
                                • d.healeyD
                                  d.healey @ustk
                                  last edited by d.healey

                                  @ustk Working for me. Have you set a default preset?

                                  Peek 2025-08-14 23-21.gif

                                  Does Live use VST3?

                                  Libre Wave - Freedom respecting instruments and effects
                                  My Patreon - HISE tutorials
                                  YouTube Channel - Public HISE tutorials

                                  ustkU 1 Reply Last reply Reply Quote 1
                                  • ustkU
                                    ustk @d.healey
                                    last edited by ustk

                                    @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

                                    Hise made me an F5 dude, browser just suffers...

                                    d.healeyD 1 Reply Last reply Reply Quote 0
                                    • ustkU
                                      ustk @d.healey
                                      last edited by

                                      @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

                                      Hise made me an F5 dude, browser just suffers...

                                      1 Reply Last reply Reply Quote 0
                                      • d.healeyD
                                        d.healey @ustk
                                        last edited by d.healey

                                        @ustk said in saveInPreset vs custom prefFile vs what?:

                                        Yes I have set a default preset

                                        Link Preview Image
                                        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...

                                        favicon

                                        Forum (forum.hise.audio)

                                        Libre Wave - Freedom respecting instruments and effects
                                        My Patreon - HISE tutorials
                                        YouTube Channel - Public HISE tutorials

                                        ustkU 1 Reply Last reply Reply Quote 1
                                        • ustkU
                                          ustk @d.healey
                                          last edited by

                                          @d-healey Oh what what what?
                                          Seems not to be an ideal behaviour though...

                                          Starting again and report ☺

                                          Hise made me an F5 dude, browser just suffers...

                                          ustkU 1 Reply Last reply Reply Quote 1
                                          • ustkU
                                            ustk @ustk
                                            last edited by

                                            @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!

                                            Hise made me an F5 dude, browser just suffers...

                                            ChazroxC 2 Replies Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            19

                                            Online

                                            1.9k

                                            Users

                                            12.3k

                                            Topics

                                            107.1k

                                            Posts