clap

CLAP Audio Plugin API
Log | Files | Refs | README | LICENSE

README.md (8246B)


      1 <p align=center>
      2   <picture>
      3     <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/free-audio/clap/main/artwork/clap-full-logo-white.png">
      4     <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/free-audio/clap/main/artwork/clap-full-logo-black.png">
      5     <img alt="CLAP" title="Clever Audio Plugin" src="https://raw.githubusercontent.com/free-audio/clap/main/artwork/clap-full-logo-black.png" width=200>
      6   </picture>
      7 </p>
      8 
      9 - [Learn about CLAP](#learn-about-clap)
     10   - [Entry point](#entry-point)
     11   - [Extensions](#extensions)
     12   - [Fundamental extensions](#fundamental-extensions)
     13   - [Support extensions](#support-extensions)
     14   - [Deeper Host integration](#deeper-host-integration)
     15   - [Third-party extensions](#third-party-extensions)
     16 - [Adapters](#adapters)
     17 - [Resources](#resources)
     18   - [Examples](#examples)
     19   - [Community related projects](#community-related-projects)
     20   - [Programming Language Bindings](#programming-language-bindings)
     21   - [Artwork](#artwork)
     22 
     23 # Learn about CLAP
     24 
     25 CLAP stands for **CL**ever **A**udio **P**lugin. It is an interface that
     26 provides a stable ABI to define a standard for *Digital Audio Workstations* and
     27 audio plugins (synthesizers, audio effects, ...) to work together.
     28 
     29 The ABI, or **A**pplication **B**inary **I**nterface, serves as a means of
     30 communication between a host and a plugin. It provides backwards compatibility,
     31 that is, a plugin binary compiled with CLAP 1.x can be loaded by any other
     32 CLAP 1.y.
     33 
     34 To work with CLAP, include [clap/clap.h](include/clap/clap.h).
     35 To also include the draft extensions, include [clap/all.h](include/clap/all.h).
     36 
     37 The two most important objects are `clap_host` and `clap_plugin`.
     38 
     39 [src/plugin-template.c](src/plugin-template.c) is a very minimal example which demonstrates how to wire a CLAP plugin.
     40 
     41 ## Entry point
     42 
     43 The entry point is declared in [entry.h](include/clap/entry.h).
     44 
     45 ## Extensions
     46 
     47 Most features come from extensions, which are in fact C interfaces.
     48 ```C
     49 // host extension
     50 const clap_host_log *log = host->extension(host, CLAP_EXT_LOG);
     51 if (log)
     52    log->log(host, CLAP_LOG_INFO, "Hello World! ;^)");
     53 
     54 // plugin extension
     55 const clap_plugin_params *params = plugin->extension(plugin, CLAP_EXT_PARAMS);
     56 if (params)
     57 {
     58    uint32_t paramsCount = params->count(plugin);
     59    // ...
     60 }
     61 ```
     62 
     63 The extensions are defined in the [ext](include/clap/ext) folder.
     64 
     65 Some extensions are still in the progress of being designed and they are in
     66 the [draft](include/clap/ext/draft) folder.
     67 
     68 An extension comes with:
     69 - a header `#include <clap/ext/xxx.h>`
     70 - an extension identifier: `#define CLAP_EXT_XXX "clap/XXX"`
     71 - host interfaces are named like: `struct clap_host_xxx`
     72 - plugin interfaces are named like: `struct clap_plugin_xxx`
     73 - each method must have a clear thread specification
     74 
     75 You can create your own extensions and share them. Make sure that the extension identifier:
     76 - includes versioning in case the ABI breaks
     77 - is a unique identifier
     78 
     79 **All strings are valid UTF-8**.
     80 
     81 ## Fundamental extensions
     82 
     83 This is a list of the extensions that you most likely want to implement
     84 and use to get a basic plugin experience:
     85 - [state](include/clap/ext/state.h), save and load the plugin state
     86   - [state-context](include/clap/ext/state-context.h), same as state but with additional context info (preset, duplicate, project)
     87   - [resource-directory](include/clap/ext/draft/resource-directory.h), host provided folder for the plugin to save extra resource like multi-samples, ... (draft)
     88 - [params](include/clap/ext/params.h), parameters management
     89 - [note-ports](include/clap/ext/note-ports.h), define the note ports
     90 - [audio-ports](include/clap/ext/audio-ports.h), define the audio ports
     91   - [surround](include/clap/ext/surround.h), inspect surround channel mapping
     92   - [ambisonic](include/clap/ext/draft/ambisonic.h), inspect ambisonic channel mapping
     93   - [configurable-audio-ports](include/clap/ext/configurable-audio-ports.h), request the plugin to apply a given configuration
     94   - [audio-ports-config](include/clap/ext/audio-ports-config.h), simple list of pre-defined audio ports configurations, meant to be exposed to the user
     95   - [audio-ports-activation](include/clap/ext/audio-ports-activation.h), activate and deactivate a given audio port
     96   - [extensible-audio-ports](include/clap/ext/draft/extensible-audio-ports.h), let the host add audio ports to the plugin, this is useful for dynamic number of audio inputs (draft)
     97 - [render](include/clap/ext/render.h), renders realtime or offline
     98 - [latency](include/clap/ext/latency.h), report the plugin latency
     99 - [tail](include/clap/ext/tail.h), processing tail length
    100 - [gui](include/clap/ext/gui.h), generic gui controller
    101 - [voice-info](include/clap/ext/voice-info.h), let the host know how many voices the plugin has, this is important for polyphonic modulations
    102 - [track-info](include/clap/ext/track-info.h), give some info to the plugin about the track it belongs to
    103 - [tuning](include/clap/ext/draft/tuning.h), host provided microtuning (draft)
    104 - [triggers](include/clap/ext/draft/triggers.h), plugin's triggers, similar to parameters but stateless
    105 
    106 ## Support extensions
    107 
    108 - [thread-check](include/clap/ext/thread-check.h), check which thread you are currently on, useful for correctness validation
    109 - [thread-pool](include/clap/ext/thread-pool.h), use the host thread pool
    110 - [log](include/clap/ext/log.h), lets the host aggregate plugin logs
    111 - [timer-support](include/clap/ext/timer-support.h), lets the plugin register timer handlers
    112 - [posix-fd-support](include/clap/ext/posix-fd-support.h), lets the plugin register I/O handlers
    113 
    114 ## Deeper Host integration
    115 
    116 - [remote-controls](include/clap/ext/remote-controls.h), bank of controls that can be mapped on a controlles with 8 knobs
    117 - [preset-discovery](include/clap/factory/preset-discovery.h), let the host index the plugin's preset in their native file format
    118 - [preset-load](include/clap/ext/preset-load.h), let the host ask the plugin to load a preset
    119 - [param-indication](include/clap/ext/param-indication.h), let the plugin know when a physical control is mapped to a parameter and if there is automation data
    120 - [note-name](include/clap/ext/note-name.h), give a name to notes, useful for drum machines
    121 - [transport-control](include/clap/ext/draft/transport-control.h), let the plugin control the host's transport (draft)
    122 - [context-menu](include/clap/ext/context-menu.h), exchange context menu entries between host and plugin, let the plugin ask the host to popup its own context menu
    123 
    124 ## Third-party extensions
    125 
    126 - [`cockos.reaper_extension`](https://github.com/justinfrankel/reaper-sdk/blob/main/reaper-plugins/reaper_plugin.h#L138), access the [REAPER](http://reaper.fm) API
    127 
    128 # Adapters
    129 
    130 - [clap-wrapper](https://github.com/free-audio/clap-wrapper), wrappers for using CLAP in other plugin environments
    131 
    132 # Resources
    133 
    134 - [clap-validator](https://github.com/robbert-vdh/clap-validator), a validator and automatic test suite for CLAP plugins.
    135 - [clapdb](https://clapdb.tech), a list of plugins and DAWs which supports CLAP
    136 
    137 ## Examples
    138 
    139 - [clap-host](https://github.com/free-audio/clap-host), very simple host
    140 - [clap-plugins](https://github.com/free-audio/clap-plugins), very simple plugins
    141 
    142 ## Community related projects
    143 
    144 - [clap-juce-extension](https://github.com/free-audio/clap-juce-extension), juce add-on
    145 - [MIP2](https://github.com/skei/MIP2), host and plugins
    146 - [Avendish](https://github.com/celtera/avendish), a reflection-based API for media plug-ins in C++ which supports Clap
    147 - [NIH-plug](https://github.com/robbert-vdh/nih-plug), an API-agnostic, Rust-based plugin framework aiming to reduce boilerplate without getting in your way
    148 - [iPlug2](https://iplug2.github.io), a liberally licensed C++ audio plug-in framework that supports Clap
    149 
    150 ## Programming Language Bindings
    151 
    152 - [clap-sys](https://github.com/glowcoil/clap-sys), rust binding
    153 - [CLAP-for-Delphi](https://github.com/Bremmers/CLAP-for-Delphi), Delphi binding
    154 - [clap-zig-bindings](https://sr.ht/~interpunct/clap-zig-bindings/), Zig bindings
    155 - [CLAP for Ada](https://github.com/ficorax/cfa), Ada 2012 binding
    156 
    157 ## Artwork
    158 
    159  - [CLAP Logo Pack.zip](https://github.com/free-audio/clap/files/8805281/CLAP.Logo.Pack.zip)