Page 1 of 1

Plugin Path

Posted: Fri Mar 29, 2019 4:52 am
by RJHollins
Here's a general question I've wondered ...

If we create a VST plugin that we load up into a DAW session ...

Can we obtain the FOLDER that the DAW project is loaded from ?

[not talking of the location the VST is installed].

thanks

Re: Plugin Path

Posted: Fri Mar 29, 2019 9:54 am
by adamszabo
I dont think so. How would a vst know where your project is?

Re: Plugin Path

Posted: Fri Mar 29, 2019 5:33 pm
by RJHollins
adamszabo wrote:I dont think so. How would a vst know where your project is?

yeah ... I was kinda thinking if there was an 'Environment' type call to the DAW ... similar to API calls used in Reaper.

I need to look at Saving some converted data [stored in the PreSet Manager] to the DAW Project Folder.

Guess I need to read up on the Folder, Dir, etc PRIMS in FS.

Re: Plugin Path

Posted: Fri Mar 29, 2019 6:52 pm
by trogluddite
The nearest thing that I can see in Steinberg's VST plugin documentation is a function for getting the path to the currently loaded preset (if it was loaded from a file, and it returns an absolute, not relative, path). However, as far as I can tell, that's VST3 only, and even then, FS would need to expose the function call as a primitive or Ruby method.

You can take a peek at the environment variables of the current process by formatting the contents of Ruby's global ENV Hash in a RubyEdit and outputting to a text viewer (make sure it's scrollable!)...

Code: Select all

output ENV.map{|name, value| "#{name} = #{value}"}.join("\r\n")

# NB) Access a specific value by de-referencing the name as a String...
appdata_folder = ENV["APPDATA"]

...and you can query the current working directory...

Code: Select all

output Dir.getwd

There can be some useful global values there, but usually nothing dynamically changed during run-time; and even if what you need does happen to be there, it would likely be application specific, so won't migrate between different hosts (FWIW, I've checked these before for Reaper and VSTHost.)

The nearest solution that I've ever found for this is to store the directory path as a VST string preset so that it's saved with the project; but of course, if you move the project, you then have to update the path manually and re-save (i.e. using a file/directory dialogue.)

Re: Plugin Path

Posted: Fri Mar 29, 2019 9:21 pm
by wlangfor@uoguelph.ca
this is a great idea considering not all want to configure an installer and install path. Infact I used to work with preg replace and expressions in such a way so that it could be configured to check for ini docs and if non existant to actually write them wherever the file is moved to. remind me of this and I will do.

It really is a simple matter if You're used to expressions. I used to write bbcode invocation and addition/subtraction algorithms. It was only list that was three pass with bullet hierarchy mind You.

Gl and will look to this in time. regards, Le Attol.