HISE Logo Forum
    • Categories
    • Register
    • Login

    saveInPreset vs custom prefFile vs what?

    Scheduled Pinned Locked Moved Solved General Questions
    33 Posts 4 Posters 195 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

      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+6sYy062uAgtIv5CHLkHtmBqnRXSaIHi6EHNkm5fmyjr9gT8hFndfmSEi1KfER5NInHQHqE5VDhtQZH5N1GxHrb4EgpO2.3VXQ4flUkqiRM9.njUIJsPJktscOuX1HUAhlO2ztCWQi8wvcSYpjpKpBoh8dBPCtZ0H7PZ6XXQtE01rd8Ubger78cbhoCbGxE8eNNLgBqg6Kox8QfjFtei6jMY.UsmHZjfCKpsjAcoky0NYT.n6A7ALNcUuXJDFdljF2MlJopGh4jPZbMs5fhqBh.f8vgg8gbgZ9IbOESvqMxn89XEdYmyq5Tk46V6KUAL4pLog5bbX5N9XAlTa4kcpVMm3f6MjRSTi.s6tnrKER0aymsYgTvmNUOAG6V3LXOuF2eemIbrjE28tf86S8g3.oVN4zTE18poLTNggE32OGzK.yGPS29KRO.NSXqqf+Dgh9TdMCYctvw8xP99yDSeKFKBM2By.VWyFecFVimD0mFuh6IF5NQQHGc5D+Ee+R78RSpJonf2gyTOcDMacaQHQmPq+6qVlfxxJ0ELYLDTUYJW9rrxkdgLBMFwfM4irMwVjg7Y8l90G75+dazy5nS2lrMvNBdYDMVwzGFq8om.c5RqBqZuOUNTIFAMsxKDfVpuSmdVdyveb3NiyW39C6HUi0glEMJhhXDnJAxRY5PeoVv+gTQG0i8JCyO+N+1Cd8q94siJ2kFghvmUtosLw2mclo8pOKLRp.t0IB55hr9BanvzkP8wIgJW4PXeBY7gTxwBi9nRGtapx5Ild3ZGJvJFevwP0h4HdK6xhJeTguwkWjEcSCk2xNsLpUr3TnIAp+fIuOTcQP2+Ua.CdXpP5u+le4MSKcsLkMel6vJ+UE6ycbcWRmU0CeBsUhRI3K80tp3D5JSPN3rQXtDhvxckvVkDo0vGGJKTwj6EOay0EYxqrmPMPp5SAUHFJKgyKf0ndtQ6RHy1EGQ4vaiyFaeZHU8Vv5QwwdAsvwkAZiOQDCgM8qv4rnfDkgmxrjvvtXUvDb4TAoryZGHNRnsDwPzZJ7mjDkFZ0lstQT55ukQTAGAYLB.3EfbW25qt9k9V4CTNH96M93wLoZW3sm7yYlGVYV+J2pTlcj3ztXBARkeesKOb2RjvI5S5KRANTDmcCcYjhrxKiLINeETmKPmpCZ4ES+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
                          • 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

                              Libre Wave - Freedom respecting instruments and effects
                              My Patreon - HISE tutorials
                              YouTube Channel - Public 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.

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

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

                                      @d-healey I tested it in Ableton. Value doesn't survive relaunch. Might just be Ableton.

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

                                        This preset thing drives me crazy...

                                        it work in a minimal example, but same code in the project won't work despite I checked everything I could...

                                        And another strange thing arose, now I removed the initial preset loading, my bypass button is deactivated when a new instance is inserted in DAW. But it initialises normally in Hise, its default value is obviously 1, and it's not set anywhere in code. The project is well saved before export and build folder cleaned... Turning around and around with this lol 😆

                                        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 said in saveInPreset vs custom prefFile vs what?:

                                          it work in a minimal example

                                          Are you saying my snippet is working for you?

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

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

                                            @d-healey nope, I should have said only for preset loading, not DAW

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

                                            d.healeyD 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            21

                                            Online

                                            1.9k

                                            Users

                                            12.3k

                                            Topics

                                            107.1k

                                            Posts