Lord of the Knobs :)
-
@orange said in Lord of the Knobs :):
@d-healey Yes,it will be in one mode allthe time.
My solution would be to use three knobs (so that I could link them up via parameter ID in the interface designer) and just display a different knob depending on which mode is selected.
-
@d-healey said in Lord of the Knobs :):
@orange said in Lord of the Knobs :):
@d-healey Yes,it will be in one mode allthe time.
My solution would be to use three knobs (so that I could link them up via parameter ID in the interface designer) and just display a different knob depending on which mode is selected.
Cool but all of these 3 knobs will have different ranges. How can I operate this different range knobs with this way? Besides the One Knob will control these 3 knobs at one time, simultaneously
-
Cool but all of these 3 knobs will have different ranges. How can I operate this different range knobs with this way?
Well there will be 3 knobs so each can have a different range
Besides the One Knob will control these 3 knobs at one time, simultaneously
I thought it would be only controlling one parameter at a time.
HiseSnippet 943.3ocsVE0aaaCDlxwLaVatHEnOrGIxSxHsAVIosCHKXd1NovnKoFycECnnnfVhNlMRjBRTYwnH.6m19oreB6ev1QIZK4LkVqML8h8w69N9cGuiGGGK8XIIxXjUqWuHhgr9Z7jEB07AyobAZzPj0CvmSSTrXR9R8WDQSRX9HKqsdgdAqVMQYe+422mFPEdrhkPn2H4drejGxUEqNt2K4AAmQ8YulGVx5i5MxSJFHCjo.e1B2EEQ8thdI6Bp1rFXj01m5yUx3IJphk.1zW5uXxb4uJxs+M7D9z.lVvEMAbT9xnAy4A9iWFqIHjUywEQ9V4Q9ivmy84qVuHCrSlBRAhx4.qFqSolqQI26iRmIC70N3dnmUI50LmdODOwKlGoJzn41WgGIfCmYTHsWlV41hZ7MMvCjfEB09gzqXmECBqP37rtceL4oc614311ssiYWR3Y+CNFRTjqowjqDxoIjSHu8cYJlIiINbP18XBm7cjife1auNss+XaaB7kY99QoIycVtsWxTCjgQRAH3r6KAC1cOdmNGae656jW3zyk9Lv2UizneWMWM+e+DsEBUrLX.MHXJTs3XTMnedLwEAbAiLKU3o3RAYkZGubfOF17fTVQHbugnVowlUg5a4Ow8c6m.G2Fd3j4MxImP3PHps6V6aWs6RwERE6UBmN1eztk8s12UyrYUox36.VbUZ0MQweBXNhzvor3kApwNntZ8B2s2rBWu7CmRFJEiDb0qhXF4hRa2JJsQlSWcOngffoprR7cLk3vo9TYe4MHN3lVXyYFJi+kuuAcWG7.iClDv8YwYv+Brtjy8tfMDYi.ev+EvGVA3edzPphpayMICHAEwhUb84f0P10vcl4M8svCYIWojQYYKSu.35MJecypM82dQuEEBC6ERAcXqs.IE6FvgaiyPvUrvDMycsOv9PcTtZKa9YyvEa2evKsc+9G5U1O3Oax998y0KKIAlWCWd3F5x+4ct6nSKoAT05iCzy8LJfNs0t2Ue2pHgqVTtNsFyH5V4LhJaj1P59P7Xtxad07sQE7EpK++lulItswmNaFySUP1l3y9k+siWqAU9IYphKt7bpJlq6DtHMbB7nCOFvDgfEjn6NZnayyk6pk0YlILgelveAeFktZYKiR2kJQgTuX46MSYzyz+xrU.NIxdNSK3cUfLY0USZdGBOz38dd5DwS.lWMhCpMhCqMhipMhmVaDOq1HddsQ7seBD5W08CoJYXdaArv3SytX1x5TAEppxp.Q+MfTW7S.
-
@d-healey Thank you so much, I will try this snippet when I get home in 4 hours ;)
-
@christoph-hart said in Lord of the Knobs :):
inline function normalisedToRange(normalisedValue, min, max) { return min + normalisedValue * (max - min); } inline function onKnob1Control(component, value) { local v1 = normalisedToRange(value, 0, -28); local v2 = normalisedToRange(value, -3, 10); local v3 = normalisedToRange(value, -10, 50); Console.print("v1: " + v1); Console.print("v2: " + v2); Console.print("v3: " + v3); Console.print("----"); }; Content.getComponent("Knob1").setControlCallback(onKnob1Control);
I've added this local variants to dedicated knobs and The One Knob (named Knob1) will control all of the 3 knobs with their individual value ranges! The best thing is value lineerity can change due to middle values of the controlled knobs. That's a very very good thing! I'm sharing the snippet. Thank you so much bros!! @Christoph-Hart @d-healey
HiseSnippet 1054.3ocsVEsaZbDEcVrWk.otpQJR80Qn7vRqwhkEml1npPM1tB4ZLI3Z0JUojw6N.i7ryf1cfFRjkxeP9FxeQezpeI8g1ma+.pT6c1cgcg.D3AuFg7cN2y8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Tt8Wrdys.8Bs+215M4FU6XdT2tTWUpX2173e51+5SnmKGpXhdmRTALn6vr0P+NvELcofRDBJWOk0HmtkL1th1VWY5PEdQF+G7j.ZqsMR.sm.h7ItAxW3FONRems6FsBnIQzUWyadp1FOc7oV2P2I6Ett5BQYP4KlQ0MlgyFyn1FyX+Mlwi1XFe0Fy3wqfg9V6e2PkzO9mEHz+Cgp7dO.
-
Hi guys
If we put an if / else statement to this code, it doesn't accept the values.
I mean we have a combobox and it has 3 states. Each state will define different max & min values. The One Knob controll this parameters acording to combobox selection that defines min / max values.@Christoph-Hart @d-healey What am I missing?
Content.makeFrontInterface(600, 300); const var Knob4 = Content.getComponent("Knob4"); const var Knob3 = Content.getComponent("Knob3"); const var Knob2 = Content.getComponent("Knob2"); const var ComboBox1 = Content.getComponent("ComboBox1"); inline function normalisedToRange(normalisedValue, min, max) { return min + normalisedValue * (max - min); } inline function onKnob1Control(component, value) { if(ComboBox1 == 1) { local v1 = normalisedToRange(value, 0, -58); local v2 = normalisedToRange(value, -3, 10); local v3 = normalisedToRange(value, 1, 100); Console.print("v1: " + v1); Console.print("v2: " + v2); Console.print("v3: " + v3); Console.print("----"); Knob4.setValue(v1); Knob3.setValue(v2); Knob2.setValue(v3); } if(ComboBox1 == 2) { local v1 = normalisedToRange(value, 0, -18); local v2 = normalisedToRange(value, -3, 18); local v3 = normalisedToRange(value, 1, 18); Console.print("v1: " + v1); Console.print("v2: " + v2); Console.print("v3: " + v3); Console.print("----"); Knob4.setValue(v1); Knob3.setValue(v2); Knob2.setValue(v3); } if(ComboBox1 == 3) { local v1 = normalisedToRange(value, 0, -65); local v2 = normalisedToRange(value, -3, 28); local v3 = normalisedToRange(value, 1, 28); Console.print("v1: " + v1); Console.print("v2: " + v2); Console.print("v3: " + v3); Console.print("----"); Knob4.setValue(v1); Knob3.setValue(v2); Knob2.setValue(v3); } }; Content.getComponent("Knob1").setControlCallback(onKnob1Control);
This is the snippet
HiseSnippet 1175.3oc2WEzaaaCElJI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WZnjol5LNj1GptLojnRlGRitQJ5FK1oKWgY6Oqbe6nD92rZCF03CMUCfQwY4OqxmEmZ80hy6utVfdUxm9.TYfdExALOOeZSQDSs9MyxKenH42QO+czxOZh7+jwy+KpMs7Gu9ctyusV9+PCs7imH+e5Mik++Xp4+Eio+eybtDRKz6qqB6WKNslFKBMXRZPjh4VksK6.WH4QEXCk4K754SjiW6u5BOoFTbUuHaUgzbXLLPen9E4BAyKcelYSlzsS97cgb3K7Y1WZ9ld8pUMOpcapqLirKYd7u++8tT4eUup4Qk2J5IY7qOkHCYpkCm0KnEbaSWJvDNm5qNPvXA0R+j1UUsUJSKJ2Ktw+BOoFsTsMRMZMzHJf3FJdmaxlepKv8j3d.NwiuGaIySUswi1uSwU3q.16bcUBwlfHlOB6BivovH1tvH1ovH1svH9oBiXuYfPcE986IEAIeVfP+GjEnFVN
-
Combobox.getValue()
-
This post is deleted! -
Ah ok I get it. Thank you so much... @Christoph-Hart
if(ComboBox.getValue() != 0) { } if(ComboBox.getValue() != 1) { } if(ComboBox.getValue() != 2) { }
-
How would you add to this so that which ever knob you turned, the others were linked? So the lord of the knobs was actually all of the individual knobs? Maybe selectable with a link button?
-
@duno You can link this LOTK to whatever parameter that you want like this for example;
Dynamics.setAttribute(Dynamics.CompressorThreshold, v1);
-
Yeah, I mean say if you have 2 samplers, compressor on each, and two knobs controlling the threshold on each of the compressors. I’ve figured out how to link those controls to one knob, or have another knob (the lord of the knobs), to control them both, but what if you wanted to select a link button which then allows you to move either of the two threshold knobs and it updates the other as well? Does that make sense? I haven’t really played around yet trying to figure it out, just thinking out loud!
-
I've laid out a script below that I'd use in KSP to do what I mean. Finding it so difficult to translate everything to JavaScript! I found what you've done above really helpful, but not sure about how to alter it to relate to each knob. Is the thinking the same as in KSP? Or is it done differently? I'd do the below twice relating to the two separate knobs controlling the release, with a button controlling the link. Be super grateful if someone could guide us a little!
on ui_control($knb_rls1) $i := 0 $j := 0 select($swi_link_rls) case 0 while($j < $Channels) while($i < num_elements(%CH1)) set_engine_par($ENGINE_PAR_RELEASE, $knb_rls1, ($groups * $j) + %CH1[$i], 0, -1) inc($i) end while inc($j) $i := 0 end while case 1 while($j < $Channels) while($i < num_elements(%CH1)) set_engine_par($ENGINE_PAR_RELEASE, $knb_rls1, ($groups * $j) + %CH1[$i], 0, -1) inc($i) end while $i := 0 while($i < num_elements(%CH2)) set_engine_par($ENGINE_PAR_RELEASE, $knb_rls1, ($groups * $j) + %CH2[$i], 0, -1) $knb_rls2 := $knb_rls1 inc($i) end while inc($j) $i := 0 end while end select end on
-
Hi @duno
I don't have any experience with KSP. but @d-healey is the pro for KSP. you may ask to him. -
@duno There are a few ways to do this. This is the first method that came to mind for me (I use simpleGain instead of compressor but you can use any FX you want).
HiseSnippet 1242.3oc6X0saZbDEdVvqSgVhhi5CvHeEnj5rfSRqjqUHfsiPw+fJ1tsJJJcX2YgQL6Lq1c1TnQVpuFsW2Whdmej5aP67yBrXiIPUZTsTlKr7YNmyLemyb9aocD2EGGyi.VENcTHFX8E1cFwD8a1GQXfV6ArV2tKE0GzXTHJNF6Arrx+BEOqBqAzq+5YMPTDyEOcK.3bNwEeHIfHlta65ujPoGf7vmRBxH8iq2xkyZxo7DINxa6.BQtCP8vGiThkyVBh88HBdTGARfikxzf6MpSe9OyLxeNIlzkhUDUAcjGjYaPy9DpW6w1XL.XsV6oVbdiE+k1GQ7HS1epkeOMC3TMx5CrxMKjVaFHU8lfzAbpm5.tA3YkAdqYf2F1cbiHghobTX6ysawD3HejzsmEVFYA49i71M4RIXhsBPCvGDIIlnQ4m537P3SbbprSohkJFg6AI5+S9LDKfuEEA8GB2E9pWK20e3qbdsjPGVrUOrXeeerqn7lcHAgTLTELrYEifUeeBVayJW4h5JXGRXCj5MFuRMaxCB4LIQ4MajHDbV0qo2.Fua7XLpILvb9mxKkBXNCinUWrnig43ycqXkHLQDm1DQockgmkU7Z1H6QtXoJUjvnDFF5mvbEDNCZ3U10nxCklEMAWoTw2UpHTtnbWDER7TuD5qXKByCO7D+wZnNUkfl+R7gkSclJK5b0gUtBb2cgNUfO5Qo.KFx3BnDGCvdF8RuM0R9BJuNsc7bgHhzMQfK6LFX6nk6Bi3XZLFd8CfGAKSj30YGHA9sovlhY8D8k67fGTYprYTa7cei27rhZ72FoMlYV.pAYVnpVEuXhWmyNlKvmvJWo36JVn3EEuJGe+4wJ0+QwQyiqpfVzBTqLKInKNZrAkJmLGe1hHqubEQbMAtYDjyZwHhSBwozSKyTcNkY.oQ9xBN4SAn7+D5xM2MsbSGJwCGAHxC4N15zGfF6oksqu81abIXoUt1JnrIiWqbA6zz+YTW2yAbVq8PBjplYp0HsvPbjfnbjV6geqrAjoBZA68vwCD7Ps4llnCrJ8dM3gSuvCqOZBQ8ypGKFodVVWKHHf34Qws4wD0qtRNKsf0tLVfC6P9EMx+8eSs9ymEjs44OdY.ZX1FmwI99D4N11PuF.eBMHVlOD1JP1ODXce6yj4cdXeTBU.iGHOJSt7obcix.tWpA6R5hopW5k1dqkwdcByXu+5GT68CqAdEuWV60dIBqlp7O0KiEC5UWfGJTFrpdpbzkq0VVNb.2KghDyNwfpIWJCkqIaqYU6WlzkMJaX7JLFgybGiXt42KIb2vtMQ31e93M2bvqLa6+Z7lNTVIayzCSA6Z1G7CeDl.KWFrbmIiDqmf4EigRI6LizbSSFqKxsGlhlw+88DOQ+LoC0myryV4WzztU+WNs6hCDT.GdqIv891ZG6sI.qe3u8.36Y2F8+g.huimHHrdGgj8HTMMNNIni7yDcwRnxXxoPk6YkSU32P6nnU.pCl4oI9a4JkYUEsUJypiYBVhL96lMiu1mR4+TJ+mR4uMmx+w3NBPtQ72j9s5pTyOSuiztY5eWqB1GongS93FkuQNZM4Mttpwc9Jo2Y9ZTak0X6UViGuxZ7jUVimtxZ70qrFeyBzP8y687DAOvDuK2n895OpzxZeFRF4pC8A+CP6V2pj
-
@d-healey Very cool way.
In this scenario, a knob (called Main knob) controls 3 parameters and there are 3 range options that are selectable with radio group buttons.But when you select a range button and start to tweak the knob, as you can see values on the fx unit are jumping. When you change the range, main knob vaue must be picked and recalculated the normalised values and apply the fx module simultaneously. This is what is supposed to be actually. What is the way to do that?
HiseSnippet 1286.3oc0X0raiaCDlJNpM1stX2hdnG5ABeRt0Ivxd2tEsHXchyOvXa9AwoI6s.FIZahHSJHQ4ccWDf8PeI1a8QouF8snuAsjT+ZaEE6hlhM7ff4L7i7aFRNyPepGyB66y7.ZkOepKFn8458mR4i5NBQnfd6Azpnexw6+piOYWSvtScQ99XaflVoCk50JuNP09qWtKxAQsvoh.fKXDK7OSFS3oROsyqHNNGfrwmSFmYzOqSOKFsKygEH3RI8l.Wj0Mng3iQxgslNPSeeaBm40mi3Xef156xrm1eD6MzvweAwmbsCV1wDzWLQghOf4XKYrTJn6Hhi8ow1rOPLKml5AJE5A9J8iH1jD4odhmnT.SQj0ensVQzyLK8Zt7zSKC8VOjdOUuukGwkmpQxsOSuGki8FfDaAYoU3XAqc4mn2kIFAku0XzM3C7DcRPX7hlMa.Ma0r9OUsR0JhMBeNbBxCdFhNDaB2FFicHl2kM1kQEcLpEptlD0bXZULlV4gocwXZWKjcYw0mL10AKOJJvpN2JQt+fAXKArTsIPITGBECGDPs3DFERYdiQNDgy5blZULRkbAxI.2.NlPEePusd0JuqZEnn4g4AdToB32Ama7vuEZHFLbSoZ4pdadKKidzN8N9J4sJoE6wbLrhM2FBKSLQxkStXpkT9gLvHzeKMQ0ZYTGt81Py5grRM5PDkS.pZNLKjCbhbebQ6cRnUJ1+etZ6ubFDsJBwllpCMK.pcQfLiQHAbqZSANm80p.6KwllcIuOKqUyU1zZ.auhVVSEFAnxEYcs+u25LWUqq8pabgHxXYILU9UbF1m4f2x0iHutNw7Gg0DWMlXpVj401JRaqb01NRa67ztonotKWtbryM8R9V9X9NbtG45.N1Hi7KI17QMhnCr7RfP9oQLCWhwuG1AMsQDoC8Kga+4GOK4xes5xoLJDPWjiy0hjdFKFcHL7UlvGGy33SnF0q7tJkqb6BZFLHOUQSlC1KOsx7wdE.yfFL9ZrWb3onwIRKMadO86NuW1zxVgNlLCjQ6QI7Sbwz6JaHHxaJSaGQJwP4prheQTVw9NDarGfXKSIl3FAJNGUswu+gO7muDbWSvtAbNiplfMzCC3NCZUwNq.5Vwn00TfWdjsmC4uzaODGIKJHxOH7MtXONQ5101COQTsUXIBk02C6eCm4JJbJ4XmvosTtp2lXn+gamoIcd+Ic.YlqMBmqpwEifnXmHxq9sYl4ATKy7.L57F48wDAveqyHLY3nzhDe+gctl4I3VexuNSAkgROCYSB7yJWqzhLqn8yLTClkZeybTCbwBTqSGWjmXcxtfwVrmfXrC8XAtoyvF440J5zRF2+q+3hasyxsgO7bawReEEfyrCbP7YqJWFBNRgHh0Lk+JKwk5S3Syd68AoT8kktOU+TB2ZT97csb3q338CMeid3SU8vJmSI655G75+suxI+Gg079dkyml7LzjzqJpLif69gnecGUt3zCdC5b4rmMOuSNOUUqzr1UokyttmGTV74.0yVdzbt8K0UN1GSDVsw+3gvOQFO7i.5dFKfSnCOBIJzUDwW+3fw8YAdVXAUoh.1xh7zVSVJSX+lwUnzGSsUc9aQKRooruVjRyXk+urFiQVdrqrBq2Rd0bCkDgcSU+mRk0OR1GlTemz2LlXStxxRF5aSg2IeDsVYDsWYDOakQ77UFw2uxHdwJi3GJ.g7uSam.Nab34c.3e.nZZ4wD
-
@orange There's something wrong with that snippet, when I load it into HISE I get this console output
ONEKNOB1:! expressionCC was not found. ONEKNOB1:! expressionCC was not found. ONEKNOB1:! expressionCC was not found. ONEKNOB1:! dynamicsCC was not found. ONEKNOB1:! dynamicsCC was not found. ONEKNOB1:! dynamicsCC was not found. ONEKNOB1:! vibratoPitch was not found. ONEKNOB1:! vibratoPitch was not found. ONEKNOB1:! vibratoPitch was not found. ONEKNOB1:! vibratoRateCC was not found. ONEKNOB1:! vibratoRateCC was not found. ONEKNOB1:! vibratoRateCC was not found.
-
@d-healey
Interesting...This is the snippet.
HiseSnippet 1292.3oc0XszaabCDlqk2VK0phjhhdpGHzIoVY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CwQxRBh7CBeiK1iSjtcs8viE0ZEVfPQ88v9WwYthxlRN1IbZKkq5sIF56caOIoyMG2FjYt1HbtJGWJBhhsiHu52FYlGPkLyCnZ62HuOlH.9asGgICGkVh3MG19Rlmfa8I+5TkSFJ8TjEIvOqbsByyrEselgZvrT6qlgZfymiZsa6h7DqS1EL1h8DDicnGKvMcF1HOu1hNsjw8+5Or3Vqrba38O2luvWQ42Lq.aDe5ZxkgfiTHhXMUwuxBbo9D9jr2duWJTeYo6i0OgvMGkOeWKG9JNdeey2nm8TVOrt4Txtt9Au9e6abx+IXMtq237wIOBMI8phJSI3VdFZ6V+09uWkKN18U6W9x1uZpyl278sy4gpZEl1tJrb10c7bxEeNP8nkGLma+bcki8gDgUa7ObH7ijwC+.ftmxB3D5viPhBcEQ706E3zmE3YhETkJBXKKxSaMYoLg8aDWgReL0R04uEsHkFx9ZQJMhU9+xZ3fL8XWXFVuk7p4FJIB6lp9GkJpejrOLo9NouwgXQtvzTF5aSg2IeDMWYDsVYDOYkQ7zUFw2txHd1Ji36V.B4el1NAblS34c.3e.zIJ6EE
This is the interface code:
Content.makeFrontInterface(700, 120); const var Range1 = Content.getComponent("Range1"); const var Range2 = Content.getComponent("Range2"); const var Range3 = Content.getComponent("Range3"); const var SimpleGain = Synth.getEffect("SimpleGain"); inline function normalisedToRange(normalisedValue, min, max) { return min + normalisedValue * (max - min); } inline function onMAIN_KNOBControl(component, value) { if(Range1.getValue() == 1) { local v1 = normalisedToRange(value, 0, 50); local v2 = normalisedToRange(value, -100, 10); local v3 = normalisedToRange(value, 1, 10); }; if(Range2.getValue() == 1) { local v1 = normalisedToRange(value, 0, 200); local v2 = normalisedToRange(value, -10, 30); local v3 = normalisedToRange(value, 100, 300); }; if(Range3.getValue() == 1) { local v1 = normalisedToRange(value, 0, 100); local v2 = normalisedToRange(value, -3, 30); local v3 = normalisedToRange(value, 1, 30); }; Console.print("v1: " + v1); Console.print("v2: " + v2); Console.print("v3: " + v3); Console.print("----"); SimpleGain.setAttribute(SimpleGain.Width, v1); SimpleGain.setAttribute(SimpleGain.Gain, v2); SimpleGain.setAttribute(SimpleGain.Delay, v3); }; Content.getComponent("MAIN_KNOB").setControlCallback(onMAIN_KNOBControl);
-
-
@orange Yeah the value will jump because the range has changed and as soon as you interact with the knob it will recalculate and apply the new values. If you want it to move from the existing value of the previous range then you will need to add the previous value into the calculation of the new value (and you'd need to know what the previous range was too). It shouldn't be too difficult but it might cause a headache :p