Plugin instance id?

Whats the best way to find the instance number or id of a plugin. If I insert multiple instances of my plugin, i need to know what my instance count is. I tried by declaring a static int MY_INSTANCE_ID; as a global in my pluginProcessor.h and incrementing MY_INSTANCE_ID++; in createPluginFilter(); . However the instance id does not seem to be incrementing, it’s 0 for all the instances. Any ideas? Also, I actually need to share some variables between different instances of my plugin (in real time, sample accurate) I managed to do this about a year ago using static variables as globals before, but when I try it now with the latest juce, its not working, what could have changed? Cheers…

its by the OS/Host/Juce if you plugin instances sharing the same Process-Environment/Memory/Namespace, so the only way to make this always working is to use Interprocess-communication techniques.

1 Like