Global Variables

For general discussion related FlowStone
Post Reply
S1User
Posts: 58
Joined: Thu Sep 17, 2015 4:05 pm

Global Variables

Post by S1User »

It seems that global variables used in Ruby are shared even between VST plugin instances?

I notice that with this plugin I'm working on, that I had to circle back and make the arrays local because when they were global they affected different plugin instances on different tracks. Is this normal? If so, there may be some useful application for that with plugins.
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Global Variables

Post by KG_is_back »

yes it is normal. Instances of the same plugin share ruby interpreter, because they are instances of the same class. That means they effectively share everything in ruby that can be considered global (Constants, class and method declarations, class variables, etc.)
S1User
Posts: 58
Joined: Thu Sep 17, 2015 4:05 pm

Re: Global Variables

Post by S1User »

Thanks. I incorrectly assumed that the Ruby classes would be instance specific when they were (I assume) converted to C++ or whatever on VST compile. Knowing otherwise now, there is some opportunity there to pass data between different plugin instances that I hadn't considered.

I'll have to look more into that.
Post Reply