ASPiK SDK
|
DIY Project Creation
If you'd like to create your plugin project by hand, you can do that with the SDK as well. The steps are outlined in Designing Audio Effects Plugins in C++ 2nd Ed. by Will Pirkle and are repeated here.
Step 1: Copy the TemplatePlugin
Copy and paste the TemplatePlugin folder into your ASPiK project folder. Change the name of the folder to a new name that makes sense for the project. Make sure it is a valid CMake name (no spaces, no oddball characters, no numbers).
Step 2: Edit the CMake File
Open the outermost CMakeLists.txt file in any text editor and alter the variables at the top of the file according to your plugin needs. In the example here, we are setting up a project for the book's IIRFilters plugin:
At the top of the file are the names of the SDK root folders and they will be preset to the names we used in Section 6.2 and will look like this:
These folder names are only needed for universal projects where you target one or more SDKs and you use the outside myprojects folder in Section 6.2.5. If you are targeting individual APIs, you don’t need to bother with the naming as CMake uses relative path locations. The next section contains the build flags. Here is where you choose which APIs to target for the compiler. The settings below show a VST-only build setting. The UNIVERSAL_SDK_BUILD flag is set to FALSE (for an individual build) and the VST_SDK_BUILD flag is set to TRUE, indicating that API as the target.
To build a Universal project that targets VST and AU, you would set these flags accordingly:
With the build flags set, you can finish the edits with the project information. These values are set in the next section of the file and are generally self-explanatory. The first is the compiler project name (IIRFilters) and this project name must not contain whitespaces or special characters.
The next edit is for the plugin name that the DAW will expose to the user; here we are calling it the Filterizer. Notice that this name contains quotes and can be the same as or different than the iroject name. You can include whitespaces, numbers, other characters, or almost anything else in this text description.
The next edit is for identifying the plugin as a FX or Synth plugin. It uses a boolean flag to identify the synth-ness of the project. A synth plugin only has outputs and does not process an audio input (unless it is a sidechain). All projects in this book are FX plugins.
Then, you need to fill in your vendor (company) information
Next, you need to set some special four-character codes that are required for identification in the various APIs. You need to be careful here, and be sure to change the codes for each plugin you develop. You can use combinations of capital and lower case letters and numbers or other characters.
Lastly, there are some plugin options that need to be set. First is the audio processing (see Frame, Buffer and Sub-Block Processing); here I am settign up sub-block procssing of 64 samples at a time:
The next option is for side chaining. If you would like the DAW to expose side chain inputs to your plugin, set the EXPOSE_SIDECHAIN flag to TRUE, otherwise false. Our volume plugin won’t need it so we will set it to FALSE here.
Next is the latency setting in samples. This is a special setting for lookahead compressors or FFT processing plugins that necessarily introduce a latency or time-delay to the audio signal. Set this parameter in samples.
The tail time may be set so that you can hear your reverb or delay tails. For VST3, there is an option for an infinite tail – it this variable is set to true, the DAW will run a continuous stream of zeros through your plugin forever after the user stops playback the very first time. We’ll use a default tail time of 1 second here, even though our volume plugin won’t need a tail and we’ll set the VST3 infinite tail to FALSE.
The last option involves sample accurate automation for VST3 plugins only. For our IIRFilters plugin, we will leave this in their default settings of no sample accurate automation and a granularity of 1 sample.
There are three more flags to set – one will automatically include the fxobjects.h and fxobjects.cpp files to integrate the book C++ objects into your project. The next is for linking with the FFTW library for the advanced plugins in Chapters 20 and 22. Note that you must install FFTW on your system prior to setting the link flag.
AAX Plugin Category
The AAX plugin category is coded as an unsigned integer and based on a list of plugin codes. If you use the ASPiKreator software, you can see this list in the drop-down combo box. The encoding from the documentation is:
AAX_ePlugInCategory_None = 0x00000000,
AAX_ePlugInCategory_EQ = 0x00000001, ///< Equalization
AAX_ePlugInCategory_Dynamics = 0x00000002, ///< Compressor, expander, limiter, etc.
AAX_ePlugInCategory_PitchShift = 0x00000004, ///< Pitch processing
AAX_ePlugInCategory_Reverb = 0x00000008, ///< Reverberation and room/space simulation
AAX_ePlugInCategory_Delay = 0x00000010, ///< Delay and echo
AAX_ePlugInCategory_Modulation = 0x00000020, ///< Phasing, flanging, chorus, etc.
AAX_ePlugInCategory_Harmonic = 0x00000040, ///< Distortion, saturation, and harmonic enhancement
AAX_ePlugInCategory_NoiseReduction = 0x00000080, ///< Noise reduction
AAX_ePlugInCategory_Dither = 0x00000100, ///< Dither, noise shaping, etc.
AAX_ePlugInCategory_SoundField = 0x00000200, ///< Pan, auto-pan, upmix and downmix, and surround handling
AAX_ePlugInCategory_HWGenerators = 0x00000400, ///< Fixed hardware audio sources such as SampleCell
AAX_ePlugInCategory_SWGenerators = 0x00000800, ///< Virtual instruments and other software audio sources
AAX_ePlugInCategory_WrappedPlugin = 0x00001000, ///< All plug-ins wrapped by a third party wrapper
AAX_EPlugInCategory_Effect = 0x00002000, ///< Special effects
That’s all there is to editing this file unless you want to make changes regarding the relative locations of the SDK folders or other tweaks. Be sure to visit www.willpirkle.com for these instructions if you are interested. Now you can save the file and we can run CMake to finish off the project process.