HISE Logo Forum
    • Categories
    • Register
    • Login

    Change Numbers from 0-100 in a Label

    Scheduled Pinned Locked Moved Scripting
    6 Posts 3 Posters 345 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.
    • M
      meto396
      last edited by

      Hello, is it possible to change the Numbers from 0-100 in a Label when I use a Knob?

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

        @meto396 Yes, but it's usually better to use LAF to display knob values.

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

        M 1 Reply Last reply Reply Quote 0
        • M
          meto396 @d.healey
          last edited by

          @d-healey do you have an example how to do that?

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

            @meto396 Here's how to use LAF with knobs/sliders. Doesn't specifically deal with displaying the value, but you're only a g.drawAlignedText call away from that.

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

            1 Reply Last reply Reply Quote 1
            • M
              Mighty23
              last edited by

              Something like this?
              items: knbValue & lblValue

              const var lblValue = Content.getComponent("lblValue");  // your label
              
              inline function onknbValueControl(component, value)
              {
              	lblValue.set("text",  value); 
              	StereoDelay.setAttribute(StereoDelay.DelayTimeLeft, value);   // i've used the stereo delay, use your fx or instrument
              };
              
              Content.getComponent("knbValue").setControlCallback(onknbValueControl);
              

              If your knob has a 101 steps this should work.

              Free Party, Free Tekno & Free Software too

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

                @Mighty23 thanks this worked

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

                30

                Online

                1.8k

                Users

                12.0k

                Topics

                104.5k

                Posts