VCV Environment Variables

Hi everyone. I’m currently developing modules, and I want to be sure that I’m keeping the end environment in mind. I do not have Rack installed, but I have built it from source. I am using environment variables in my code, so that raises the question: what is the scope of environment variables in a distributed Rack environment? When running from source, I have to add -use-full-path to the msys2 shell in order to include the full path variable, but is this already taken care of when Rack is distributed?

you are always running in process in the host process (VCV, or some DAW in the case of VST version). You never have to worry about someone finding your plugin. Of course the Environment variables are specific to the process.

Why does your code need/want to change environment variable?

It specifically uses the PATH environment variable for a terminal feature it has. I’ve had trouble in the past with it not having all the paths in the PATH variable, and thus the code not finding certain programs, so I wanted to be sure of what Rack keeps in the PATH variable if VCV is the host process.


I can eventually just test it on the installed version, I suppose.

because you don’t believe my answer? Yes, testing yourself is always a reliable method to answer questions like that.

I actually didn’t fully process that you answered my question. I know you said the env variables are specific to the process, but I’m not sure what the scope of it all is, like if it would contain essentially the same PATH variable that would be in someone’s Control Panel on windows, for example.

The scope is the process. There is a single process. When VCV is the host, VCV is the the process. All the modules load into that process, they all share the same pool of environment variables.

If Reaper is the host, launching reaper creates one process. by default all plugins, like VCV, load into that process. Some DAWs have some kooky legacy features where they create a separate 32 bit process to load old plugins. For stability some hosts create a process for each plugin. That’s pretty expensive, but it means that if one plugin crashes it won’t bring down the host.

So usually by default anyone who loads a module will have created a single process and load everyone into that. If the host intentionally creates extra process (for one of the above reasons), then some plugins might not see env variable from other plugins, because they are in a different process.

Yep, that makes complete sense. Thanks @Squinky