Inline Function too many arguments
-
@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+58QDp0t6XYeSm8QwBL2UKZ6gQn3Xruks8hejTfcgkrTed9VaiBPTO7HQVVeFi3g2iDRDij1p1mPBBZh7wGRBMF8l010iQqyBXIf9rnSYqHj2iQ8vO.IG1BNV1K2vmHX7NBj.GaYuz1L+gc5ydBUO9OiDSNJ.KaTwpCrPZwMYA9RMVJ0pdeRfeqL6N1xx9FsFgBKpQg21YehO4D4iPi2T0g6nYXhG1KjW8VLm5UwT8JandSPkrMTokzpza4zwiShDi5QpOutytTv4zEAvtopnGq0B+2kbpyfQPEqEhdLtIGZbxLJc2xkusK70p2qXw0WuCILJ.6h3bzP2tLtqnO18SnrihKB9kXg6.DW218Cc+prksGVTmEFwnPiRqH6txJqd6BpOEkec5CrJLvyXHab1CYyUV8g2yPCazsK1SnzQUnrZJRDV0pzJcPRyjWIakKLsQU8WNJ85WZkF+kJmdmswCvbIR7PEz9.FODE3dDtOZ.APVRWWFMXnBgi0vNitNqaW2tITOAgQcIwt8QQQXJg1ysHgFPn3Q8xnamHDLZEItvYAk7x.kaCfPPBd0heawBjtkRaT.ZkpkQAngOfIjd+a6VQ47K7rhEvAwX8vZP6A60Znf.4vhOna2R5w7LvVlreHUYVY00hkxUpTcXANBN.WZbcUFsovDgqTWj1mDGnvlIAF32bYTH1MDQG5hTFb75QHNjF.hbicwzArfAXe2RgLXXh9Hp6cV8TwnpSEif.8RDHXo78bIt+I2Mg+7duWJfoB1+JxCkVUoUFnO9t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OHXCwAbBOmXQkW3avZh9qeuiVcckG.ce0kCzh+llCzUch+2Uah2xoi.J5BU85kdebJ6rnS1c3cQbczydM.nde.C4av7Wxcq11IfefmW5OVSsUimuNpVpl2FGgQh7G+dsZsa+Q.UinwmEPPQF3AEe7dbNpDOeqCf5h8Y4pHTmyhi6BliZsxUTpUBuG1OeVEfaQbdYfu0zqZqqlIigHdYA.iFsZWJeHREGsfitckwZWcr1aLV6MGq8cFq8cGq8GLpsFP2GEIiLjuifwtDnaLaovfEnEBLYiQtMo2IKtVhYUySfYkpX7RHlPxvkurJmtzrcfd5U6+Mco0Mttz54uz5UZX1EPY1Kb8c9K4dkBc2Lsvnq9oAe41O+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...