Inline Function too many arguments
-
Good Day everbody!
I think I found the issue of one of my buttons not behaving as wished, but I don't know how to fix it.A button just playing a note works fine, but if the same button has too many other tasks (more than 5), it does everything than that.
My button does quite a lot changing UI and sound. Is there a way to split its functionality to another invisible button?
Here is a quick example snipped.
HiseSnippet 2044.3oc6ZzzaabbcVIsJlLIFMF9POzBrPnGnPbjHojcJfaqnEEoqZjrXIYRaPfg6ncGRNP6NylYmk1LFFnG5g9un+CJJP+ADco2KPOjqs8Wf+Gz9lY2UbVFJJZZm3DGxCTbdy6812Wy6iYUKA2kDEwEHqBcGERPVuicmQL4f5CvTF5vCPVW29XbjjHbR.s+nPbTDwCYYs58U.rJrFR+446sO1GybIiAgPeBm5RNhFPkig1p1GQ88ah8HcoAFXuasCc4r5bedLHOqZWFEhcOC2m7.rBsUrQVq2viJ4hNRrjDgrVaet2nNC3Olkf+mPinm5STKpf5.LJAbStumRhU+FUe.02qUldGgPVuUqwVgUSrB2z9XpG8B3isF+H8FNiovzdXsxrDuJWs3UYZhmkg3sVh38d1cbEzP43cTx1aaeHCbT8vfKvTrRvEsxWslccNfAStU.9LRSAr3BJJcmxkukC70l2sXws2tCMHzm3fEB7Hmdbgib.w4iX7SiJB9nHoyPrHYsyuz4yxXaehrNOHjyfEk1PsckM17VEzeJp95xQrJf3UfxNWMJ6twlO7tFRXid8HtRsLpCq0jnrv5Uk1nCVolhJYbtvrvp5WGqD9WZiF+1JW9lsICIBkk3gZS6C3h.ruyojA3gTvxR64vY9izV3nDyNmsMuWOmdwLWIkybnQNCvggDFk02oHk4SYjw6xY6GKkbVEkcQv8K4lYTtEXD7iIaV7oEKP6UJcQAXUpTF5iG8.tT48ukSEsyuvyJVf3GQRPqAqO7r1B66qPK5jd8Jkfyy.cY59gTgYiM2JRAWKR0AFbJbXtzjxpJZSaSjNJYQoeJ6.CdXJCC7agJJj3DfYibvZENZ6Pr.RI.QtQND1Pt+PhmSo.Nflb.l4b6MuTaT0YZif.8RTHXo7ccnN+Bmcg+79u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GrLVnyLeu.HRTlKS7pKzLS4KPYf+IPr1PJ4wlYHthK1ZsWC261q9pfu7EsWc9D2q3pAKjIiIWcWC1PhOLPjVFuALAjtekLn4SLdLmwCGvYTWyHj1D3vZ+9DgorOUE5dRIjsyLsTahOAaFs+ypcDDkhEfchrf1hJyusXV9qerch35nN457lQyVq9FTyVk+Na6F+zD08F1cjPEcnjZ+zKFVqyEsytL4bsAufuij4u.CzLgOG6kMeSBZPGhvDLDQdn+sZ5G0jECBqkJ4sIgDrL+QzqUqc66C8wDNIUP2Op.Rnxl6Y45S446cBTzc.OW4l5BdTTOPcz7JWEuVwh9Du7YdfhIQ4gA9VSupURoRU7D0MK.XL15mR4tXcLELTldckIVWch06Lw5cmX8smX8clX8GNdchA8XbnJxP8hql3FJu17klCXPKLnxFXtOs+ELOAxkVR9BatVtLdMYWQc40WVW90Uc4cVVWdYc4u2WWdNMcWOshoSxLne21O+N15b7NpRxutD0uM52wMiUftk9a86YwZUxE2dzJ9PAZeyPZi6KcA5Xp5xNlV1wzxNlV1wzxNlV1wzxNlV1wzOv5X5aCoL.6J3OxM4+3FkrdMMDPJY5WeTA6iUqct3+PHa6xaUV8R0oOx0UcP3CpfPSmlpK.M6r.zr6BPysW.ZtyBPyGt.z7ymIMp1DtWrjGjjjD.zpQRfkkwKxE8+Ao6mBkB
Thanks for the help!
-
-
@VorosMusic It's the Sampler.setBypassed() that interfere in some way, if you instead use the Sampler attribute "Bypass" it works
@Christoph-Hart Actually I have come across this issue before when bypassing modules using the ".setBypassed()" function, it seems to be a bug?
HiseSnippet 1982.3oc6Z0raabjDdFIMxgLYMRLxg8PBv.g8.EhiDIkryB3MPzhhLqRjr3Rp7GBL71ZlljM7LcOomdnMSfAxg8PdKxqP.xCvpK68EHu.6tW2K9MX2p6dFwdXnnno9I1AhGnXW8eU8UUW02ziZwYd33XF2xtvgCivV1ugSmgTQ+58QDp0t6XYeSm8QwBL2UKZ6gQn3Xruks8hejTfcgkrTed9VaiBPTO7HQVVe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Lsvnq9oAe41O+FNpT4txJu+ZopWEzZ7xVJv1R+s51qsWDexc2rP.TGNvLjNFHUHUInh1bPLp50DitlXzYPLZ4KIhQWk7et95Dtlyy0WmvqdWmvUDelKcE77wg4k6qi47ya4pPKCQdb1i7z+2DH00WSIAzRp50oTvYeYa2S9uevwo7ZksBgZLOxySFj+9Urrl7bpNGyYi4XNaNGy4Nywbt6bLmOXNlyebpyQVd+9IBVnNoGHnUCcfkswKyz5+CbR4HE
-
Inline functions can take a maximum of 5 arguments. https://forum.hise.audio/topic/79/scripting-best-practices
-
@ulrik Yeah!
Thanks that really works!
I've the same feeling had a few issues using .setBypassed messing up the functionality! -
@d-healey
Yeah, I read it after you recommending it in my last question.
I mean it kinda doesn't matter cause it works now, but what if I had a button with too much parameters how could I split its functionality? -
Ok I just looked at your snippet. This is not related to the number of arguments. Arguments (also called parameters) are the variables passed in to a function. In the case of a control callback that's
component
andvalue
.There is no limit on the things that can happen inside the function/callback.
-
@VorosMusic just use variables?.
reg param1 = 1; reg param2 = 2; reg param3 = 3; reg param4 = 4; reg param5 = 5; reg param6 = 6; function myfunction() { Console.print(param1 + param2 + param3 + param4 + param5 + param6); };
-
@d-healey
Oh I see, didn't know that -
with inline you can still pack as many vars you want in one parameter:
var test1 = 0; var test2 = 1; var test3 = 2; var test4 = 3; var test5 = 4; var test6 = 5; const var sixPack = [test1, test2, test3, test4, test5, test6]; gimmeSix(sixPack); inline function gimmeSix(thatMuch) { Console.print(trace(thatMuch)); }
-
@ustk generally I find if you are passing a lot of variables you can probably simplify your code
-
@d-healey You're absolutely right, Dave, and if I give this possibility, I don't rely on it myself...