![]() 'D' for dancing |
This small interface will enable you to write VST plugins using the D programming language. Unlike other VST APIs, this is not a language bindings, it doesn't requires a VM or external elements. D can easly match C++ performance. In case you don't know the D programming language, it is a refactored C with multiple programming paradigs, like object oriented and meta-programming. The real power of D is that you still have the low level programming facilities (iterating over a pointer, C and D strutures can be shared) but with a simpler syntax than C++. If you are an experienced C and Java/C# programmer, you will find D amazingly easy to use. See official D features and D unofficial language comparison. This is not a port of the original VST API; it is not based on the single AudioEffect C++ class. The API has been broken into different class (the host, the programmer/preset manager, the parameters and the plugin it self). APIFollow this link for the current API specification. ExampleTo show you the power of D, here is a small classic example of the again plugin made in D : import vstd;
class AGain : VSTPlugin {
float volume;
this() {
super();
uniqueID = generateHeader("dgan");
effectName = "again d";
vendorString = "Electric One Software";
productString = "vstd test suite";
declareInputs("In1", "In2");
declareOutputs("Out1", "Out2");
volume = 1;
// parameters are handled by the base class VSTParameter
paramHandler = new VSTParam[1];
paramHandler[0] = new VSTParam("volume", &volume, "db");
}
void processReplacing(float** inputs, float** outputs, int sampleFrames) {
float* in1 = inputs[0];
float* in2 = inputs[1];
float* out1 = outputs[0];
float* out2 = outputs[1];
// this is easy, in fact, it's the same syntax of C
while (--sampleFrames >= 0) {
(*out1++) = (*in1++) * volume;
(*out2++) = (*in2++) * volume;
}
}
// this register the plugin when the .vst/.dll will be loaded by the
// vst host
static this() {
registerPlugin(AGain.classinfo);
}
}
DownloadVST is a trademark of Steinberg Media Technologies GmbH. Please register the SDK via the 3rd party developper license on Steinberg site. Before you code with vstd, you need to read and agree with the license for the original sdk by Steinberg. It is included in the zipfile. If you don't agree with the license, don't make plugins with vstd. The API works with Digital Mars DMD (for Windows) and GNU gdc (for OS X). vstd-0.1.zip - May 2008 contact: asb2m10 .at. users.sourceforge.net |