Plugin Path

For general discussion related FlowStone
Post Reply
RJHollins
Posts: 1573
Joined: Thu Mar 08, 2012 7:58 pm

Plugin Path

Post 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
adamszabo
Posts: 667
Joined: Sun Jul 11, 2010 7:21 am

Re: Plugin Path

Post by adamszabo »

I dont think so. How would a vst know where your project is?
RJHollins
Posts: 1573
Joined: Thu Mar 08, 2012 7:58 pm

Re: Plugin Path

Post 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.
User avatar
trogluddite
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Plugin Path

Post 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.)
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
wlangfor@uoguelph.ca
Posts: 912
Joined: Tue Apr 03, 2018 5:50 pm
Location: North Bay, Ontario, Canada
Contact:

Re: Plugin Path

Post 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.
My youtube channel: DSPplug
My Websites: www.dspplug.com KVRaudio flowstone products
Post Reply