Forum

    • Register
    • Login
    • Search
    • Categories

    1 knob - 2 values

    General Questions
    4
    9
    340
    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.
    • Jay
      Jay last edited by

      is there a way a having a knob with two values?

      example: -10, +10 (so when you move it left is minus(-), when move it right plus(+).

      I'm doing this but is not working:

      inline function onKnobNameControl(component, value)
      {
      local index = EQ.Gain + 1 * EQ.BandOffset;
      EQ.setAttribute(index, value*-5); // for negative values
      EQ.setAttribute(index, value*5); // for positives values
      };
      Content.getComponent("KnobName").setControlCallback(onKnobNameControl);

      Joansi Villalona

      1 Reply Last reply Reply Quote 0
      • ustk
        ustk last edited by

        Simply set these values in the knob property editor for min/max

        Then EQ.setAttribute(yourIndex, value) will work as expected

        I cannot help pressing F5 in the forum...
        Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

        1 Reply Last reply Reply Quote 1
        • ustk
          ustk last edited by ustk

          Notice that if your knob is only controling one thing, you can simply connect it directly from the property editor to you EQ, so you don't even need a custom callback and find the index...

          But be careful , it doesn't work if you want to connect it somewhere else at the same time, or add something else to control (like updating a label)... for this, effectively a custom callback is necessary
          And keep in mind you need to remove the connection from the property editor if you want to create a custom callback afterward (both are not allowed at the same time)

          I cannot help pressing F5 in the forum...
          Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

          Jay 1 Reply Last reply Reply Quote 0
          • Jay
            Jay @ustk last edited by

            @ustk the reason I'm using a callback is because I'm using the same EQ to do some else

            Joansi Villalona

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

              @Jay said in 1 knob - 2 values:

              @ustk the reason I'm using a callback is because I'm using the same EQ to do some else

              You can use the EQ to do many things even if the knob is linked via the property editor. But the knob can only do one thing.

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

              Jay 2 Replies Last reply Reply Quote 1
              • Jay
                Jay @d.healey last edited by

                @d-healey I got it figure it out.

                Joansi Villalona

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

                  @d-healey can you tell me what might be wrong with this? Because when I add the 2nd set of frequencies it stop working.

                  const var EQ = Synth.getEffect("EQ"); // (1) instance of the EQ

                  // ----- Low Shelf Gain
                  inline function onlgKnbControl(component, value)
                  {
                  local index = EQ.Gain + 1 * EQ.BandOffset;
                  EQ.setAttribute(index, value*-5); // I got this working
                  Q.setAttribute(index, value*5); // I got this working
                  };
                  Content.getComponent("lgKnb").setControlCallback(onlgKnbControl);

                  // ----- Low Cut [Frequencies]
                  const var lcfreq = [12, 18, 24, 30, 36, 43, 54]
                  inline function onlcKnbControl(component, value)
                  {
                  EQ.setAttribute(EQ.Freq + 0, lcfreq[value]);
                  };
                  Content.getComponent("lcKnb").setControlCallback(onxlcKnbControl);

                  // ----- Low Shelf [Frequencies]
                  const var lsfreq = [74, 84, 98, 116, 131, 166, 230, 361]
                  inline function onlsKnbControl(component, value)
                  {
                  EQ.setAttribute(EQ.Freq + 1, lsfreq[value]);
                  };
                  Content.getComponent("lsKnb").setControlCallback(onlsKnbControl);

                  Thanks in advance...

                  Joansi Villalona

                  orange 1 Reply Last reply Reply Quote 0
                  • orange
                    orange @Jay last edited by

                    @Jay
                    Are you trying to make something like that?

                    You are using same local index for both parameters.

                    HiseSnippet 960.3ocuV0saaaCElxwrcVaNnEXWOHDrKb1RCrRSZ6Pvvbi+YvqKIdycE8tVZJpXhPQ5IQkUihBr66KUeW5Cv1av1gTRQVopYwWr5bS347cN7iGdNehShUTVRhJF4z5oKWvPNeAd5Rodd+4DtDMd.xYS7wjDMK1KyzQKWPRRXAHGmM9QiAmVMQ1e+8ObDQPjTVoID5YJNk8y7Httz5jdOgKDiHArmxiVA898FSUx9JgJE3yF3tnED54jyXmPLvZfQN2ZX.WqhmpIZVBf4HUvxoyU+gLC+y3I7YBlYgOZJjnLyn9y4hfIEm0DDxo4jxS9FYm7uDeLOfeo8xJvcrN7JiX0ZfSipTpYEJ4+wnzHkHvjfOB8bVgdMyn2cwSow7E5ROFt843wR3xIj.k8UoUFVTiepAtuBPH06FQNmMJFVbYDc1ua2c77On61G11ssKT7SzdWPh8F9K9deumsQX2yX5gggLptyVf4s19PupXEm8D4L.cw1.36qhVnjvhNaY8tUV9M+wkBtj4ElJoZtR5ojVDlfiUhNzhH2AxsHksca2W21UnnDgGWFvdkgW.M10z548sdc89F6xiHxfSCCSX5Cq.eupv8qCdaWiI3+erVGymkpYcx1pBNXNw0CYuc7tWIl1tuAR20VGL4H+r1mHDyf96NUKAYkpUpOmnzrSkc1180tsbeyG3ILrNW4ISvhqyqYrK9ZBqiLMZFKt37miC5Dq1peqaVqNMqfrBPkbrjqOcAKec4vfeMCCn7JpYrHmf.TscnXy7ghoBd.KFwgjbarsbhrbOWb4kggeUOzuMd.QSJRCjQXWVvh0bygwY.6BPpJaVqEd.K4bsZgEa9kHxA+etou5R0r+7jdKKk1FzKhT5C808Pe3.NHynBREDcUsGSqatC3RpxPtYPVlv0KWUDdMDj5VqfTs2A2P5dW7DtlNud91nF9B2F+ey2b4813LYrRx1DO54eh0x2rn+peZ7Erg+tkGXLntTgHmjFMhK.UZfDXmFv4wnX0Mur0yzMaL3ma3cGzmZMrW0uFKCt+UMreog6XC4fUFQdmwvCJP79+5sVDO7p43QW0v2sZRc1359Fs+M+azneUkp4xyNl.ZtvvCFpJSgmFPYvUnTxDWVbxW20r1PhoLawB67Ovubm9l0N4N8Kb9IYOhHzX0KnYRWlNhOyZAN2R6CaZAuvBV64WnYYpGQvSNdAkZ5RuGzgWeD6s1Qb+0Nh8W6HNXsi3AqcDObsi3QWSDl2283TsJJSyBLLYn8aENNCkDna0NUh9Wf1zteJ
                    

                    develop Branch / XCode 13.1
                    macOS Monterey / M1 Max

                    Jay 1 Reply Last reply Reply Quote 0
                    • Jay
                      Jay @orange last edited by Jay

                      @orange No, I'm using the same parameter to control Gain and Frequency, but is two different thing 1 is gain 1 is freq, the first set of frequencies work well, the problem is after adding the second set of frequencies.

                      But thanks man I can use this snippet you send me for a tilt plugin

                      Joansi Villalona

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

                      11
                      Online

                      983
                      Users

                      6.6k
                      Topics

                      60.8k
                      Posts