HISE Logo Forum
    • Categories
    • Register
    • Login

    Output the value of a slider in a separate label

    Scheduled Pinned Locked Moved Scripting
    23 Posts 4 Posters 1.1k 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.
    • d.healeyD
      d.healey @ThomAce
      last edited by

      @ThomAce said in Output the value of a slider in a separate label:

      Also, at the bottom right corner of the code editor, there is a Compile button.

      Shortcut key F5 will save you some clicks

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

      T 1 Reply Last reply Reply Quote 1
      • T
        ThomAce @d.healey
        last edited by

        @d-healey Yeah, but you know how we develop... :D Typing something, then CTRL+S, CTRL+S, CTRL+S... But good thing anyway to use the F5... I didn't knew that this works on code editor as well. A visual feedback might be helpful for such idiots like me. :) I always forget that the code not in sync with the gui design. But, despite some bugs I found in the tool, it is awesome.

        1 Reply Last reply Reply Quote 0
        • N
          nic @d.healey
          last edited by nic

          @d-healey I just want to output the value. So basically like this:

          CUTOFF: 100%

          And when I drag over the number or use scroll wheel it should increase/decrease it. In other words, the behavior of a diagonal slider but it should be not visible except it‘s value/textbox.

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

            @nic In the look and feel function you just need to draw the text then.

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

            N 1 Reply Last reply Reply Quote 0
            • N
              nic @d.healey
              last edited by

              @d-healey can you point me in the right direction how to set up the laf function? I have Content.getComponent() and don‘t know how to assign or start the laf.

              M 1 Reply Last reply Reply Quote 0
              • M
                Mighty23 @nic
                last edited by

                @nic

                const var Label = Content.getComponent("Label");
                const var Knob = Content.getComponent("Knob");
                
                inline function onKnobControl(component, value)
                {
                   Label.set("text",value);
                };
                Content.getComponent("Knob").setControlCallback(onKnobControl);
                

                If you want something more "fancy" perhaps you could consider making only the writing visible on the label and making the other customizations in a panel. From what I understand it should be the most immediate way.

                Values ​​and strings in labels can also be concatenated with the "+" symbol

                .set("text", Engine.doubleToString(value, 0)+" %");
                

                Free Party, Free Tekno & Free Software too

                N 1 Reply Last reply Reply Quote 0
                • N
                  nic @Mighty23
                  last edited by

                  @Mighty23 thank you very much but I already tried that. The problem is that I want to use proccessorId and so setControlCallback() will not fire. I have to change look and feel instead.

                  T 1 Reply Last reply Reply Quote 0
                  • N
                    nic
                    last edited by nic

                    If I do this:

                    const var cutoffSlider = Content.getComponent('cutoffSlider');
                    cutoffSlider.createLocalLookAndFeel();
                    

                    I get error "function not found". How do I set up it correctly?

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

                      @nic https://youtu.be/PykrsXv8aqg

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

                      N 1 Reply Last reply Reply Quote 0
                      • N
                        nic @d.healey
                        last edited by

                        @d-healey thanks! Big help.

                        1 Reply Last reply Reply Quote 0
                        • T
                          ThomAce @nic
                          last edited by ThomAce

                          @nic As we told, you have to remove the parameter properties from that slider and then you have to use scripting. What I provided does exactly what you are looking for...

                          Just for example:
                          3e0a44f6-cb5d-42c7-b298-db16a2f2f205-kép.png

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

                          13

                          Online

                          1.7k

                          Users

                          11.9k

                          Topics

                          103.3k

                          Posts