Horizontal And Centered Pan Slider
-
Hello all! :-)
I needed a horizontal and centered panning button/slider. I am completely new to HISE and didn't find a built in solution so I scripted it myself. Please feel free to use the code if you need it. :-)
All the best
Oli / www.studiobro.netHISE Snippet:
HiseSnippet 1692.3oc0X0saaaCEVJIpq1caXcnEaWrK3L1ExcINVtsIEHanwwNt0nw+fX2zBLLTPKQayFIRAIpj3Nzmsc6ta6QXOB6MX6PJKaoF2rLm1NTi7GO+wOdNGdNGltAbaRXHOPSOW+I9DM8O0n2DlXbswXJSqYcM8uw3HRffZicQcwLFI.0mDJPkqrQ4JZ6MwGGFRbzz0W8QRMzysll5ye8v8vtXlMYNIMsi3TaxATOpXN0t69DpqaCrCoO0Kkz2a2l1bVMtKOBP2pFk07w1GiGQZikhshgl9012gJ3A8DXAITSes83NS5MleJKV9ingzAtD4BKsdfghI2f65HQrjpVswTWmtIdgPMMcity8IqF6StkQKpCcF849luPw.MWiz9C8UxBuUy.OqzvqbJ3s.HomBRqECoaZzyNf5KlyQhmaXzjIHACwfaOMThkUake+ZF03fDLQIO7wjFAvhYZXtU4xqifeTbm7atYrJnASPsJg53ROAB7O000CRA.tmd5okBEQNT9f.dIFQ.zZDPHHAGEER917427Na.epuesCpdX09M6zt2FWgO2YSXCpEP.OI5.tLW7.N+XTUlCpAg3h5L3kDaQdHgARMOlwGnX+injSqsRUklRNfdR0LKletYk1pIy1MxgfdBXAEgdDwh2oDCicbjBaVP9SqBqipHchUTNwXzbBNPYOqTvYDQTi64yYvhDUAET+QoPh3b.M4HABAHNAlOCeBYHOvC8HBbuDC4Zo1yDly3IAf5tsZ6kIYpUlENuYTnA1nivATLjiFlWZQeL6HraDwZmrK6S77iI4RYjmCaS4cRR.dR6N6g5se+9Ma+ndWo3+LmSKtCwr.TKJiKqmXhKP9w7.5q.uL1MCWyBdTFDc1vpT42fN9Lf94HGJH98nuh.7JWprUwrGntUa1tOpwSaWSlYujGnjXZo.xHJreAMhX1BJmYVvI.e5AfuDGzyk5PB.TLLg4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Q++GuOjGIfmbzBCUCjCI1NxqGzyzl.Hlwfm0HmWbE4vtwqKKWKgSOByQs3ugOSYZIWqOkoUByOH6gG1Nf+B63wvkELtthBbtYp+6f4LZIWilM+sgA7fF4DuzWXaKyo2.7OKVmJKgN2cIz4dKgN2eIzYqkPmsWBcdvEpirie0HA2KN+GHzce06fz0iG5QcUP6e.wSHwv
-
@Oli-Ullmann That is nice, however there is a major issue, never set a parameter from within the LAF function ! This is not meant for this purpose, use instead the slider's callback and it will save you a lot of troubles.
I took the opportunity to simplify the LAF a wee bit:
HiseSnippet 1350.3oc0XszaaaDDdokYZDSZQSQBZOzCDF8fRgifnRhcABB7akXD+PHx0o.AAAqHGIs0K2kfbosUJx+k9OoW6wdtm5Og9Onc1kjVjIJttpItHBFFdmW627XmYj6FK8gjDYLwp9Aii.h00s6MVnFswHJSP1dSh0WaeHDqX9TtaWpP.wtG.IJ2VsuSq1j0GGQSRf.hkUsGo0vp97Dym+bk0obpvGlPhPNTx7gcXgL0DpcW8ILNuCM.NfEVR56s519RwFRtLEQWM6VjHp+QzgvdTsXyYSrtxVALkLtmhpfDh07qKCF2aj7DQl7GxRX84f9fGoGZnLxcj7.Mh0TIaLhwC5VDERHDK6tShI0xhI2zdWV.6L5ShMetgg6DMJGOrlqJ7pUAddkgWqRvaJPxpDjlOCR2vtmeLKRMgiFOWydagBhGPwvdYnjIKYtqWydCIJgP0LjdDzIFOblFMVpUqEcwec6G333fwdLKeLM18YzigAx3vGAXxmhNjm6CcMEIMGBJCZMmZrPgjtSDcAzXSL0SDx9ZsK.gVeYXjTfGZrfgqVgbMNBOuiTdTIE7iALXtiDqF0bVSDzA.dCTGixMS.0awrvLF2xo3TyXXHKAc8NoBeESJZrPPL8jcXBfF2iyBf3EVzcPAygK5J6+i214mbpqcDJhI7bSJhmG3T2o9vlCvp3037FYUrIM6ywx0aaXp03zbMNlxSg8vfDkydED39stzm29E41HQGOzpelUNYDSAZqLrYA7Zb5ht3OXth9769hEc8Z0Tmxdcl+wDbTly.tqTXhL5.Xrj2vuHbunqAIFO5syvZjrlREy5mpfFdEBi2RoHctM2fx48QesQ0qJCNNNkPxdRErung4Ncdsi6axZvfoxK2fbHdpr0sMhOOEaHRC6Cwk8Xsf3aopOPse2OPK2+vOqVrjfRw1BlZ+HP7t5pPxKf0OlyQEJpx7T9yxeJmUzQX3K1Ow1DIIF.m2R7mid3uuB462dSphVXFzh3sDo6Oqc.qMgiwFrYcHpauIjbjRFYjMOqisH9GuzSwHg0uh233h+HQMlaFM7XYL6U38R4jPVP.G5JSX5fc4l7gUFC7KIoCFvNUGX1gDJCP6XaiCRHIX76Ps+0UFkFou905KOFHJ3TUQWeGaukVd4ka6cebNwa0CD69JCR45B1xsj0ygxYnQV49f5dcBDwiKOm58Ve5KJDugcWlxezzw3bSAiX59CAFymt8o1aMX.3ql.v4s67CeXFkU95uU10eMac6GyDDykeK6oLF4bVz32diEMLuSl1hFQW3EM12WgP3fXpHIRl.dkyDuAu1k4sInREUEOiTEoztWGz8JI2UWsfX6xDwmIULFdthk1U+tp33erxVBJlD5An2DrehO5r5XW4R8to7D3Yr.0HuxJNgb6xjeLMVOY2uRgXsyamKuYbmqq7gZmq4uXEpmO79Hn0SkUDqWfwdrvHNrk3XfiCILX7KvoBCnobUA0pOs1UJjQijBVkj9SAbSfgCgJ0RS0gvcFvMAlP4lq9TfCzjRO29lUy1wZWyrfYJV38udc4olu9J6L35p6G39eIucoVlctiOpcgFe7dGuy9njK4WnXKyOdxzeoM1FusqIc69+e99oxTESLbWJ1MPuj3dog8vYl9.hXg.35UnslSura14V5yZ3zCDAlC+E9Imom9rUNSuBlWJ2QH0OV9R+r0v0MLtpgB52By+Zg516pO6d192113WwRuwK6k995Z56fwmoqS6YPm6NC5buYPm6OC5rzLnyxyfNe24pidh+ZoJYXV8ORn6VluGjkU1ROlmBj+FPk3ZQl
-
@ustk this is so much easier and better! :-) Thank you very much! I did not know about the valueNormalized function. With it I don't have to calculate the offset by myself. Really cool! :-)
All the best
Oli -
@Oli-Ullmann You can
Console.print(trace(obj))
in the LAF to see what the object contains ;) -
@ustk thank you! That's really helpful! :-)