HISE Logo Forum
    • Categories
    • Register
    • Login

    A way to make preset up and down buttons? (SOLVED)

    Scheduled Pinned Locked Moved General Questions
    44 Posts 6 Posters 2.8k 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.
    • LindonL
      Lindon @ulrik
      last edited by

      @ulrik please read the documentation.....BEFORE you comment (yeah I know I do that too sometimes - silly me)

      false here is (bool stayInDirectory) not do or not do....

      HISE Development for hire.
      www.channelrobot.com

      ulrikU 1 Reply Last reply Reply Quote 2
      • d.healeyD
        d.healey @ulrik
        last edited by

        @ulrik That parameter determines if it stays within the folder when loading the next/previous preset.

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

        LindonL ulrikU 2 Replies Last reply Reply Quote 1
        • LindonL
          Lindon @d.healey
          last edited by Lindon

          @d-healey ha! beat you to it. 😂

          HISE Development for hire.
          www.channelrobot.com

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

            @SteveRiggs That snippet won't even load for me, HISE crashes instantly.

            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 @Lindon
              last edited by

              @Lindon said in A way to make preset up and down buttons?:

              @d-healey ha! beat you to it. 😂

              I'm glad it makes you so happy :)

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

              LindonL 1 Reply Last reply Reply Quote 0
              • LindonL
                Lindon @SteveRiggs
                last edited by Lindon

                @SteveRiggs <-- your snippet is crashing HISE so something else is broken bad in there.

                -- oh look Dave beat me to it

                HISE Development for hire.
                www.channelrobot.com

                1 Reply Last reply Reply Quote 0
                • LindonL
                  Lindon @d.healey
                  last edited by Lindon

                  @d-healey yeah I'm a trivial person really....😏

                  Sorry ---getting us off topic....its been a long day...

                  HISE Development for hire.
                  www.channelrobot.com

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

                    My guess is that saveInPreset is not false for the button so that loading a user preset triggers the callback again and you get an endless loop.

                    1 Reply Last reply Reply Quote 3
                    • ulrikU
                      ulrik @Lindon
                      last edited by

                      @Lindon sorry, I was to fast and stupid...🤭

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

                      LindonL 1 Reply Last reply Reply Quote 0
                      • ulrikU
                        ulrik @d.healey
                        last edited by

                        @d-healey thank you, I think I should stay out of this kind of discussions...🤭

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

                        1 Reply Last reply Reply Quote 0
                        • SteveRiggsS
                          SteveRiggs
                          last edited by

                          @Christoph-Hart That's got it! Good guess. It seems to be working now. Cheers dude!

                          @d-healey @Lindon @ulrik Thanks yet again for all your help. Got there in the end :)

                          I'll put the new working example snippet here incase anyone else needs it in future....

                          HiseSnippet 1204.3ocsW0sbZbCEVqsUSXSnoYl9.ngqfotNK9+TGOACF2xDaLiAm16xH1U.Z7hDiVs1lIimI8MouF8tdWuMOJ8Mn8ncWfEaL1CS8dERmezmNmi9NGZnjtrf.oBYko0vALj0KwMGJz8pzixEnZGhr9AbCE6RRc10ZB7q.llb9.BU3QNTdkfTNTqkh.RqpMagJOb.MHf4grrV9mMNvJyJnnu+48ko9TgKaxVHzGkbW1w79b8jcaT5Cbe+indrV79ozdyR0bkhJReYH.1kwNnAT2KncY0oF0VBir9lpdbsT0TS0r.j0JkkdCa1C.Yr9ejGva6yLKJhZBNJd6ij9dFDa1EUoG22qwnfR.B7RiIgnkiCQeO9DtGe79SBUeWj.xDKRGOrVZdvqXZ3473gmUJ3sRL7dMtoqhOPOQhAau.WSnYpNTHEjFVw5hV5OWFWQBZHzq0mdA6HErXrE421wYUxVNNE1KqcV6QJ1koqH6OPJfE4yYpPJqE4JrVfYeg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pHQ+Gc+O3bC
                          

                          www.anarchyaudioworx.com

                          www.facebook.com/groups/audioworx/

                          ulrikU 1 Reply Last reply Reply Quote 1
                          • ulrikU
                            ulrik @SteveRiggs
                            last edited by

                            @SteveRiggs 🍻

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

                            1 Reply Last reply Reply Quote 1
                            • LindonL
                              Lindon @ulrik
                              last edited by

                              @ulrik honestly mate no one can be quite as stupid as me at times....keeep.contibuting please.

                              HISE Development for hire.
                              www.channelrobot.com

                              ulrikU 1 Reply Last reply Reply Quote 1
                              • ulrikU
                                ulrik @Lindon
                                last edited by

                                @Lindon 🍺 I will :)

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

                                1 Reply Last reply Reply Quote 1
                                • SteveRiggsS
                                  SteveRiggs
                                  last edited by

                                  Sorry guys. One more tiny question on this...

                                  It's working now, but I'm trying to have the buttons set to 'isMomentary' so that the animation only happens for a second when the button is clicked.

                                  When it's set like that though, it skips 2 presets at a time. Any idea why this happens?

                                  Snippet here:

                                  HiseSnippet 1220.3ocsW0saZbDEdVaOsFRnoQJO.i3JP00A7+oNVACF2hhMF4Emz6hF1c.F4kYPyNqsQQQJ8MoOA8YnOB4t9Zz2f1yr6B6hMFagjWeimyey24m4bNzRIcX99RExJS6QCYHqmisGIz8q0mxEnFGgr9IbKE6JRS1MZB7e9LM4hgDpvkbj7ZAoZfVKE9j10saipNZH02m4hrrV9WMFvJyJnvu+8cUodTgCKgDB8AI2gcBe.WmPsUk2y87Nl5xZyGjR5spzvQJpI8jA.XWFWBMj5bIsGqI0H1RXj02U2kqkJaMUy7QVqTU5NxtO.xH4+.2m2wiYNTFYCFJh7wROWChMTQ05y8baMNn3i.qzJIDsbTH5U3S4t7IzSBU+XHCRhFoiGVKMO3UNM7J83gmUJ3sRD7dI11QwGpS3Xv1yvMDZlpKERAogUjrnkVdEbMIHgPu9.5kriUvgIZTXmRkVircoRE2OWVyeu90SU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c1bAzYqEPmsW.c1YAzY2EPm8lqNlenygAZ4fnmI.gV0iFVXUWPgprvJRz+CLMt6mI
                                  

                                  www.anarchyaudioworx.com

                                  www.facebook.com/groups/audioworx/

                                  ulrikU 1 Reply Last reply Reply Quote 0
                                  • SteveRiggsS
                                    SteveRiggs
                                    last edited by

                                    ...damn, ok... it looks like 2 questions...

                                    I just added it into an actual project and it also opens the preset browser as well when you click the prev or next buttons. Is there a way to stop this?

                                    I use this code to show/hide the preset browser...

                                    // Pop Up Preset Browser MAIN
                                    
                                    const var PresetsButton2 = Content.getComponent("PresetsButton");
                                    
                                    
                                    inline function onPresetsButton2Control(component, value)
                                    {
                                     if (value)
                                        {
                                            PresetBrowser.showControl(true);
                                        }
                                        else
                                        {
                                            PresetBrowser.showControl(false);
                                        }
                                    };
                                    
                                    Content.getComponent("PresetsButton2").setControlCallback(onPresetsButton2Control);
                                    
                                    const var PresetBrowser = Content.getComponent("PresetBrowser");
                                    

                                    www.anarchyaudioworx.com

                                    www.facebook.com/groups/audioworx/

                                    1 Reply Last reply Reply Quote 0
                                    • ulrikU
                                      ulrik @SteveRiggs
                                      last edited by ulrik

                                      @SteveRiggs if the button is set to momentary, it will send value 1 when mouse is down and then value 0 when released so you will get 2 values after each other.
                                      if you use

                                      if(value == 1)
                                      

                                      it will only trigger on mouse down.
                                      like this:

                                      inline function onNextBtnControl(component, value)
                                      {
                                          if(value == 1)
                                              
                                           Engine.loadNextUserPreset(false);
                                      };
                                      

                                      it will only trigger when mouse is down (1) and skip mouse up value (0)

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

                                      SteveRiggsS 2 Replies Last reply Reply Quote 1
                                      • SteveRiggsS
                                        SteveRiggs @ulrik
                                        last edited by

                                        @ulrik Genius sir! That makes sense now. Works perfectly. Thank you 🤘

                                        www.anarchyaudioworx.com

                                        www.facebook.com/groups/audioworx/

                                        1 Reply Last reply Reply Quote 0
                                        • SteveRiggsS
                                          SteveRiggs @ulrik
                                          last edited by

                                          @ulrik It's still baffling me a bit why the preset browser opens though when the prev or next buttons are pressed. Very weird!! 🤔

                                          www.anarchyaudioworx.com

                                          www.facebook.com/groups/audioworx/

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

                                            @SteveRiggs Post a snippet including your code that hides/shows the preset browser.

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

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

                                            14

                                            Online

                                            1.7k

                                            Users

                                            11.9k

                                            Topics

                                            103.4k

                                            Posts