Scriptnode Parameter Aliases
-
This post is deleted! -
@clevername27 said in Scriptnode Parameter Aliases:
SCRIPTNODE_Synth.setAttribute.myGain
setAttribute is a function, isn't it?
-
@clevername27 I don't think this is a bug, setAttribute is always expecting an index, and the network reference object contains properties named after the parameters which just hold their respective indexes.
So network.myGain will just return the index of that parameter.
If you change the name of the parameter (or should I say its ID), how would the unchanged call be able to fetch the index if a parameter with that ID no longer exists?
-
@d-healey @aaronventure Thanks for your replies; I mistyped the syntax in my original post (now fixed). I meant that initially, the parameter name resolves to its associated index (or the other way around)…and that's great, because it's self-documenting, and you avoid bugs from mistakenly using the wrong index (number). But when I change the name, it no longer seems to resolve to an index.
-
@clevername27 well yeah.
This ain't a JetBrains IDE, references don't automatically change everywhere.
It should throw an error (because the property you're now referring to returns
undefined
), then you know you gotta change it there. But no, it's not automatic.Same thing if you change the ID of a component in the property editor. Any script references to it are now invalid (because you're getting the reference by means of ID).