A Power Button!
-
Hello Music Lovers
Trying To Make An "IF" Statement For A Bypass Button, Which Will Work Dynamically And Can't Figure Out How.Here Is The Scenario, And Yeah Your Help Is Much Appreciated
Content.makeFrontInterface(128, 208); const var A = Synth.getEffect("A"); // Simple Gain A const var B = Synth.getEffect("B"); // Simple Gain B const var C = Synth.getEffect("C"); // Simple Gain C const var Power = Content.getComponent("Power"); const var Gain = Content.getComponent("Gain"); const var KnobABC = Content.getComponent("KnobABC"); // This Switches Between A, B, And C inline function onKnobABCControl(component, value) { switch (value) { case 0: // This Enables A A.setBypassed(0); B.setBypassed(1); C.setBypassed(1); break; case 1: // This Enables B A.setBypassed(1); B.setBypassed(0); C.setBypassed(1); break; case 2: // This Enables C A.setBypassed(1); B.setBypassed(1); C.setBypassed(0); break; } }; Content.getComponent("KnobABC").setControlCallback(onKnobABCControl); // This Controls The Gain Of All 3 Modules A, B, And C inline function onGainControl(component, value) { A.setAttribute(0,value); B.setAttribute(0,value); C.setAttribute(0,value); }; Content.getComponent("Gain").setControlCallback(onGainControl); // Bypass Button Should Obey KnobABC Then Bypasses That Module Only, And IF We Change The KnobABC, Bypass Button Will Turn On/Off Another Module inline function onPowerControl(component, value) { //Add your custom logic here... }; Content.getComponent("Power").setControlCallback(onPowerControl);
HiseSnippet 1236.3oc6YstaaaCElJ1rqVctncXO.D9WN.YoRYsaAMnnwRNovnKoFyYca+pfVhNlHRjFRTI0KnOHauI6e8QYOB6MXiTWrjcjuDOrgkMqDDHdtP9cN7ny4PltAbGRXHO.nU6rwiH.sOE1aLSLzdHlx.cZCzdH7DbnfDfRHYMdDNLj3Bzzp7JEAsZUAwO+9KsvdXlCImD.7VN0g7MTepHmZ2CeM0y6XrK4LpeAoe5gcb3LatGORhmJPCvHryE3yImhUhsEDncuiboBdPOAVPBAZUs3ti6MjeEKQ92RCo88HpAlfdxIJg7wbOWEhUuCrGR8b6lY2g.4rzM2KTIwK74vSntzIzy8FOJlAJWih9CssVD7LKBOiUGdZEfW0D38XXOm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oiUTt7bR0iNJ0YqLl8jlR5EpKUDXWIX1YRZmzmSIcnfPficrCJzkMYIrubiY772ZGGTl8ta5MNimMwt5IJM6kxhOtv0ExW3lBjoY0sal7hlLAyOS1lpU9ySwhxg86v7iichEDRamtt.d10ERV1xMzujPPkrojqe4.lbVUKPQNSntQtHTAuosUMdPTUiZC0ZkDwghCeB1leAYAbxR4nYobaA2CTvnbdbzlvzpGAiaQ86gs8O7959iMaP0TSkuHiALvALeM236bZvtDZoHrNXdbCVvEZ0.q0FE5.t6a0d+0jK3noP934I+BX5yZlNtBbf.Tt.tAOv0moYn9zjBWAZpZPa9ukxsGLraWNHEFS7pg5y87DrVp.tINapsmwnrvs4gmADqbVDDMdQWdGl.VvDqxu7tz.FMEf+8291+XAA7NuC89Mw.sRYRYP0o6ux.4HFl4HYiLllUjvbOJoq3iRSWKJbeDtEW61Ka7tVF3Ehp+Xi2nVX2.G1MxDvtN9vedY6WM61oKkU+p4Rfk6O9RE1N5ddLTxgqNmaRfPMXBZJu1Ow8z8RDaVIi6ZzTdIjknkRP8m1mmKsglawLza4tByOvv1j1cl.4OGac42k.rMj3tCfeHtE8eCAD+fZnFZB7XJzpsIw8IC62FtvsKCfpTxDl9SbVyTHLbbIyXCfZyjd1A+E7DwrrYrSDyxwLQKTFfZoxUtJCvpL.qx.7+qL.0WkAXUFfUY.9uYFf+IVi9TWe0abC+VClil22RArao8mLHO9XyXR43ux.FWZ6Rlqoxeiqq4FQeI3exVmcVBc9pkPmmsD570KgNeyRny2tD5r6b0w7qmTcnV0OL9GHz5.6W6ww4.6GSzdT.82XDGSTC
-
@dustbro Thank You Sir
But What About The Power Button, In Your Example Power Button Does Nothing! -
@Natanr What about like this:
HiseSnippet 1195.3oc6Y0saaaCElJNrq1atncXO.Z9JYfr.6jts.DzMGamTXz4Ti4trMTDTPKQGSDJRCIpz5EjGjd2taOC6t7Hs2fMRJIaJG+GLZGVvrxMg7b9n9Ne7nCORtS.2EGFxC.V4e0ngXf0mA6NhI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lc6mUlU+c4L3xCG2DNweHE+7TpjCdTFkxny6ZpZ.MwTTFU6mIdhAF4l0lQu4sXWIqRzgSQASq44xFn4Vs.cI8Vu3DCcKa2aRj+bnVxuOQXcJw8GB+XXGz+ERH9QdjfvtnMR1jppv8oQ9ckufpKVRUFCSU8mXsk5fv3wUTiUDpKl4oG72xqDiUUisRLVM0HXkp.TeSEfMU.1TA3+wU.ZLuu91lJ.ap.roBv86J.+abO7QtA723F+sFTOZ9P8Lx3lo+D64gsUisql9UFfvJ6VQ8Zpj235pdinuRpOyFydqAl8WCLOcMv70qAluYMv7sqAlCVHF0u1vQQBteb9ubhNGq+ZOVVGyPxLY8iBf+AHo145A
-
@ulrik Excellent, But One Small Thing Is Missed
All Power Button Bypasses The All 3 Modules And Remembers The Last One But As Soon As You Tweak The Selecting Knob ABC, The Gain Module Unbypasses.
Any Solution To This?
Edit:
I Mean The Unbypass Commands ( ABC Selcting Knob ) Should'nt Go Through Before Power Button Turned On!
-
@Natanr sorry I forgot to use
Power.changed();
So this should work I think
HiseSnippet 1204.3oc6Y0saaaCElJ1rq1aoncXO.Z9JYfr.6zts.DzM+WRgQWRMl6x1PQPAsDsMQnHMjnRqWPdP5c6cXWsKFPdj1avFIkTLki+CFsCKaV4lvye567wiN7H4NAbWbXHO.XU3kiGgAVeBr6XlXXygHBCztEv5AviQgBbfcrnFiGgBCwd.KqbOSIvpPdf95O+1FHJh4hmHB.NkSbweGwmHlHsSsmSnziPd3WR7Mr9I0Z6xYM4TdjDO4fU.iPtmiFfOAoLaKHv5dG5QD7ftBj.GBrx2f6Mt6P9aXw1eJIjzihUKpB5JCTr3i3TOEhURAMGRndcRy6PfLJclvB4hYgOCdLwibi7IrwC0Jrm3gIeXs0hfWUS3UY0gmkA7xGCuGA65FPFIlnQgsOF1lI2n5ijaAlvJ1VvV+QdXStzBlXWez43iBjKtwCmp6s+N16UY+xGrcQ0exshPg8En.a01bn8SsektxX2AXwg86icENkpWp7NaWz91W2xxFqrkMKU9r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yg5u1ik0gLjrRV+n.3uAqFF7GA
-
@ulrik Brilliant , Excellent Works Like A Charm
-
@Natanr I'm glad I could help
-
@ulrik All Works Fine Thank You Man
Just One Last Question, Can You Fix The Unpassing After Hitting The Compile Button? -
@Natanr needed to set an if condition like
if(Power.getValue() == 1)
HiseSnippet 1223.3oc6YEsaaaCEkJNrs1aoncXOrG07Sx.YA1YcqAHHXN1NovnKoFycYanHniVhxlHTjFRzo0KHeH8s8ar2xGP+S1K6OXijRJlxQ1wvXcXYyN.wgj2yUm6gWc4UJcB4t3nHdHvp3KGODCr9XX2wLwflCPDFncKf0CgGghD3P63oZLdHJJB6ArrJ7L0DVEWGn+7GeSCDEwbwSlB.NgSbweKIfHlLam5OmPoGh7vujDXX8Sp21kyZxo7QR9T.VELD4dFpO9Xjxr0f.q6cfGQvC6JPBbDvZ8FbuwcGveCK19SHQjdTrZPMPWoihm9PN0SwX0rflCHTuNowcDP5kNSTgBwpvmBOh3Qtd9IpwizKXOAgodXs17nWMS5UcwomkA8VOldOF10MjLTLYEE29HXalbixGI2BLoUrsf0980gM4RKXhsBPmgOLTN3ZDN01dmMs2t5NU1ciRpejaEQB6yQg1ps4H68rekNyXq9XwA99XWgS48KWYyMJYeyO2vxFKrkMKW4zcyRfN72Hy+1yNk8RqaxCFxYxANk0qVVQ6rTdl.TKNk8Omw6seilyDRx5kSEGBiRXXa+QLWAgyr4LkSUXC4TG2TfaJcNcDtxFktHN384gN8skbSqoUhm7hIBS+shvh8EhPRuQBrS0TGrq1hK2nzkZBLu3R4gDhzDQo8j2B4jgdowPdQgVKu8vPIYDlG9sRAKQZTb4DkUNJ+uvwZZdpiHzLLUeog8J8k4zLl94IZx7Uijzh7kCy3b16oIg1eSaqyITI9NZFYHh16smcsa5oXQQe4yJJ9HZzTdM92wN1c.h0WZlzhKmslccZd9pVV8PoaFh0wbA9ELmJktnTwRWVxd5k78ycsDmQwg4tr5Dhv4AzgMJnGNLcKI0PYoxr0hgytVr4QEtw5hggbVaFQ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