HISE Logo Forum
    • Categories
    • Register
    • Login

    Engine.loadUserPreset | Load Preset From Button

    Scheduled Pinned Locked Moved General Questions
    init presetpreset buttonloaduserpreset
    11 Posts 5 Posters 593 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.
    • ulrikU
      ulrik @trillbilly
      last edited by

      @trillbilly What if you change to

      Engine.loadUserPreset("INIT.preset");
      

      Hise Develop branch
      MacOs 15.3.1, Xcode 16.2
      http://musikboden.se

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

        That won't work. Your button is set to save in preset, that will trigger the button's callback each time a preset loads and create an endless loop.

        You don't need an init preset. Just load the preset you want to be the init state before you compile your project and that will be the initial state the plugin is in when the user opens it.

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

        trillbillyT 1 Reply Last reply Reply Quote 0
        • trillbillyT
          trillbilly @d.healey
          last edited by

          @d-healey but what if I want a quick way for users to reset the default values without having to search the Preset browser?

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

            @trillbilly Then have a button on the UI that isn't set to saveInPreset that can be used to load a preset.

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

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

              Also you need to pass in a file object or path, not a preset name:

              819cf7d2-2a31-4855-963f-db68f507f985-image.png

              Here's an example: loadPresetTest.zip

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

              trillbillyT huen97H 2 Replies Last reply Reply Quote 0
              • trillbillyT
                trillbilly @d.healey
                last edited by

                @d-healey Aayaya (my Mario voice), I got it, thank you...

                1 Reply Last reply Reply Quote 1
                • huen97H
                  huen97 @d.healey
                  last edited by

                  @d-healey why this example not working for me 😖 , I am trying to use the button to load the presets , but fail.....

                  trillbillyT 1 Reply Last reply Reply Quote 0
                  • trillbillyT
                    trillbilly @huen97
                    last edited by trillbilly

                    @huen97 its set up like this

                    inline function onResetButtonControl(component, value)
                    {
                    	Engine.loadUserPreset("Factory/INIT.preset");
                    };
                    
                    Content.getComponent("ResetButton").setControlCallback(onResetButtonControl);
                    

                    with "Factory/INIT.preset" being the File Loaction and name or preset.

                    Y 1 Reply Last reply Reply Quote 0
                    • Y
                      yall @trillbilly
                      last edited by

                      @trillbilly otherwise in the callback of your Button, put the state of each button or setting of your project. longer to perform but if the "init" preset is deleted, this function will remain unchanged

                      trillbillyT 1 Reply Last reply Reply Quote 1
                      • trillbillyT
                        trillbilly @yall
                        last edited by

                        @yall Didnt think of this. Great observation!

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

                        15

                        Online

                        1.7k

                        Users

                        11.8k

                        Topics

                        102.7k

                        Posts