HISE Logo Forum
    • Categories
    • Register
    • Login

    Autoplay Preset

    Scheduled Pinned Locked Moved General Questions
    12 Posts 3 Posters 478 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 @DanH
      last edited by ustk

      @DanH make a button that doesn't save with preset (you can save it manually using the file system and make your own pref file if you need), and use the preset handler setPostCallback to do what you want

      Can't help pressing F5 in the forum...

      DanHD 2 Replies Last reply Reply Quote 0
      • DanHD
        DanH @ustk
        last edited by

        @ustk ah yes, thanks.

        DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
        https://dhplugins.com/ | https://dcbreaks.com/
        London, UK

        1 Reply Last reply Reply Quote 0
        • DanHD
          DanH @ustk
          last edited by

          @ustk I'm getting into a bit of a muddle trying to execute this... IS this the right kind of path? It's making my project crash when changing preset so something is triggering 😆 @d-healey

          const var myPresetHandler = Engine.createUserPresetHandler();
          
          inline function autoplay(//is something meant to go in here?)
          {
          	Console.print("hi");
          }
          myPresetHandler.setPostCallback(autoplay);
          

          Link Preview Image
          HISE | Scripting | UserPresetHandler

          An object for customizing the data model

          favicon

          (docs.hise.audio)

          DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
          https://dhplugins.com/ | https://dcbreaks.com/
          London, UK

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

            @DanH

            You can't use an inline function as a callback, it has to be a standard function.

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

            DanHD 1 Reply Last reply Reply Quote 0
            • DanHD
              DanH @d.healey
              last edited by

              @d-healey so like:

              myPresetHandler.setPostCallback(function(autoplay)
              {
              	
              });
              

              DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
              https://dhplugins.com/ | https://dcbreaks.com/
              London, UK

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

                @DanH The function doesn't take a parameter.

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

                DanHD 1 Reply Last reply Reply Quote 0
                • DanHD
                  DanH @d.healey
                  last edited by

                  @d-healey

                  myPresetHandler.setPostCallback(function()
                  {
                  	
                  });
                  

                  ? And how would I call it from a button callback?

                  DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                  https://dhplugins.com/ | https://dcbreaks.com/
                  London, UK

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

                    @DanH

                    A callback is a response to an event. The on note on callback is triggered when a note on message is received, a button callback is triggered when the button is clicked, a mouse callback is triggered when you interact with a panel using the mouse.

                    The setPostCallback is trigged post (after) a preset has been loaded. You don't need to call it manually.

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

                    DanHD 1 Reply Last reply Reply Quote 0
                    • DanHD
                      DanH @d.healey
                      last edited by

                      @d-healey oh yep so I should use an if statement like if my button is on then do this...

                      Out of interest I'm still using a method of yours which involves a knob to update the preset name in a label from way back when - I'm assuming this was pre these functions and I'm probably better off using these new functions?!

                      DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                      https://dhplugins.com/ | https://dcbreaks.com/
                      London, UK

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

                        @DanH said in Autoplay Preset:

                        @d-healey oh yep so I should use an if statement like if my button is on then do this...

                        Yeah

                        Out of interest I'm still using a method of yours which involves a knob to update the preset name in a label from way back when - I'm assuming this was pre these functions and I'm probably better off using these new functions?!

                        Maybe, different situations call for different methods. See what works :)

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

                        DanHD 1 Reply Last reply Reply Quote 0
                        • DanHD
                          DanH @d.healey
                          last edited by

                          @d-healey ok thank you! :)

                          DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                          https://dhplugins.com/ | https://dcbreaks.com/
                          London, UK

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

                          23

                          Online

                          1.8k

                          Users

                          12.1k

                          Topics

                          105.0k

                          Posts