Search code examples
javac++audiovstjuce

What are "programs" in a VST instrument?


I have recently started using jvstwrapper and also the juce framework. It appears that the VST SDK has some concept of different "programs" for your instrument. For example both jvstwrapper and juce have classes which you inherit from in order to create your instrument. These classes require a number of methods to be implemented. In both cases, (and detailed in the VST SDK), you must implement methods "setProgram", "getProgramName", "setProgramName", "getNumPrograms" etc. I know that each program appears to hold a bunch of settings for the instrument. But in what cases are they actually used? Plus how many are there supposed to be?


Solution

  • A VST program is similar to a hardware ROM preset, or a MIDI program change message. The hardware analogy makes more sense if you are familiar with older synthesizers, which often shipped factory presets that could be "dialed up" and then tweaked accordingly. Some hosts will present the list of programs as a dropdown menu so that users can quickly browse factory presets.

    Regarding the number of possible programs a plugin can have, the VST SDK uses VstInt32 (a 32-bit integer) for the program index. So a plugin could theoretically have up to 2147483647 possible programs. In practice, most hosts limit this to 127 (to be compatible with MIDI program change messages), so it is unwise to expose more than 127 programs or else the host might have problems with your plugin.

    IMHO the concept of VST programs is a bit dated and obsolete. It makes far more sense for your plugin to support the FXP/FXB features of the VST SDK so that the user can import/export patches from/to the hard disk. As you might expect, Juce of course has hooks for loading and saving VST preset files.

    Many modern plugins don't support VST programs, and it's totally acceptable for your plugin to return 0 in the getNumPrograms() call.