i just uploaded the initial version of vst3_plugin.h, a single-header wrapper/abstraction to make it very easy to create vst3 plugins.. currently linux/gcc only (i think), but there's almost nothing platform specific in it, so it shuld be pretty easy to make it cross-platform.. the header uses just a few c++11 things, but generally it's pretty minimalistic and simple.. it's a quick extraction of the vst3 specific parts from my main library/framework (kode2), so it's probably not optimal yet.. and currently, there's no gui.. .i will work more on it, clean it up, add the few missing things, etc.. also, i will make a more fully working example plugin, and a simple compile script..
MIT license
https://github.com/skei/vst3_plugin.h
here's how you could make a simple plugin like AGain (the "hello world" of plugins?)
Code: Select all
#include "vst3_plugin.h"
class myDescriptor : public VST3_Descriptor {
public:
myDescriptor() {
name = "AGain";
appendParameter( new VST3_Parameter("Gain",1.0f) );
}
};
class myInstance : public VST3_Instance {
private:
float MGain = 0.0f;
public:
void on_parameter(uint32_t AIndex, float AValue, uint32_t AMode) final {
switch (AIndex) {
case 0: MGain = AValue; break;
}
}
void on_process(VST3_ProcessContext* AContext) final {
float* in0 = AContext->inputs[0];
float* in1 = AContext->inputs[1];
float* out0 = AContext->outputs[0];
float* out1 = AContext->outputs[1];
uint32_t len = AContext->num_samples;
for (uint32_t i=0; i<len; i++) {
*out0++ = *in0++ * MGain;
*out1++ = *in1++ * MGain;
}
}
};
VST3_ENTRYPOINT(myDescriptor,myInstance);
no complicated build setup, no makefiles, no external libraries, no mess.. just point gcc to your vst sdk, and compile it.. i don't remember the actual needed gcc arguments, but there's some info about that in the .h file.. it shouldn't be too hard to figure out.. after compilation, put the resulting .so into a directory structure like this: 'AGain.vst3/Contents/x86_64-linux/AGain.so', and you should have a working vst3 plugin.. (tested in linux versions of reaper and bitwig)