Re: safe addition of arguments to existing ugens
| Newsgroups | gmane.comp.audio.supercollider.devel |
|---|---|
| Message-ID | <[email protected]> |
i guess the array should always already be allocated with the known size of the linked ugen, and when the synthdef requests fewer slots, as nathan writes, it will have to fill the uninitalised slots with a sensible default value (or if that's not possible at least gracefully terminate the ugen initialisation). best, ...h.h... On 23/03/18 20:51, julian.rohrhuber-QYZGCWsIODmAF8UT6DzBU6xOck334EZe@public.gmane.org wrote: >> >> i thought of a very simple workaround for this -- in the Ctor code, a ugen can look at its own unit->mNumInputs and correctly handle edge cases. in the case of backward-compatible addition of arguments, this would mean that the new argument is optional and the plugin is smart enough to supply a default. > > This would have to mean that it extends the array of values by some default like zero, so that the macros like ZXP() and IN() would never read uninitialised data? > >
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEBT+tQEGDjkBMBGwqpkWZo9piTpAFAlq1fCUACgkQpkWZo9pi TpAiQA//TUlrBkPUMCHPtVU/h2SxHNv0SROCwQjzZiPC5ZU9DthwhzkE0OnS4lGS F7d+YSOoqXNSEp5RLreB/24ygvRQ6QVJtc4UfWAGkyfZdxohloRPAxwbsyfK3lCn CrBQb9/8Gwob8CzxLS1QH2uA9F8xnJ/oqHpNWNAonF6nxz2AtsbpwDJ17I+8htiL eUZ7SDUwHJozg85h9WbtgYIo5GtuzH1hJbHZgBolyqyCqPbU4Bt2iHqdZr9F5ow+ USZYBWPm42w8dd47v1SiHgY/0QycQJrzsTtvgduGr1kp4x+3GtnytHdIhwkKc6NJ BIS/gguCXpIRxQqz3tp3rbhgo3orzoSrxE11Yl8AVT8SS5CbmTJeqMu5itNtj6Sj Qx+1DWz/orTACcoFryHm8cPjkKkJwN8J66NOyxtbKJi7JIujFTrCY5V88OojF/Ge KpQDsx1XylPgezVKX9ndWoILAG0ZRVmOzXXS9NVUItZdzVDqr/DLx0r1NcwX/10o fGvlMXxNbJaUM4OMnWby3i0+M/S9v79r5dY87v4VJOTLqwt8K23eQcvkK9NYubhD vAshocmRa+evTFHBCJdqOKr2BE4HEAVke8hBst3s+/2AjWkaqEZd2sK6z5ApgIPz GIYFJywkgwjjAlBczVuNkUeuR1oc0XmSRAYHsdcZOq9mD04WhU0= =olFx -----END PGP SIGNATURE-----