paulxstretch/deps/clap-juce-extensions/clap-libs/clap/README.md
essej 8bbddf66e9 git subrepo clone (merge) https://github.com/free-audio/clap deps/clap-juce-extensions/clap-libs/clap
subrepo:
  subdir:   "deps/clap-juce-extensions/clap-libs/clap"
  merged:   "3189bdfaf"
upstream:
  origin:   "https://github.com/free-audio/clap"
  branch:   "main"
  commit:   "3189bdfaf"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"
2022-06-14 21:34:50 -04:00

6.0 KiB

CLAP

Learn about CLAP

CLAP stands for CLever Audio Plugin. It is an audio plugin ABI which defines a standard for Digital Audio Workstations and audio plugins (synthesizers, audio effects, ...) to work together.

To work with CLAP, include clap/clap.h.

The two most important objects are clap_host and clap_plugin.

src/plugin-template.c is a very minimal example which demonstrates how to wire a CLAP plugin.

Entry point

The entry point is declared in entry.h.

Extensions

Most features comes from extensions, which are in fact C interfaces.

// host extension
const clap_host_log *log = host->extension(host, CLAP_EXT_LOG);
if (log)
   log->log(host, CLAP_LOG_INFO, "Hello World! ;^)");

// plugin extension
const clap_plugin_params *params = plugin->extension(plugin, CLAP_EXT_PARAMS);
if (params)
{
   uint32_t paramsCount = params->count(plugin);
   // ...
}

The extensions are defined in ext folder.

Some extensions are still in the progress of being designed and they are in the draft folder.

An extension comes with:

  • an header #include <clap/ext/xxx.h>
  • an extension identifier: #define CLAP_EXT_XXX "clap/XXX"
  • host interfaces are named like: struct clap_host_xxx
  • plugin interfaces are named like: struct clap_plugin_xxx
  • each methods must have a clear thread specification

You can create your own extensions and share them, make sure that the extension identifier

  • includes versioning in case the ABI breaks
  • a unique identifier

All strings are valid UTF-8.

Fundamental extensions

This is a list of the extensions that you most likely want to implement and use to get a basic plugin experience:

  • log, lets the host aggregate plugin logs
  • thread-check, check which thread you are currently on, useful for correctness validation
  • audio-ports, define the audio ports
  • note-ports, define the note ports
  • params, parameters management
  • latency, report the plugin latency
  • render, renders realtime or offline
  • tail, processing tail length
  • state, save and load the plugin state
  • gui, generic gui controller

Support extensions

Extra extensions

Resources

Plugins

Hosts

  • Bitwig, you need at least Bitwig Studio 4.3 Beta 5

Examples

  • clap-juce-extension, juce add-on
  • MIP2, host and plugins
  • Avendish, a reflection-based API for media plug-ins in C++ which supports Clap
  • nih-plug, an API-agnostic, Rust-based plugin framework aiming to reduce boilerplate without getting in your way

Programming Language Bindings

Artwork