Forum
    • Categories
    • Register
    • Login

    1 Knob for several value

    Scheduled Pinned Locked Moved General Questions
    17 Posts 2 Posters 808 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.
    • David HealeyD
      David Healey @yall
      last edited by

      @yall

      tried CB.setValue (1);

      Do you want the combobox's value to always be 1?

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

      1 Reply Last reply Reply Quote 0
      • Y
        yall
        last edited by

        what did you have against the number 1? ^^
        no it obviously has to change but I admit that I don't know

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

          @yall Do you want it to change to the knob's value?

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

          1 Reply Last reply Reply Quote 0
          • Y
            yall
            last edited by

            inline function onKnob1Control(component, value)
            {
            if(value == 0)
            {
            CB.setValue(1);
            }

             if(value == 1)
                { 
            CB.setValue(2);
            }
            

            };

            Content.getComponent("Knob1").setControlCallback(onKnob1Control);

            i understand i know

            1 Reply Last reply Reply Quote 0
            • Y
              yall
              last edited by

              @d-healey
              I just got there, I didn't put the .changed
              thank you .
              you won 1 week of vacation with me in the south of France (facing the sea;))

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

                Well done!

                I'll show you a slightly more efficient way that will only use one line in the callback

                CB.setValue(value + 1);

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

                1 Reply Last reply Reply Quote 0
                • Y
                  yall
                  last edited by

                  @d-healey said in 1 Knob for several value:

                  CB.setValue(value + 1);

                  i will try now

                  1 Reply Last reply Reply Quote 0
                  • Y
                    yall
                    last edited by

                    even simpler. yet these are things that I see often, I understand them but I don't have the reflex to apply them correctly.

                    thanks a lot

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

                      @yall said in 1 Knob for several value:

                      I don't have the reflex to apply them correctly.

                      It just takes practice. Read lots of code and write lots of code and you'll pick these things up.

                      One tip, if you find you are writing the same thing multiple times then there is probably a more efficient solution.

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

                      1 Reply Last reply Reply Quote 0
                      • Y
                        yall
                        last edited by

                        @d-healey yes I try more and more to write the codes with what I learn rather than doing stupid copy paste. I am creating a github to host my projects in order to sell them with the open license and I will send you all of this. you will surely be surprised for a little beginner Like me ^^

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

                        27

                        Online

                        2.1k

                        Users

                        13.0k

                        Topics

                        112.5k

                        Posts