_______ .---. ____ .-------.
/ __ \ | ,_| .' __ `. \ _(`)_ \
| ,_/ \__) ,-./ ) / ' \ \ | (_ o._)|
,-./ ) \ '_ '`) |___| / | | (_,_) /
\ '_ '`) > (_) ) _.-` | | '-.-'
> (_) ) __ ( . .-' .' _ | | |
( . .-'_/ ) `-'`-'|___ | _( )_ | | |
`-'`-' / | \ \ (_ o _) / / )
`._____.' `--------` '.(_,_).' `---'
CLever Audio Plugin.
To work with clap, include clap/clap.h.
The two most important objects are clap_host
and clap_plugin
.
The entry point is declared in entry.h.
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.
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
- state, save and load the plugin state
- gui, generic gui controller
- gui-win32, win32 specific
- gui-cocoa, cocoa specific
- gui-x11, x11 specific
- gui-free-standing, open the gui without embedding it into the host's window
- timer-support, lets the plugin register timer handlers
- fd-support, lets the plugin register I/O handlers
- render, renders realtime or offline
- note-name, give a name to notes, useful for drum machines
- tuning, host provided microtuning
- track-info
- thread-pool, use the host thread pool
- quick-controls, bank of controls that can be mapped on a controlles with 8 knobs
- file-reference, let the host know about the plugin's file reference, and perform "Collect & Save"
- check-for-update, check if there is a new version of a plugin
- audio-ports-config, simple list of possible configurations
- surround, inspect the surround channel mapping
- clap-examples, very simple host and plugins
- clap-juce-extension , juce add-on