Home

Awesome

CPLUG

"I just want to build a plugin" - Me (and probably you too!)

CPLUG is a simple wrapper API for the VST3, Audio Unit v2 & CLAP plugin formats. There are no extra dependancies outside of the C APIs. It uses a C99 interface, making it easily compatable with other languages. Efforts have been made to use minimal code, making it easy to read and modify. It uses very few files, making it easy to build and include in other projects.

CPLUG only provides the plumbing of wrapping plugin APIs - no extras! It is intended to be compatible with other libraries of your choice (eg. PUGL, NanoVG, Qt).

CPLUG uses a CLAP style single event queue for processing.

All GUI code is pushed to the user to implement how they chose.

All strings are expected to be \0 terminated & UTF8.

Building

TLDR; To quickly get started, try building the example project using CMake

The idea is cplug.h contains forward declarations of functions which you implement in your own source file. Pair these with a single source file corresponding to the plugin format you're building.

The source files are configurable using macros you define. A full list of these macros can be found in the example project. AUv2 and Standalone builds require a few extra macros which are set in CMakeLists.txt. If you're building these targets, you should read the CMake file.

Source fileLines of codeDescriptionExtra dependencies
cplug.h< 300Common APINone
cplug_clap.c< 800CLAP wrapper#include <clap/clap.h>
cplug_auv2.c< 1,400Audio Unit v2 wrapperNone
cplug_standalone_osx.m< 1,400StandaloneNone
cplug_standalone_win.c< 1,600StandaloneNone
cplug_vst3.c< 2,200VST3 wrapper#include <vst3_c_api.h>

Copies of the CLAP API and VST3 C API are included in the src folder. They're both single files.

Tested using compilers MinGW GCC 8, VS 17.5, Clang 15 (Windows), Clang 14 (Mac), using C99 & C++11

[!NOTE] Some versions of MinGW may not ship with mmeapi.h, which is required for MIDI in Windows standalone builds. Either define the functions and structs yourself, or use a different compiler for this build

Features

Included:

Not included

Most plugins don't support these features, & most users don't ask for them or know about them. This library takes a YAGNI approach to uncommon features. Because this library is such a thin wrapper over the plugin APIs, adding any feature you need yourself should be a breeze.

Roadmap

Useful Resources

Licensing

The files src/vst3_c_api.h and src/cplug_vst3.c are required to use the VST 3 SDK License

The file src/clap/clap.h uses an MIT license included at the top of the file.

Everything else is in the public domain, or MIT if you insist. See LICENSE.

Credits