This plugin is a template and self-contained tutorial for creating your own VCV plugins.
- Some C++ familiarity is required.
- Compile Rack from source, following the instructions at https://github.com/VCVRack/Rack. Be sure to check out the desired version you wish to build your plugin against.
- Clone this repository in the
plugins/
directory.
Makefile
: The build system configuration file. Edit this to add compiler flags and custom targets.src/
: C++ and C source filesTutorial.cpp / Tutorial.hpp
: Plugin-wide source and header for plugin initialization and configuration. Rename this to the name of your plugin.MyModule.cpp
: A single module's source code. Duplicate this file for every module you wish to add. You may have multiple modules per file or multiple files for a single module, but one module per file is recommended.
res/
: Resource directory for SVG graphics and anything else you need tofopen()
LICENSE.txt
: This tutorial is released into public domain (CC0), but you may wish to replace this with your own license.
This tutorial will not instruct you to create a pre-planned module, like a Voltage Controlled Oscillator. Instead, I have already done that for you, and your task is to change it to something of your choice, using generic instructions that apply to any module type.
Before diving in, familiarize yourself with the above file structure.
-
Set up the names of the parameters, inputs, and outputs in
MyModule.cpp
by editing the enums defined in theMyModule
class. -
Write the DSP code of your module in the
MyModule::step()
function, using the values from theparams
,inputs
, andoutputs
vectors. Rack includes a work-in-progress DSP framework in theinclude/dsp/
directory that you may use. Writing a high quality audio processor is easier said than done, but there are many fantastic books and online resources on audio DSP that will teach you what you need to know. My word of advice: mind the aliasing. -
Design the module's panel with a vector graphics editor (Inkscape, Illustrator, CorelDRAW, etc) and save it in the
res/
directory as an SVG file. Make sure the path to the .svg file is correctly specified in theSVG::Load()
function. Note: The Rack renderer is currently only capable of rendering path and group objects with solid fill and stroke. Text must be converted to paths. Clipping masks, gradients, etc. are not supported. -
Add widgets to the panel including params (knobs, buttons, switches, etc.), input ports, and output ports. Helper functions
createParam()
,createInput()
, andcreateOutput()
are used to construct a particularWidget
subclass, set its (x, y) position, range of values, and default value. Rack Widgets are defined ininclude/widgets.hpp
andinclude/app.hpp
, and helpers are found ininclude/rack.hpp
. Note: Widgets frominclude/components.hpp
using Component Library SVG graphics are licensed under CC BY-NC 4.0 and are free to use for noncommercial purposes. Contact contact@grayscale.info for information about licensing for commercial use. -
Eventually, you will need to change the name of your plugin from "Tutorial" to something of your choice. Decide on a human-readable name, as well as a "slug" (unique identifier) that will never change and only contains letters, numbers, and the characters
_-
. RenameTutorial.cpp
andTutorial.hpp
. Change references of#include "Tutorial.hpp"
in each of the source files. In theinit()
function, change the slug and other metadata. In theMakefile
, change theSLUG
andVERSION
. Finally, don't forget to edit theLICENSE.txt
file to choose a license of your choice, unless you want to release your plugin into the public domain (CC0). -
Build your plugin with
make
, ormake dist
to produce a distributable .zip file. Subscribe to the Plugin API Updates Thread to receive notifications when the Rack API changes or a discussion about a change is being held. Follow the plugin versioning guidelines, set theVERSION
in theMakefile
, andgit tag vX.Y.Z
(git tag v0.4.0
for example) andgit push --tags
when finalizing a new release. Finally, add your plugin to the List of plugins wiki page.
I welcome Issues and Pull Requests to this repository if you have suggestions for improvement.
This tutorial is released into the public domain (CC0).