HISE Logo Forum
    • Categories
    • Register
    • Login

    Reset sliders and knobs

    Scheduled Pinned Locked Moved General Questions
    3 Posts 2 Posters 147 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.
    • R
      rzrsharpeprod
      last edited by

      Good morning everyone,

      I'm hoping that somebody can help me and tell me the best to reset any sliders & knobs that have been tweaked when I change sample map?

      I am not using the preset system but rather buttons to switch between sample maps which are acting as the presets. This is working fine but any tweaks made on the piano are there carried across to the bass for example and I'd like the various knobs & effects to go back to default upon each new sample map change.

      Presumably I need to write a script & call it in the button change part of my main script?
      If so, how do I reset to the default value? Is there an easy way to set to the default value or will I need to hardcode values for each of the sliders I want to reset?

      Is there a better way to do this or is the method above the best/only way?

      Thanks in advance

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

        You can use the .setValue() function to set the value of a control. And you can use .changed() to trigger its callback after you've set its value. There is also the .get() function which can be used to retrieve a control's property, such as its defaultValue.

        Put this all together and you get something like:

        local defaultValue = myControl.get("defaultValue");
        myControl.setValue(defaultValue);
        myControl.changed();
        

        You will probably want to put this inside an inline function. And you'll want to use a loop to go over all of your controls in one go so you don't need to write it out one by one.

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

        R 1 Reply Last reply Reply Quote 0
        • R
          rzrsharpeprod @d.healey
          last edited by

          @d-healey said in Reset sliders and knobs:

          You can use the .setValue() function to set the value of a control. And you can use .changed() to trigger its callback after you've set its value. There is also the .get() function which can be used to retrieve a control's property, such as its defaultValue.

          Put this all together and you get something like:

          local defaultValue = myControl.get("defaultValue");
          myControl.setValue(defaultValue);
          myControl.changed();
          

          You will probably want to put this inside an inline function. And you'll want to use a loop to go over all of your controls in one go so you don't need to write it out one by one.

          That's fantastic David and was exactly what I was looking for - thankyou.
          I will look at implementing this into my project this weekend

          Thanks again

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

          50

          Online

          1.7k

          Users

          11.7k

          Topics

          101.9k

          Posts