Limit Knob 'range' using value of a second knob
-
Knob 2 sets the maximum value that Knob 1 can reach (or be turned up to) with the callback below:
inline function onKnob1Control(component, value) { if (value > Knob2.getValue() + 0.01) { component.setValue(Knob2.getValue() + 0.01); } }; Content.getComponent("Knob1").setControlCallback(onKnob1Control);
Which is fine but makes Knob 1 get jittery when forcing it above that value. A bad UX basically.
Does anyone have a different suggestion? :folded_hands:
HiseSnippet 834.3ocsV0raSCDDd2jrEhApnRbFY0SIhRURnTPpBZnIonnRaivkJtg1XuIYUs2MxdcgHTOxCQuwiReM3Lu.7.fDL6Zm+noosQBeHRyOei+1wy7soUnzkEEICQ37GMnOCguOwYfP0qVOJWfZVGgWlrOMRwBsSbsyf9znHlGBiy9VsCb9bHyyu1dGpOU3xF6BgNVxcYuiGvUi81p5dbe+codri3ASj8FUa5JE0j9xXfOYIkP8otmP6xNfpSKCAgWpgGWICcTTEKBgysizafSO4mEI4eLOh21moMJibfBk3dWoumlwZunZ839dsFdtiPPUZMtKjMoK7Hx9bO9H+i6FOzDvdLhI6G3LSSurSQuxWE8lAkvSPobITZEhiaHuuZbDMetGoo.93zgBs8IoRRtnL+FSpIgLDp0Cnmv1MDLFgnvlkJslM7SwsrrfVejx9TZn8dBY6x1uxdHvtLUMYPeo.LJrpI5pWFQk4hnhAAW3yEL6NwBWEWJrkBS0zvBk9EbGhYMnp9wrhVe0JOuicAik8qSdO5per1Qgh1Owtz5kJWzJOjX9QvWOZXFWEfsrxel0Y.il6YTWmTtUi562FlFKLMk0GJqINNGHUrCEELD25LK6+MTmNyLVZ07YgyLrdMIbd.KHhCZyBmrsoSDlcldfboa1.oaRSYhDkhlBt5v9rT64uQgR6pvfblTFBopLiwKmNF63y8XgHNTj6PLsTjg7oxAe+7y+w1naL3JSA9hG+setM5CMqSUT8xTJc.J1mEp35NAtN6TPYJY0JOoNK5DkruguoSAPy6ZY7WFIdUkUcvHiK5VEcKpSkKUGBdYrVn7Rh.f7izK1mplVSRKDmF.lKlRHPurKh3pASJTeKDpJMWgpaJEWgzhqb6MaNlYFbTO57efiox6OfznSGlqZLAyQ18iKpV9075euLVwEc2mpB4vGZxAwANvMbtL3sKDL+H826L5slD6RZacGvgI7LF+AdRCVVaiSCVdXPT.0MT9I2j0E8EH203A3jvb2Yd3Rbv1dzRFg.5fn.3trO45pO9OEVjmMlJK.lms.X1XAv77E.ylK.lWr.Xd4bwn+aDuIVICRVG.GsZXzqv3FBJLYYlBQ+EvjUG5R
-
Change Knob1's
max
property to match Knob2's value.HiseSnippet 826.3ocsVssaSCDDccRLfCPEUhO.q7jiTUURnbQpBZn4BJpj1HRoh2p1rdSxpZuqk85RiP8qgeD9D3s9JeB7G.y5KwNsIzpH59PjlKmwmY1YlMC7EDZPfvGoYb7LOJR6I5CmwkSaMEy3ndsQZan2GGHo9lwp1elGNHfZizzJ9AkBMiRnnyu2aerClSnYpPnSDLB8iLWlLS6flGvbb5hsoGyby48NM6QD7VBGQHvmh50PdXxY3IzCwJ2JnizdPGalT3OThkz.jVo8E1yFNU7Udr+mvBXibnJg5ngPfhU2U3XqXrRKp0Tli8fz7N.AQYPVUnXbU3458Y1r45ypFOKxfYFh70CsBKRuhKPu54oWsbzaITRKGkJESoM0GR7YdxLKJ97X8db3xYLFJ64oRrunBWoo2R.dvka6hOi10GDliv5U0pskI7S0cKWFJ8ARyyw9lGvEipa9VyTfSnxVBWOAGDrpDYshBAi6v3TywgbhjI3lBtxVCELegiEIEyVPTcBoUK+sxFQn2NfBAxEeQkTS6V1nrAaroUrc3KdhRuUUy2kB1HCars4HMRCKYJlOgZaAJuD32p4eiJUUwIgosvNNifNMqES.UJlK2NTHoGwshxhxWV175lFOdo1RBlC0eolUS.9+KfV7P2QT+70PkiPawh8Z5qtWK+n.ItljyQAuGmIOxixW0.BJoPB8kERXE3pLpqbijtxgNLapOhAMeOTO51.EQ3zo6q99O2CcmA2XIf+bu1XIVMajPGfhdTeISk8ZsomCKZhmTLzaSCNSJ7h3axEOTgtUFew7cQMoMmMW3GSZB8pWKSlG1R2Ztrhv9KulnaNlCKXD1gNX4hacTqZSL.sGKLpqFm4AL4r7qh+usJ5tRwM0GvjjoKmiEVBGUcS2CbLYA9S06LdLkHyHXI8te49YaM5ShPIiOoOV5yfKa8CCcGBugQnvWmyoNpwSsBpAoX4ZJYUEXHkaGI7G3jXrtRVKwX8TiHWLwWbJIdBR8Dwihz.bhG85nA7LMHads4N0wEdw5TBYwPcCfMVWfuXcAty5B7kqKvWst.e85B7M2NP0en38gRga7XCB0ePmnUcZZc3XnCLpaE8Ws99q6C
-
@d-healey Thanks, sorry I should have made clear that Knob 2 is also dynamic, so this creates a bit UI friction between the two knobs when changing Knob 2, and is weird for the User as Knob 1 keeps changing its range.
Thanks though!
-
-
@DanH said in Limit Knob 'range' using value of a second knob:
Knob 2 is also dynamic,
Post a snippet that demonstrates this too.
-
@d-healey Oh I just mean that Knob 2 will be moved around a lot by the user. Your snippet above displays the issue that makes Knob 1 jittery when using Knob 2...
Could a broadcaster be used to stop the mouse control when a certain value is reached?
-
@DanH Have a different variable state stores the knob values and is set using your logic in the callbacks. Then use that for setting the values in LAF. This should prevent the internal control value jumping up and down as you attempt to push it past the limit and the logic pulling it back down.
If you're using a filmstrip, do that in LAF too.
You r second option is to use a panel, but then you have to hack in DAW automation.
-
@aaronventure Hmmmm... Not sure I quite understand
Any example of this in action?