getCurrentEffect().exists()
-
This post is deleted! -
I just tried it myself and I'm getting the same error, so I guess we're misunderstanding how it's meant to be used... or it's broken.
-
@d-healey yes it seems to be broken
here's a snippetHiseSnippet 1025.3oc6WE0aaaCDlx1rn1cqXcqXXORTrGb.5RsxZ6JvvPShicgwZRLhR65aArxmsIhDoJEUZLF1+w8So+C1NJIGI2o54psfATL+j4c2G0mN9c2QMVq7g3Xkl3z9zEQ.w4yndKjl48myERxnCHN2ldHO1.ZVlo8WDwiigIDGmlOyZvocKR5u28z84AboOTXhPdoR3COWDJLEVGu6OKBBFxm.mJBKE8C2cjuR1WEnRP9zj1iDw8OmOCNhaCqAk3biASDFk1yvMPLwo09pIK7lqdqLK9WJhEuN.rKbId3FkYdnJXhkw1+S5OWDLY7x26XBwgNtHKzLKKbW5ghIhqrWjM9hTGrBDkyGNMVG8bqI8bJQuVYz6NTOesHxT3wxsaQGIwCpob7HnLsxhkzf1f1WgQHMaGxOGFpwEWgn6i6069rG0q2V+XG7TH1vtfqYClNE7MdAJiK6mXoJismAoFF9pt2KyMK0+89..2oLvLyqCHa5kHfROWKr9IZMR6bzX7O3AsMyEwr2hBIlOpOYbICzZkFcgujwp.X6HsPZ5VdqfKEwl3tag6.FGiGDqX18YMf148.09CCZ5kkhcZhz2HTRlRdjx.GK6tUmesS6N+VG166Z5zJ8YOqzpf.PWoaasidc.6JSBeMnuOlVCRfqBDEQqpRuwloR8yjNkBTIGIEliif70E5X2JzwjbsG9uWL5.tgak141v3h.sQXoiyAvEXOiLgda5AP74FUD103uTEf0hpIIAbypEn1tR4Nv7wJUBV0tLVXVTtq0GQUauJqZq7scCo6cniEF+4Uy2FUvWLqccy27dfeNMqJnfrsnCeUca3UOpb6LpbKpmPBocQRIxWmtl8K7K.1y.InsIU20La522zYSQa7roi8M3i+TMWFGohWYi8fPwoJoMiTX7EwXGW3MmXOkKauuhqqz06d5P7krRLdbShNUtrWnJQZVQdzrVyHWspozYXESjZ8ev.y+8K89m2on4lQ2+lY5sWxQOQXT.LPdADfsCS43Wh8+lxSBLKstpH+PkTEMWIE9kU.m.FsX1LPWl6U9Bsmwf2vpvxc28DH.3kUye6tOGUgbMlmfZlKb27bw5Nu9FZFcY1JS1mFc3a9ITG9Zdk1btbSZ1kJy+lixWPbUB075P20b40MFDFYVjyhupLKNK0y0CUHmnRLB4rC4Xg6k3GjbTRnGNnwGvSFoDBvMm5zvNrHacO65rIMxIoK9C7WtSW6ZmbmtKc9+OiOhmQH2WqNyO6dzVsxMSsfmexzOEsM9Mw3ZlKI8t0HNZus6QBwIcm46aKi9NrDrZL6TCLeeMv7vZf4Q0.yiqAlenFXdxZwXujwdIFUXVKVzv3Aoejgiy.IGqBSqXI+IvvCWNO
-
Doesn't work with midiProcessors either. I'm guessing that the mechanism behind the
exists
function, which is shared by a number of scripting objects, is broken. -
Not sure, but it might be because this is the only function that is declared inside the class and has no wrapper... ?
-
@ustk I noticed that too.
-
This post is deleted! -
This post is deleted! -
It seems this is still broken
I tried to check if a modulator exists and got the message
snippet
HiseSnippet 961.3oc0W0saaaCElz1rn1aKXcqXn6NgdkMVmgcaV1FJFlWbhGLV9wYNqa.8hBVJ5XhPQpQRkVigc+taOb6EYuAaGJoXImplZXzBjpKDz4vyg5ime9NRSLZF2Z0FDt4oKh4H7GRltP4lObNUnPi2Cg2hbH053lfLU6tHlZs7PDFW+G8JvMafRu92ueWpjpX7BUHzSzBF+.QjvUncxfeRHking7SEQkrd6AiYZ0PsTm.3oNoGJlxNmdF+Hp2rZDD9V6GJbZyTG0wsHbic0gKlNW+BUl8OQXEOWx8B8QSgMJS8HsLziX+yngyExvIWdtsHXWlTDEpmEEtK4PQnXo9hnwGmtPPgGkiG3ZqBu5q.u9uN3UAjvkfTiLHcGxTlQD6JVwimOfLVAImYTHrWFJY1hp0ASFpAKTttQzy4iLfvROZuSudOH.t04wsZAgdqK3BpI3fQGenNLQRgiR+fuKHsfn6Yb2RssuOXSPgQ22uAv6wpk7twFgx0dkMoK+kBqy1tSmGOKQwbBsJPqNR63GqZ2o0ezpYq+rUvUWZ1rJWyedLZojapbYeMk45brsJI54byCfypLguzPHPuZ16VqW1ikEdKYnVMVIbGGyykKJ+5WQtFkmefm9kw6QcTe5OWGXWL23Dd3f2ieAzKkULzjrG2dtSGCcSuRkBTidYjubgquaMeAHdrR0huhPYEtEk6luZ0biWe7nWkMaUdZWS3dGxDgiMuZ7VqB7BQs203Mma3iH6OaFm4J.aCxne6ZIBZrdkRuAdpxjB4r0eBYhVtHdtVIXiDRnuNEPMIYB8uF5ZDZjg+6IbEqHJ9W+yfSJWB.g+R7y2avIIT4Uh56Jh0RpYsxHaNeXi0rr4yHKOTAuip02vD1VYnlP.hw7FxU4Peyf7UyWnaOvOFcbQZcveO3WoWvmoMQ4LEKc+.9YvKprlS4QwZfcmUNoMMRqcyEpyVc37cGbfVGuuhBggvxaxj4Tqmq1xck2lgIVmN5RrjN8dpiGmRvgeJYms6BWy9B+8ucHb6QG+1Q9sXQWs0rn6SSyjKSY9b5Mb10LDuRqxM94Ad1qf2ale84jbhwzn76O3dKxI2..6OqSb.CzgTmQ7Rfz7njnovOEv3.PUJtDdQDbMOKSlbOubJ4EWElJ7evU9h88x37E6e4hnHJyneFK6aB8s62NUCfIU5uazD9uGPNnOJ86D8T2851CEAe9+yXL+P+uDvd097vMvmGsA9r8F3yWsA9ryF3yWuA97MWqO9+75GRfoJY0lfhI6mMOAubtDtN5+AxDj5l.
-
@ulrik I don't see the point in the function because if the modulator didn't exist you'd get an error on line 3 anyway.
-
@d-healey I don't understand, so how would you check if it exists or not?
-
@ulrik I'd look in the module tree :p
If you replaced line 3 with this
const var LFOModulator1 = Synth.getModulator("LFO Modulator2");
you'd get an error. So it would never reach line 5. I assume the function is perhaps for use with dynamically created/deleted FX but I don't know. -
@d-healey I still don't understand what you mean
take this example
HiseSnippet 1638.3oc2Y0sbSbCEd23HFVSgogB8m6T8zKbllFrCTZ6vPwDmXpmleL3TncxvvnrqrWMQqj6tZCj1Iyvs8p9dzm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K4qqsS29E8bNWylMegVZJhPHfVzhonAoZrjVk4latWjVH8PEId2gErMqYoKTm0AjIlqPgtXfHho12LbLZgrYmrBYGec1IEtygRX7GOdmYL3Ex7Nqwa1wBtHJsR3PvNKpw2ermA3DCkW54AxNr1kQsj7864KEL2T51D.4fx3dOlSpYYoIlioB2AQw+7e9kZ22LE.B+F6PVr18iI7Qh5Ky5I4jvIZEovjwkMlo9rSXZy6iFLovmQ45UmtErKkh5z8xZnl9+doH6PKRZ1K8wlaNbsr1uV6Qj8ncjgAYTrCLeMZWHBYJYKJvnAErcMWoZGHkJelna9CiekZqIk8VUPf4tmoSZ4ShzkFg5sltodbjRFzGKImVuMPzlTYvdazMuwhvmNep96upN70027US6WgYZyLgYZumd4COXISmscxSyl56FXchPYt8DuAhx4RpMgeqo3zGgxX8Rhru8f6Kgt+aVf8pof8BHMkQxkHRv4UQ8oPv2iJng5YwwUJ6OlzGcn2D+nCa5p.HrUHQD0CNIXUSOOReKY12JTUrHu5ohxokd50.ldUMI06KbISgsHhbNCZmySqyLNV6ecmTp51TX13sYjKLY0wtbL2wvk.ej93nUMMbn3kLE+MjPuQqUXW3TVqbru+x4Nqd+kWq6vN8mx9UyyE4zGisYA83zUE6Q4v0wxdOuUncHwbUeo42ZstTHSOPo4h9CnpPV2tzb4RicBcWkBt1s4YHd.kSgiKLTzmTaMlfRBye7xSTrn5I9oyF650GhRgKVyGf++wsiJbZuczjeB2+itczoaGJPY91yJ8Gf.Z7kvIK23yn06S.pefLVA2RXcBvF.EdPaDGzFpY5RADKDTt9AqrmQeSfz1UzsStfAU3kz3EvmrNqpaam0Y09c9ZYLBHtgxm3l9nWZBiymHAl2hj+LCNn00swU6+RWHTkEqXE.kcdhqqNm9ypZYMdaVZJr45SgM2XJr4ymBat4TXyWLE17kGqM5J92MFtcYZ9OHn0po2qzdv8SsKX8u.ppvgn
-
@ulrik
Aha so it is a case for dynamic effects like I suspected :)The
reg
variable needs to be declared outside of the function.
You are repeating yourself, in both clauses of yourif
you are removing the modulator, so just do it once.
Don't useContent.getComponent
outside of the on init callback. Store your component references in a const variable instead.The
.exists()
function definitely seems to be broken or we don't know how to use it correctly. In the meantime you can workaround it by manually setting the variable toundefined
.HiseSnippet 1478.3oc2Xs0aSbDEd2jLQXSohffd4soV8AGozfcJkVIDEStXpUyEClBsBgPS18X6QY1YL6NafzpHwq8eU+Iz25q8mPeqOROyNqsmMwDYRJTn9gDOmKy46bYNmYb6XU.jjnh87Kc+CF.d9e.oyARc+05y3RuVq64eIxVpvTASqhoq0Wk.wdqdv.VRBD546O6cLx4WZNurO+0sVkIXx.XLIOuGn3Avl7HtdL01M9dtPzjEB2mG4H80ZzJPIWSIToHllkTya.KXOVOXalQrYHd9yuQHGASGMSCId9yspJ7fN8UOSZk+A7D9tBvrntWGbirjapDgFDan5sVetHr8PeOwyymzdbjXVaj3xjs3g7QzGGQtXFC5XMbiG9yTDdyV.d0cgWMG3MAH46.o4rPZARmfX9.8XNF7bdRKoFh6xvvtKTrx5MySmkrlBkPpWNhsGzLFWLRipWuVskn3eV7FkwHehltOKl1jKP90o2jlUMrbOPuQ2tPftZkbVUP4KGC8FJZyX3oXgBR7pWkheYycE46mcAtUCAAtYqohFnj3hpUrry1NtTvk.sapLPyURpRhLs0bFciUhpACUbIDmhTXwx+R4RBU.SPiTgInUdTksQAprDsxlM2w7OSxJWcADanzlqC5+v9.Hp7Xzrk3coU4IqCcQqGVsnCs3hkKglnD5U8gXf1h9LUpHjJ36ATshFzGB1ih6ftOXfP9IE347DchUOlLDEXIZLDo1GnbMR1XxhFxDVZEVcQ5mcyLW4QY92iQymY+R1DgcOFch7nf8FFIKRCCIoxPquYXeHJQ4RGVtj0usQQCoiqWNgkYggisHVs3.uBKL4vR174xIf9AFhUKx+PTjWYcfMUWYQix4Yr0XBwtXGfpGuVXwa3TnrsRC6HqlUNT9vxzixpa2IxabcwDYa5MEeRJVUlFsKD6VLZDDOvVrK.4U2EvsIUfMx3HnR1Rx06L.jupVWd4gSSGibTghpy5W7g48K5H3gXeadnoYwn3nWFnc6T68CsVmoYC2JbWQKM.h0biS3uNrO1I21JpDYcHYOsZ.1TdTVDIOUF94iM5O03.2EOiGp6OhvKXM5C7d8cFbzpQDyQ8y0HQCC5v+YvcHjFdt1LJyTFmaRuiCxKjCxMY6BhLLdNhs50Af+1tN.7EO5H.DQ7QA321X2dCmeUZ9VsZ8RCUKhlmX5M4w0PjUjULxrvBK7R6Pwi0v+hiG95N+wLzMmAVNVnouowtLgqOvMd7u1PooEhKPx5wNYLNyDvHVx8l.i4ixu.wN8ZL.miz7GeKL2N+RUWhzVINXPekjGXaplAhRj7NrmvMp77L8iSAYvnn0e72+Zi65ldwvrS4+xMtaJSbjn6p7AJAK9rF4qext9bSY4wGQF4TzyRc7bSGRGe2uyVMsIy7lBu0l56pNs38SI4IcpIX+9Ct+Pxce2BrWwB1ySdHaeH6ZXY37JYq6phin2AjPrwKNoSx+9z91nAS8ai1IPiP39wLYx.bJWc2c9H7Vwk25fNUVTbKoBRYbuln6U2cb6Phq3RrMSVXyv0E1os3Nir+yasgjgIjN.5Mg6jDfNqI14lSamJRfGZF0V2UwwjWwk72whCw7RPglZydFaULwmIN+6bOS78fKMLoIhWjzgGMP.aH2GD3ULy+oFv2fwRE5gTKdbZKkTYmg5lnuGni485AEpelnCcasFeIwXJWtw8.AvRbNh84M1DemDKt3D0WqXQ8W6W0Ow70mPrvkZ5APe+8xdy9+5K6M8m9vVfuamE+XB1JdEZVpj9eSt7dpTMW1aKFdhFGXP1NMpCNqK.PTJkfv7PZ+YLO40ttlYsABc.YX1hWhexYV2r1OmY8gLeqXiHVPr5IA1GiaNzetLJneKy9ULKQ1xrlVe3KvIjZKWyKBGW7jf.S85WfSelrNqbJz4KOE5bsSgNe0oPmqeJz4qOE57MmnNlI02NUqhr07Hg1aj8Kg36aurRV4u2+.7jxzvE
-
@d-healey Beautiful done David, thank you for the lesson, it's much appreciated!
-
@d-healey btw, is this "dynamic approach" a better way to deal with modulators (remove current, add another) than having 6 different modulators in the same chain and controlling them with setIntensity() or setBypassed() ?
ie only i modulator active -
@ulrik I would expect it to be more efficient but I'm not sure, @Christoph-Hart will probably know.
-
@d-healey yes I guess that as well