Search code examples
dllaudiovst

How do I scan/enumerate vst plugin dlls?


I'm trying to build a small program that hosts vst effects and I would like to scan a folder for plugin dlls.
I know how to find all the dlls but now I have the following questions:

  • What is the best way to determine if a given dll is a vst plugin?
    I tried to just see if the ddl exports the proper function and this works fine for plugins made with the more recent versions of the vst sdk since it exports a method called "VstPluginMain" but older versions export a rather generic "main" function.
  • How do I determine if the plugin is an effect or an instrument?
  • How do I scan vst shell plugins?
    Shell plugins are basically dlls that somehow contain multiple effects. An example of this are the plugins made by Waves Audio http://www.waves.com/

ps: If there is a library that can do all of this for me please let me know.


Solution

  • How to determine a VST plugin?

    Once you've found main/VSTPluginMain... call it! If what's returned is NULL, it's not a VST. If what's returned is a pointer to the bytes "VstP" (see VstInt32 magic; ///< must be #kEffectMagic ('VstP') in aeffect.h), then you have a VST.

    The VSTPluginMain returns a pointer to an AEffect structure. You will need to look at this structure.

    Effect or instrument? AEffect::flags | (effFlagsIsSynth = 1 << 8)

    Shell VSTs are more complex:

    Category will be kPlugCategShell

    Support the "shellCategory" canDo.

    Use effShellGetNextPlugin to enumerate.

    To instance, respond to audioMasterCurrentId in your callback with the ID you want.