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 under 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. 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), 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 [email protected] for information about licensing for commercial use. -
Eventually, you will need to change the name of your plugin from "Tutorial". Rename
Tutorial.cpp
andTutorial.hpp
. Change references of#include "Tutorial.hpp"
in each of the source files. In theinit()
function, change thename
,slug
(unique identifier), andhomepage
metadata of the plugin, which will affect the labels given to your plugin in the "Add module" context menu of Rack. In theMakefile
, change theDIST_NAME
so that runningmake dist
builds a correctly named .zip file. -
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. 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.