HISE Logo Forum
    • Categories
    • Register
    • Login

    saveInPreset vs custom prefFile vs what?

    Scheduled Pinned Locked Moved Solved General Questions
    33 Posts 4 Posters 1.1k 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.
    • 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

      Free HISE Bootcamp Full Course for beginners.
      YouTube Channel - Public HISE tutorials
      My Patreon - 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.

          Free HISE Bootcamp Full Course for beginners.
          YouTube Channel - Public HISE tutorials
          My Patreon - 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.

                Free HISE Bootcamp Full Course for beginners.
                YouTube Channel - Public HISE tutorials
                My Patreon - 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+6sYy062uAgtIv5CHLkH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wLoZW3sm7yYlGVYV+J2pTlcj3ztXBARkeesKOb2RjvI5S5KRANTDmcCcYjhrxKiLINeETmKPmpCZ4ES+4OsS.kMH.JOssBrzidckIFfYUDjjPrZ5AXzi1kAn6vTdpA86WvsoZb4tHe.S0T+Zmp48kh21tKS4ELaNVYFbDZb++AGylE7SsOv2m5oJH3B1s+t4cvu2g6ORjnajdHF5UC8QsgZndPeNOJ3cNmFJ022UzsRSWWWuVGA5Q4Dyh2.eYfMzqsx.aLADdkvKV7RuzGL0Sa9wFI.m3lowqZends6zuTl9.CL76K87ldqthgqMuFt97Z3FyqgMmWC2bdMbq40v68tMT++lrahRDkV1fPG18.yqhVVGvwPFnIaE8eP4dQO0
                    

                    Free HISE Bootcamp Full Course for beginners.
                    YouTube Channel - Public HISE tutorials
                    My Patreon - 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?

                        Free HISE Bootcamp Full Course for beginners.
                        YouTube Channel - Public HISE tutorials
                        My Patreon - 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

                              https://forum.hise.audio/topic/6410/restoring-properties-with-daw-session/30?_=1755211098829

                              Free HISE Bootcamp Full Course for beginners.
                              YouTube Channel - Public HISE tutorials
                              My Patreon - 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
                                  • ChazroxC
                                    Chazrox @ustk
                                    last edited by Chazrox

                                    @ustk I gave it a try but I just want to make sure I understand what you're trying to do. You want the knobValue to remain the same despite userPreset load and/or DAW loading?

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

                                      @Chazrox yes

                                      Free HISE Bootcamp Full Course for beginners.
                                      YouTube Channel - Public HISE tutorials
                                      My Patreon - HISE tutorials

                                      ChazroxC 1 Reply Last reply Reply Quote 0
                                      • ChazroxC
                                        Chazrox @d.healey
                                        last edited by

                                        @d-healey should the knobValue be static value? ie. ALWAYS = 1? or should it always = last saved state? ie, user changes and saves the value as .5 in one preset, should that load as .5 on all presets and next plugin launch....or go back to 1?

                                        1 Reply Last reply Reply Quote 0
                                        • ChazroxC
                                          Chazrox @ustk
                                          last edited by Chazrox

                                          @ustk @d-healey What about setting Knob1 "defaultValue" on value changes/saves and write/load with JSON. Would that make it persist?

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

                                            @Chazrox it does persist for me with the snippet I provided. It should retain the last value it was set to.

                                            Free HISE Bootcamp Full Course for beginners.
                                            YouTube Channel - Public HISE tutorials
                                            My Patreon - HISE tutorials

                                            ChazroxC 1 Reply Last reply Reply Quote 1
                                            • First post
                                              Last post

                                            34

                                            Online

                                            2.0k

                                            Users

                                            12.6k

                                            Topics

                                            109.8k

                                            Posts