Forum
    • Categories
    • Register
    • Login

    Show value on knob, but not editable

    Scheduled Pinned Locked Moved Scripting
    24 Posts 3 Posters 96 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.
    • P
      pgroslou @svkpowa
      last edited by

      @svkpowa You could use a label control then set the text value of the label with the value of the knob in the knob's callback. Then you can place the label where you want in the UI.

      Something like this...
      Label1.set("text", knob1.getValue());
      This code would be in the knob1 callback.

      S 1 Reply Last reply Reply Quote 0
      • S
        svkpowa @pgroslou
        last edited by svkpowa

        @pgroslou

        Okay, Gemini helped me, but it can't solve a problem. Only components named Volume and Balance are giving the text, the rest is not reacing:

        // 1. Pobieramy okienko wyświetlacza
        const var Label1 = Content.getComponent("Label1");
        
        // 2. Definiujemy jedną, wspólną funkcję dla wszystkich knobów
        inline function onKnobUpdate(component, value)
        {
        	// Pobieramy nazwę z pola "text" komponentu i wartość z 1 miejscem po przecinku
        	local name = component.get("text");
        	local val = Engine.doubleToString(value, 1);
        	
        	Label1.set("text", name + ": " + val);
        }
        
        // 3. Ręczna lista Twoich knobów (wpisz tutaj ich ID)
        // To jest najpewniejsza metoda w HISE
        const var knobList = [
        	Content.getComponent("Volume"),
        	Content.getComponent("Gain"),
        	Content.getComponent("Balance"),
        	Content.getComponent("ReverbMix1")
        ];
        
        // 4. Przypisujemy funkcję do każdego knoba z listy powyżej
        for(k in knobList)
        {
        	if(k) // Sprawdzamy czy knob w ogóle istnieje
        	{
        		k.setControlCallback(onKnobUpdate);
        	}
        }
        
        David HealeyD 1 Reply Last reply Reply Quote 0
        • David HealeyD
          David Healey @svkpowa
          last edited by David Healey

          @svkpowa said in Show value on knob, but not editable:

          if(k)

          This is not needed.

          @svkpowa said in Show value on knob, but not editable:

          Only components named Volume and Balance are giving the text, the rest is not reacing:

          Components can either use a control callback or they can be connected by processor/parameter ID - the knobs that aren't responding are connected via the latter so the callback will never trigger.

          Either you need to do it all through the callback or use broadcasters.

          Free HISE Bootcamp Full Course for beginners.
          YouTube Channel - Public HISE tutorials
          My Patreon - HISE tutorials

          S 1 Reply Last reply Reply Quote 0
          • S
            svkpowa @David Healey
            last edited by

            @David-Healey needed some time to figure it out 😁 73109c59-30cb-4e50-a4cc-2a3f28bafc60-image.png

            David HealeyD 1 Reply Last reply Reply Quote 0
            • David HealeyD
              David Healey @svkpowa
              last edited by

              @svkpowa Noice, what was the secret?

              Free HISE Bootcamp Full Course for beginners.
              YouTube Channel - Public HISE tutorials
              My Patreon - HISE tutorials

              S 1 Reply Last reply Reply Quote 0
              • S
                svkpowa @David Healey
                last edited by

                @David-Healey i created a second "knob" with the scale of 0.001 to make it invisible and scaled the tile to fit into the real knob, then - linked to it. one knob makes as a controller, the second one as display. had to make it with every knob, but hey - it's just 10 minutes

                David HealeyD 1 Reply Last reply Reply Quote 0
                • David HealeyD
                  David Healey @svkpowa
                  last edited by

                  @svkpowa

                  alt text

                  Free HISE Bootcamp Full Course for beginners.
                  YouTube Channel - Public HISE tutorials
                  My Patreon - HISE tutorials

                  S 1 Reply Last reply Reply Quote 0
                  • S
                    svkpowa @David Healey
                    last edited by

                    @David-Healey hope it won't cause the gpu eating, there are twice as many knobs 😸

                    David HealeyD 1 Reply Last reply Reply Quote 0
                    • David HealeyD
                      David Healey @svkpowa
                      last edited by

                      @svkpowa It's not the best way of doing it, but have fun, if you hit problems you'll learn something new.

                      Free HISE Bootcamp Full Course for beginners.
                      YouTube Channel - Public HISE tutorials
                      My Patreon - HISE tutorials

                      S 1 Reply Last reply Reply Quote 0
                      • S
                        svkpowa @David Healey
                        last edited by

                        @David-Healey today I learned how to edit knobs in knobman. knob jumping through actual values is much better looking than a normal 0-10 scale like in the original5a357cd1-2fa5-4ea1-b884-96512c3da37b-image.png

                        I'm addicted to it right now

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

                        32

                        Online

                        2.1k

                        Users

                        13.3k

                        Topics

                        115.2k

                        Posts