Namespace oddness
-
So I have a modulator defined as:
const var GlobalTremoloLFO = Synth.getModulator("GlobalTremoloLFO");
and I have a series of callbacks like this:
inline function onTremFadeInControl(component, value) { GlobalTremoloLFO.setAttribute(GlobalTremoloLFO.FadeIn, value); }; Content.getComponent("TremFadeIn").setControlCallback(onTremFadeInControl);
I put the callback in a namespace declared in an include script: VibTremSpace.js
If I put the modulator definition in the init then it compiles, if I put it in the namespace I get this:
Interface:! VibTremSpace.js (162): Unknown function 'setAttribute'
So for some reason the callback can not see the modulator when they are BOTH in the namespace....very odd...am I doing something silly?
-
@lindon said in Namespace oddness:
am I doing something silly?
Maybe... Can you make a minimal snippet that fails in this way?
-
@d-healey I will give it a go...
-
@lindon Is it possible that the function is being called in a script that initializes before the modulator is defined?
-
@dustbro I think if that was the case the error wouldn't be on line in the script containing the namespace.