Calling a Javascript Object From Multiple Instances of a Subpatcher
I saved a subpatcher as a separate file so I can use it as an abstraction with multiple instances in my main patcher. The subpatcher contains a Javascript object.
Does each instance of the subpatcher get a separate instance of the js object? In my testing it seems that all instances of the subpatcher are sharing the same js object.
Is there a way to ensure that each subpatcher gets a separate instance of a js object?
Each subpatcher does get a separate instance of a given js object. However globals declared in Javascript are shared across all Javascript objects unless they are declared preceded with the "var" keyword. i.e. Globals to a given script can be made unique to each instance of that script by preceding each variable with the "var".