From abcdf1124e6de62d439b5f629d44ae260947160f Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Thu, 16 Jun 2022 00:26:09 +0200 Subject: [PATCH 01/51] Fix an inconsistence in `clap_plugin->destroy()` documentation --- ChangeLog.md | 5 +++++ include/clap/plugin.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index c183fdc2..9930d03e 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,8 @@ +# Changes in 1.0.3 + +* Fix an inconsistence in `clap_plugin->destroy()` documentation: + it is now **required** to deactivate the plugin before destroying it. + # Changes in 1.0.2 * CMake: add `CLAP_BUILD_TESTS` which enables the tests. diff --git a/include/clap/plugin.h b/include/clap/plugin.h index 4f602a83..dedeac89 100644 --- a/include/clap/plugin.h +++ b/include/clap/plugin.h @@ -41,7 +41,7 @@ typedef struct clap_plugin { bool (*init)(const struct clap_plugin *plugin); // Free the plugin and its resources. - // It is not required to deactivate the plugin prior to this call. + // It is required to deactivate the plugin prior to this call. // [main-thread & !active] void (*destroy)(const struct clap_plugin *plugin); From 02fa58b30d404c8f50badcf67c6d910a46bd7db8 Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Fri, 17 Jun 2022 09:28:23 +0200 Subject: [PATCH 02/51] improve documentation for `clap_host_params->request_flush()` --- ChangeLog.md | 1 + include/clap/ext/params.h | 11 ++++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 9930d03e..87ccfca0 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -2,6 +2,7 @@ * Fix an inconsistence in `clap_plugin->destroy()` documentation: it is now **required** to deactivate the plugin before destroying it. +* Improve documentation for `clap_host_params->request_flush()`. # Changes in 1.0.2 diff --git a/include/clap/ext/params.h b/include/clap/ext/params.h index bbb4df1f..104c909f 100644 --- a/include/clap/ext/params.h +++ b/include/clap/ext/params.h @@ -279,16 +279,13 @@ typedef struct clap_host_params { // [main-thread] void (*clear)(const clap_host_t *host, clap_id param_id, clap_param_clear_flags flags); - // Request the host to call clap_plugin_params->fush(). - // This is useful if the plugin has parameters value changes to report to the host but the plugin - // is not processing. + // Request a parameter flush. // - // eg. the plugin has a USB socket to some hardware controllers and receives a parameter change - // while it is not processing. + // If the plugin is processing, then the parameters flush will happen during the process() call. + // If the plugin isn't processing, then the host will call to clap_plugin_params->fush(). // // This must not be called on the [audio-thread]. - // - // [thread-safe] + // [thread-safe,!audio-thread] void (*request_flush)(const clap_host_t *host); } clap_host_params_t; From de8a1ce2d2e225768239ffc076c03563c2ef81c7 Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Fri, 17 Jun 2022 09:55:29 +0200 Subject: [PATCH 03/51] Clarify the the documentation regarding clap search path using @baconpaul's suggestion --- include/clap/entry.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/clap/entry.h b/include/clap/entry.h index c58676b6..116b7c86 100644 --- a/include/clap/entry.h +++ b/include/clap/entry.h @@ -23,8 +23,13 @@ extern "C" { // - /Library/Audio/Plug-Ins/CLAP // - ~/Library/Audio/Plug-Ins/CLAP // -// Additionally, extra path may be specified in CLAP_PATH environment variable. -// CLAP_PATH is formated in the same way as the OS' binary search path (PATH on UNIX, Path on Windows). +// In addition to the OS-specific default locations above, a CLAP host must query the environment +// for a CLAP_PATH variable, which is a list of directories formatted in the same manner as the host +// OS binary search path (PATH on Unix, separated by `:` and Path on Windows, separated by ';', as +// of this writing). +// +// Each directory should be recursively searched for files and/or bundles as appropriate in your OS +// ending with the extension `.clap`. // // Every methods must be thread-safe. typedef struct clap_plugin_entry { From ae1a397b7daa71e1ba92fb9e5808a62df6668ff2 Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Fri, 17 Jun 2022 11:08:06 +0200 Subject: [PATCH 04/51] fix typo --- ChangeLog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 87ccfca0..a7da0fdf 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,6 +1,6 @@ # Changes in 1.0.3 -* Fix an inconsistence in `clap_plugin->destroy()` documentation: +* Fix an inconsistency in `clap_plugin->destroy()` documentation: it is now **required** to deactivate the plugin before destroying it. * Improve documentation for `clap_host_params->request_flush()`. From 49b4b87190af6a19477c89c75510c6a5d902984b Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Fri, 17 Jun 2022 13:19:46 +0200 Subject: [PATCH 05/51] Update changelog --- ChangeLog.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index a7da0fdf..9e6d27d7 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -2,7 +2,8 @@ * Fix an inconsistency in `clap_plugin->destroy()` documentation: it is now **required** to deactivate the plugin before destroying it. -* Improve documentation for `clap_host_params->request_flush()`. +* [params.h](include/clap/ext/params.h): improve documentation for `clap_host_params->request_flush()`. +* [entry.h](include/clap/entry.h): improve documentation regarding CLAP search path. # Changes in 1.0.2 From b07c141f931de4360d7b1f3f88ad3edf632eac68 Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Fri, 17 Jun 2022 13:22:20 +0200 Subject: [PATCH 06/51] Apply baconpaul's suggested documentation --- include/clap/ext/params.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/clap/ext/params.h b/include/clap/ext/params.h index 104c909f..a9f40626 100644 --- a/include/clap/ext/params.h +++ b/include/clap/ext/params.h @@ -281,8 +281,11 @@ typedef struct clap_host_params { // Request a parameter flush. // - // If the plugin is processing, then the parameters flush will happen during the process() call. - // If the plugin isn't processing, then the host will call to clap_plugin_params->fush(). + // If the plugin is processing, this will result in no action. The process call + // will run normally. If plugin isn't processing, the host will make a subsequent + // call to clap_plugin_params->flush(). As a result, this function is always + // safe to call from a non-audio thread (typically the UI thread on a gesture) + // whether processing is active or not. // // This must not be called on the [audio-thread]. // [thread-safe,!audio-thread] From ebab956431b93cac5acbccddfaabe8cf5f912bad Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Fri, 17 Jun 2022 13:23:47 +0200 Subject: [PATCH 07/51] Update changelog --- ChangeLog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 9e6d27d7..9fd4a17b 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,6 +1,6 @@ # Changes in 1.0.3 -* Fix an inconsistency in `clap_plugin->destroy()` documentation: +* [plugin.h](include/clap/plugin.h): fix an inconsistency in `clap_plugin->destroy()` documentation: it is now **required** to deactivate the plugin before destroying it. * [params.h](include/clap/ext/params.h): improve documentation for `clap_host_params->request_flush()`. * [entry.h](include/clap/entry.h): improve documentation regarding CLAP search path. From 8dfc9916e7501b94d7cb2360a2b3ae228eedc3e6 Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Fri, 17 Jun 2022 22:56:49 +0200 Subject: [PATCH 08/51] Typo --- include/clap/ext/draft/quick-controls.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/clap/ext/draft/quick-controls.h b/include/clap/ext/draft/quick-controls.h index a555c96a..39ef5d50 100644 --- a/include/clap/ext/draft/quick-controls.h +++ b/include/clap/ext/draft/quick-controls.h @@ -3,7 +3,7 @@ #include "../../plugin.h" #include "../../string-sizes.h" -// This extensions provides a set a pages, where each page contains up to 8 controls. +// This extensions provides a set of pages, where each page contains up to 8 controls. // Those controls are param_id, and they are meant to be mapped onto a physical controller. // We chose 8 because this what most controllers offers, and it is more or less a standard. From d08b47a24be7232df097b2cd2f2c3188b2a8819b Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Sat, 18 Jun 2022 09:27:54 +0200 Subject: [PATCH 09/51] Fix typo From this PR: #104 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ab06760a..97880daa 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Some extensions are still in the progress of being designed and they are in the [draft](include/clap/ext/draft) folder. An extension comes with: -- an header `#include ` +- a header `#include ` - 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` From 597b0b8132d23164d6dd42d9bb627311939f3b07 Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Sat, 18 Jun 2022 09:36:37 +0200 Subject: [PATCH 10/51] Fix typo clap_gui_resize_hints.preserve_aspect_ratio Fixes #109 --- ChangeLog.md | 1 + include/clap/ext/gui.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 9fd4a17b..41e74549 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -4,6 +4,7 @@ it is now **required** to deactivate the plugin before destroying it. * [params.h](include/clap/ext/params.h): improve documentation for `clap_host_params->request_flush()`. * [entry.h](include/clap/entry.h): improve documentation regarding CLAP search path. +* [gui.h](inclued/clap/gui.h): fix typo `clap_gui_resize_hints.preserve_aspect_ratio` # Changes in 1.0.2 diff --git a/include/clap/ext/gui.h b/include/clap/ext/gui.h index 944dd7ef..a3dfb954 100644 --- a/include/clap/ext/gui.h +++ b/include/clap/ext/gui.h @@ -86,7 +86,7 @@ typedef struct clap_gui_resize_hints { bool can_resize_vertically; // only if can resize horizontally and vertically - bool preseve_aspect_ratio; + bool preserve_aspect_ratio; uint32_t aspect_ratio_width; uint32_t aspect_ratio_height; } clap_gui_resize_hints_t; From 40b2f00bc9ace0366f7c5b984336f4eb3e481b16 Mon Sep 17 00:00:00 2001 From: Hammy Havoc Date: Sun, 19 Jun 2022 00:25:31 +0100 Subject: [PATCH 11/51] Added MultitrackStudio and QTractor to readme Figured it's best to keep this up to date for when devs check the repo. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index ab06760a..8b29ec3b 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,8 @@ and use to get a basic plugin experience: ## Hosts - [Bitwig](https://bitwig.com), you need at least _Bitwig Studio 4.3 Beta 5_ +- [Multitrackstudio](https://www.multitrackstudio.com/), you need at least _Multitrack Studio 10.4.1_ +- [QTractor](https://www.qtractor.org) ## Examples From 23867a43f8acf9014f575788f65fe735f214f315 Mon Sep 17 00:00:00 2001 From: Hammy Havoc Date: Sun, 19 Jun 2022 00:27:52 +0100 Subject: [PATCH 12/51] Amended stylization of Qtractor :- ) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8b29ec3b..9ce43954 100644 --- a/README.md +++ b/README.md @@ -116,7 +116,7 @@ and use to get a basic plugin experience: - [Bitwig](https://bitwig.com), you need at least _Bitwig Studio 4.3 Beta 5_ - [Multitrackstudio](https://www.multitrackstudio.com/), you need at least _Multitrack Studio 10.4.1_ -- [QTractor](https://www.qtractor.org) +- [Qtractor](https://www.qtractor.org) ## Examples From 9d3f06f3685bd7006844baf3d6160470b5a96d90 Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Mon, 20 Jun 2022 10:16:17 +0200 Subject: [PATCH 13/51] Fix typo in MultitrackStudio --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 323963b9..03c878a0 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ and use to get a basic plugin experience: ## Hosts - [Bitwig](https://bitwig.com), you need at least _Bitwig Studio 4.3 Beta 5_ -- [Multitrackstudio](https://www.multitrackstudio.com/), you need at least _Multitrack Studio 10.4.1_ +- [MultitrackStudio](https://www.multitrackstudio.com/), you need at least _MultitrackStudio 10.4.1_ - [Qtractor](https://www.qtractor.org) ## Examples From 48c39552dbbd5248e129d810f1b0783f144ddccd Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Mon, 20 Jun 2022 12:21:55 +0200 Subject: [PATCH 14/51] Fixed typo for NIH --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 03c878a0..3288e259 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,7 @@ and use to get a basic plugin experience: - [clap-juce-extension](https://github.com/free-audio/clap-juce-extension), juce add-on - [MIP2](https://github.com/skei/MIP2), host and plugins - [Avendish](https://github.com/celtera/avendish), a reflection-based API for media plug-ins in C++ which supports Clap -- [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 +- [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 ## Programming Language Bindings From 4abea7523a9cf080746ccce59a718c5b881bd1d8 Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Mon, 20 Jun 2022 10:01:52 -0400 Subject: [PATCH 15/51] entry.h: Clarify recursion stopping points Clarify the .clap file type on OS as bundle vs directory and subsequent host stopping behavior --- include/clap/entry.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/clap/entry.h b/include/clap/entry.h index 116b7c86..3d63e4a1 100644 --- a/include/clap/entry.h +++ b/include/clap/entry.h @@ -29,9 +29,11 @@ extern "C" { // of this writing). // // Each directory should be recursively searched for files and/or bundles as appropriate in your OS -// ending with the extension `.clap`. +// ending with the extension `.clap`. On windows and linux, the '.clap' file is a renamed shared +// library object, so traversing the path should stop at regular files or symlinks. On macOS +// the '.clap' file is a bundle, so traversing the path should stop at directories. // -// Every methods must be thread-safe. +// Every method must be thread-safe. typedef struct clap_plugin_entry { clap_version_t clap_version; // initialized to CLAP_VERSION From aa39f902b228016dd04492eb074faeae5d346b38 Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Mon, 20 Jun 2022 11:24:26 -0400 Subject: [PATCH 16/51] Respond to review feedback --- include/clap/entry.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/clap/entry.h b/include/clap/entry.h index 3d63e4a1..b99e0a2a 100644 --- a/include/clap/entry.h +++ b/include/clap/entry.h @@ -29,9 +29,12 @@ extern "C" { // of this writing). // // Each directory should be recursively searched for files and/or bundles as appropriate in your OS -// ending with the extension `.clap`. On windows and linux, the '.clap' file is a renamed shared -// library object, so traversing the path should stop at regular files or symlinks. On macOS -// the '.clap' file is a bundle, so traversing the path should stop at directories. +// ending with the extension `.clap`. +// +// On Windows and Linux, the '.clap' file is a renamed shared library object, so traversing the path +// should stop at the first non-directory (regular file, symlink, etc...) whose name ends in '.clap'. +// On macOS the '.clap' file is a bundle, so traversing the path should stop at directories whose +// name ends in '.clap'. // // Every method must be thread-safe. typedef struct clap_plugin_entry { From 09b86fc27b95dd85c85fecb7c21c51ce05cc96d4 Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Wed, 22 Jun 2022 07:35:20 +0200 Subject: [PATCH 17/51] cmake: clap-tests should always be available --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c3402e1c..9bb4b865 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,9 +12,12 @@ target_include_directories(clap-core INTERFACE include) install(DIRECTORY include DESTINATION "." OPTIONAL EXCLUDE_FROM_ALL) +# clap-tests should always be available, to avoid build failing here and there +# because the target doesn't exists +add_custom_target(clap-tests) + if (${CLAP_BUILD_TESTS}) message(STATUS "Including CLAP tests, compile tests, and versions") - add_custom_target(clap-tests) macro(clap_compile_cpp SUFFIX EXT STDC STDCPP) add_executable(clap-compile-${SUFFIX} EXCLUDE_FROM_ALL src/main.${EXT}) From 8789c836fa962d50a940f2a8d76b37f53dd6d669 Mon Sep 17 00:00:00 2001 From: Tobias Hienzsch Date: Wed, 22 Jun 2022 23:27:05 +0200 Subject: [PATCH 18/51] Fix typo in thread-pool.h --- include/clap/ext/thread-pool.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/clap/ext/thread-pool.h b/include/clap/ext/thread-pool.h index 2b4d6354..3a18865d 100644 --- a/include/clap/ext/thread-pool.h +++ b/include/clap/ext/thread-pool.h @@ -27,7 +27,7 @@ /// /// if (!didComputeVoices) /// for (uint32_t i = 0; i < N; ++i) -/// myplug_thread_pool_exec(plugin, N); +/// myplug_thread_pool_exec(plugin, i); /// ... /// } /// @endcode From 0dd71f49f16121a07f457aa6e36e955cf12649d8 Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Thu, 23 Jun 2022 08:50:50 +0200 Subject: [PATCH 19/51] plugin-template.c: missing impl of plugin destroy --- ChangeLog.md | 1 + src/plugin-template.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 41e74549..d5fbfb1a 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -5,6 +5,7 @@ * [params.h](include/clap/ext/params.h): improve documentation for `clap_host_params->request_flush()`. * [entry.h](include/clap/entry.h): improve documentation regarding CLAP search path. * [gui.h](inclued/clap/gui.h): fix typo `clap_gui_resize_hints.preserve_aspect_ratio` +* [plugin-template](src/plugin-template.c): missing impl of plugin destroy. # Changes in 1.0.2 diff --git a/src/plugin-template.c b/src/plugin-template.c index ee300539..af34c74f 100644 --- a/src/plugin-template.c +++ b/src/plugin-template.c @@ -114,7 +114,9 @@ static bool my_plug_init(const struct clap_plugin *plugin) { return true; } -static void my_plug_destroy(const struct clap_plugin *plugin) {} +static void my_plug_destroy(const struct clap_plugin *plugin) { + free(plugin); +} static bool my_plug_activate(const struct clap_plugin *plugin, double sample_rate, From b6b0df4b4c97c6ddb589e2f125366c81b27ef410 Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Thu, 23 Jun 2022 12:28:27 +0200 Subject: [PATCH 20/51] plugin-template.c: better destroy code --- src/plugin-template.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugin-template.c b/src/plugin-template.c index af34c74f..3a3c39a9 100644 --- a/src/plugin-template.c +++ b/src/plugin-template.c @@ -115,7 +115,8 @@ static bool my_plug_init(const struct clap_plugin *plugin) { } static void my_plug_destroy(const struct clap_plugin *plugin) { - free(plugin); + my_plug_t *plug = plugin->plugin_data; + free(plug); } static bool my_plug_activate(const struct clap_plugin *plugin, From 94128f7d5c616fc35565ed8b8ef6c2f69362bd88 Mon Sep 17 00:00:00 2001 From: joshnatis Date: Fri, 24 Jun 2022 11:08:45 -0400 Subject: [PATCH 21/51] Fix typo in plugin-template.c --- src/plugin-template.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugin-template.c b/src/plugin-template.c index ee300539..1ff11b5b 100644 --- a/src/plugin-template.c +++ b/src/plugin-template.c @@ -142,7 +142,7 @@ static void my_plug_process_event(my_plug_t *plug, const clap_event_header_t *hd case CLAP_EVENT_NOTE_OFF: { const clap_event_note_t *ev = (const clap_event_note_t *)hdr; - // TODO: handle note on + // TODO: handle note off break; } From 443704e73429ce4c14c75a08ba51876eb3a79514 Mon Sep 17 00:00:00 2001 From: joshnatis Date: Fri, 24 Jun 2022 11:24:56 -0400 Subject: [PATCH 22/51] Fix typos in README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ab06760a..2d0d9e73 100644 --- a/README.md +++ b/README.md @@ -53,21 +53,21 @@ if (params) } ``` -The extensions are defined in [ext](include/clap/ext) folder. +The extensions are defined in the [ext](include/clap/ext) folder. Some extensions are still in the progress of being designed and they are in the [draft](include/clap/ext/draft) folder. An extension comes with: -- an header `#include ` +- a header `#include ` - 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 +- each method must have a clear thread specification -You can create your own extensions and share them, make sure that the extension identifier +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 +- is a unique identifier **All strings are valid UTF-8**. @@ -109,7 +109,7 @@ and use to get a basic plugin experience: ## Plugins - [u-he](https://u-he.com/fwd/clap/), synthesizers and effects -- [Surge](https://surge-synthesizer.github.io/), open source synthesizer and effect +- [Surge](https://surge-synthesizer.github.io/), open source synthesizer and effects - CLAP is enabled in [nightly builds](https://github.com/surge-synthesizer/releases-xt/releases/tag/Nightly) ## Hosts From 6bcc7af38a2c8e0cd7b7f0214ab5919b92043b10 Mon Sep 17 00:00:00 2001 From: joshnatis Date: Fri, 24 Jun 2022 11:36:24 -0400 Subject: [PATCH 23/51] Fix typos in entry.h --- include/clap/entry.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/clap/entry.h b/include/clap/entry.h index c58676b6..2c8d604b 100644 --- a/include/clap/entry.h +++ b/include/clap/entry.h @@ -23,20 +23,20 @@ extern "C" { // - /Library/Audio/Plug-Ins/CLAP // - ~/Library/Audio/Plug-Ins/CLAP // -// Additionally, extra path may be specified in CLAP_PATH environment variable. -// CLAP_PATH is formated in the same way as the OS' binary search path (PATH on UNIX, Path on Windows). +// Additionally, extra paths may be specified in CLAP_PATH environment variable. +// CLAP_PATH is formatted in the same way as the OS' binary search path (PATH on UNIX, Path on Windows). // -// Every methods must be thread-safe. +// Every method must be thread-safe. typedef struct clap_plugin_entry { clap_version_t clap_version; // initialized to CLAP_VERSION // This function must be called first, and can only be called once. // - // It should be as fast as possible, in order to perform very quick scan of the plugin + // It should be as fast as possible, in order to perform a very quick scan of the plugin // descriptors. // // It is forbidden to display graphical user interface in this call. - // It is forbidden to perform user inter-action in this call. + // It is forbidden to perform user interaction in this call. // // If the initialization depends upon expensive computation, maybe try to do them ahead of time // and cache the result. From 8598a105e94f0c973ff75707d9758037682e8bae Mon Sep 17 00:00:00 2001 From: joshnatis Date: Fri, 24 Jun 2022 11:45:15 -0400 Subject: [PATCH 24/51] Fix typos in process.h --- include/clap/process.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/clap/process.h b/include/clap/process.h index f346bfa3..d5bf572a 100644 --- a/include/clap/process.h +++ b/include/clap/process.h @@ -11,18 +11,18 @@ enum { // Processing failed. The output buffer must be discarded. CLAP_PROCESS_ERROR = 0, - // Processing succeed, keep processing. + // Processing succeeded, keep processing. CLAP_PROCESS_CONTINUE = 1, - // Processing succeed, keep processing if the output is not quiet. + // Processing succeeded, keep processing if the output is not quiet. CLAP_PROCESS_CONTINUE_IF_NOT_QUIET = 2, // Rely upon the plugin's tail to determine if the plugin should continue to process. // see clap_plugin_tail CLAP_PROCESS_TAIL = 3, - // Processing succeed, but no more processing is required, - // until next event or variation in audio input. + // Processing succeeded, but no more processing is required, + // until the next event or variation in audio input. CLAP_PROCESS_SLEEP = 4, }; typedef int32_t clap_process_status; @@ -37,7 +37,7 @@ typedef struct clap_process { // and must be increased by at least `frames_count` for the next call to process. int64_t steady_time; - // Number of frame to process + // Number of frames to process uint32_t frames_count; // time info at sample 0 From aee35cf65d024f55f6d66617748d1d50b9be8ad2 Mon Sep 17 00:00:00 2001 From: joshnatis Date: Fri, 24 Jun 2022 11:46:27 -0400 Subject: [PATCH 25/51] Fix typos in plugin-features.h --- include/clap/plugin-features.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/clap/plugin-features.h b/include/clap/plugin-features.h index cb6f78e4..624ab39b 100644 --- a/include/clap/plugin-features.h +++ b/include/clap/plugin-features.h @@ -2,13 +2,13 @@ #include "private/macros.h" -// This files provides a set of standard plugin features meant to be use +// This file provides a set of standard plugin features meant to be used // within clap_plugin_descriptor.features. // // For practical reasons we'll avoid spaces and use `-` instead to facilitate // scripts that generate the feature array. // -// Non standard feature should be formated as follow: "$namespace:$feature" +// Non-standard features should be formated as follow: "$namespace:$feature" ///////////////////// // Plugin category // From be4e94e1514f1d72edd5362e94cba34b3bb8eb9b Mon Sep 17 00:00:00 2001 From: joshnatis Date: Fri, 24 Jun 2022 11:47:39 -0400 Subject: [PATCH 26/51] Fix typos in plugin-factory.h --- include/clap/plugin-factory.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/clap/plugin-factory.h b/include/clap/plugin-factory.h index 866c17e2..07e8560c 100644 --- a/include/clap/plugin-factory.h +++ b/include/clap/plugin-factory.h @@ -8,7 +8,7 @@ static const CLAP_CONSTEXPR char CLAP_PLUGIN_FACTORY_ID[] = "clap.plugin-factory extern "C" { #endif -// Every methods must be thread-safe. +// Every method must be thread-safe. // It is very important to be able to scan the plugin as quickly as possible. // // If the content of the factory may change due to external events, like the user installed From 3196c93edbc085ffd65b9824d8133cd300cc1876 Mon Sep 17 00:00:00 2001 From: joshnatis Date: Fri, 24 Jun 2022 11:55:17 -0400 Subject: [PATCH 27/51] Fix typos in events.h --- include/clap/events.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/include/clap/events.h b/include/clap/events.h index 6322211a..db2314f1 100644 --- a/include/clap/events.h +++ b/include/clap/events.h @@ -22,7 +22,7 @@ typedef struct clap_event_header { static const CLAP_CONSTEXPR uint16_t CLAP_CORE_EVENT_SPACE_ID = 0; enum clap_event_flags { - // Indicate a live user event, for example a user turning a phisical knob + // Indicate a live user event, for example a user turning a physical knob // or playing a physical key. CLAP_EVENT_IS_LIVE = 1 << 0, @@ -46,11 +46,11 @@ enum clap_event_flags { // The plugins are encouraged to be able to handle note events encoded as raw midi or midi2, // or implement clap_plugin_event_filter and reject raw midi and midi2 events. enum { - // NOTE_ON and NOTE_OFF represents a key pressed and key released event. + // NOTE_ON and NOTE_OFF represent a key pressed and key released event, respectively. // A NOTE_ON with a velocity of 0 is valid and should not be interpreted as a NOTE_OFF. // // NOTE_CHOKE is meant to choke the voice(s), like in a drum machine when a closed hihat - // chokes an open hihat. This event can be sent by the host to the plugin. Here two use case: + // chokes an open hihat. This event can be sent by the host to the plugin. Here are two use cases: // - a plugin is inside a drum pad in Bitwig Studio's drum machine, and this pad is choked by // another one // - the user double clicks the DAW's stop button in the transport which then stops the sound on @@ -77,11 +77,11 @@ enum { // Host->Plugin NoteOff(port:0, channel:0, key:64, t1) // # on t2, both notes did terminate // Host->Plugin NoteOn(port:0, channel:0, key:64, t3) - // # Here the plugin finished to process all the frames and will tell the host + // # Here the plugin finished processing all the frames and will tell the host // # to terminate the voice on key 16 but not 64, because a note has been started at t3 // Plugin->Host NoteEnd(port:0, channel:0, key:16, time:ignored) // - // Those four events use clap_event_note. + // These four events use clap_event_note. CLAP_EVENT_NOTE_ON, CLAP_EVENT_NOTE_OFF, CLAP_EVENT_NOTE_CHOKE, @@ -102,9 +102,9 @@ enum { CLAP_EVENT_PARAM_VALUE, CLAP_EVENT_PARAM_MOD, - // Indicates that the user started or finished to adjust a knob. - // This is not mandatory to wrap parameter changes with gesture events, but this improves a lot - // the user experience when recording automation or overriding automation playback. + // Indicates that the user started or finished adjusting a knob. + // This is not mandatory to wrap parameter changes with gesture events, but this improves + // the user experience a lot when recording automation or overriding automation playback. // Uses clap_event_param_gesture. CLAP_EVENT_PARAM_GESTURE_BEGIN, CLAP_EVENT_PARAM_GESTURE_END, From 1f2667f39c9293b9239da8cd6258838d5dfe75a2 Mon Sep 17 00:00:00 2001 From: joshnatis Date: Fri, 24 Jun 2022 11:59:52 -0400 Subject: [PATCH 28/51] Fix typos in thread-pool.h --- include/clap/ext/thread-pool.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/clap/ext/thread-pool.h b/include/clap/ext/thread-pool.h index 2b4d6354..c354aaec 100644 --- a/include/clap/ext/thread-pool.h +++ b/include/clap/ext/thread-pool.h @@ -4,10 +4,10 @@ /// @page /// -/// This extension let the plugin use the host's thread pool. +/// This extension lets the plugin use the host's thread pool. /// /// The plugin must provide @ref clap_plugin_thread_pool, and the host may provide @ref -/// clap_host_thread_pool. If it doesn't, the plugin should process its data by its own mean. In the +/// clap_host_thread_pool. If it doesn't, the plugin should process its data by its own means. In the /// worst case, a single threaded for-loop. /// /// Simple example with N voices to process From 47ae594f8ae46066754f950d486d485f41070aeb Mon Sep 17 00:00:00 2001 From: joshnatis Date: Fri, 24 Jun 2022 12:14:09 -0400 Subject: [PATCH 29/51] Fix typos in params.h --- include/clap/ext/params.h | 42 +++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/include/clap/ext/params.h b/include/clap/ext/params.h index bbb4df1f..85c7ad11 100644 --- a/include/clap/ext/params.h +++ b/include/clap/ext/params.h @@ -8,13 +8,13 @@ /// /// Main idea: /// -/// The host sees the plugin as an atomic entity; and acts as a controler on top of its parameters. -/// The plugin is responsible to keep in sync its audio processor and its GUI. +/// The host sees the plugin as an atomic entity; and acts as a controller on top of its parameters. +/// The plugin is responsible for keeping its audio processor and its GUI in sync. /// -/// The host can read at any time parameters value on the [main-thread] using +/// The host can at any time read parameters' value on the [main-thread] using /// @ref clap_plugin_params.value(). /// -/// There is two options to communicate parameter value change, and they are not concurrent. +/// There are two options to communicate parameter value changes, and they are not concurrent. /// - send automation points during clap_plugin.process() /// - send automation points during clap_plugin_params.flush(), this one is used when the plugin is /// not processing @@ -22,10 +22,10 @@ /// When the plugin changes a parameter value, it must inform the host. /// It will send @ref CLAP_EVENT_PARAM_VALUE event during process() or flush(). /// If the user is adjusting the value, don't forget to mark the begining and end -/// of the gesture by send CLAP_EVENT_PARAM_GESTURE_BEGIN and CLAP_EVENT_PARAM_GESTURE_END events. +/// of the gesture by sending CLAP_EVENT_PARAM_GESTURE_BEGIN and CLAP_EVENT_PARAM_GESTURE_END events. /// -/// @note MIDI CCs are a tricky because you may not know when the parameter adjustment ends. -/// Also if the hosts records incoming MIDI CC and parameter change automation at the same time, +/// @note MIDI CCs are tricky because you may not know when the parameter adjustment ends. +/// Also if the host records incoming MIDI CC and parameter change automation at the same time, /// there will be a conflict at playback: MIDI CC vs Automation. /// The parameter automation will always target the same parameter because the param_id is stable. /// The MIDI CC may have a different mapping in the future and may result in a different playback. @@ -41,11 +41,11 @@ /// - call @ref clap_host_params.changed() if anything changed /// - call @ref clap_host_latency.changed() if latency changed /// - invalidate any other info that may be cached by the host -/// - if the plugin is activated and the preset will introduce breaking change +/// - if the plugin is activated and the preset will introduce breaking changes /// (latency, audio ports, new parameters, ...) be sure to wait for the host /// to deactivate the plugin to apply those changes. /// If there are no breaking changes, the plugin can apply them them right away. -/// The plugin is resonsible to update both its audio processor and its gui. +/// The plugin is resonsible for updating both its audio processor and its gui. /// /// II. Turning a knob on the DAW interface /// - the host will send an automation event to the plugin via a process() or flush() @@ -55,11 +55,11 @@ /// clap_host->request_process(). /// - send an automation event and don't forget to set begin_adjust, end_adjust and should_record /// flags -/// - the plugin is responsible to send the parameter value to its audio processor +/// - the plugin is responsible for sending the parameter value to its audio processor /// /// IV. Turning a knob via automation /// - host sends an automation point during clap_plugin->process() or clap_plugin_params->flush(). -/// - the plugin is responsible to update its GUI +/// - the plugin is responsible for updating its GUI /// /// V. Turning a knob via plugin's internal MIDI mapping /// - the plugin sends a CLAP_EVENT_PARAM_SET output event, set should_record to false @@ -111,31 +111,31 @@ enum { // host->request_restart(), and perform the change once the plugin is re-activated. CLAP_PARAM_IS_AUTOMATABLE = 1 << 5, - // Does this param supports per note automations? + // Does this parameter support per note automations? CLAP_PARAM_IS_AUTOMATABLE_PER_NOTE_ID = 1 << 6, - // Does this param supports per note automations? + // Does this parameter support per key automations? CLAP_PARAM_IS_AUTOMATABLE_PER_KEY = 1 << 7, - // Does this param supports per channel automations? + // Does this parameter support per channel automations? CLAP_PARAM_IS_AUTOMATABLE_PER_CHANNEL = 1 << 8, - // Does this param supports per port automations? + // Does this parameter support per port automations? CLAP_PARAM_IS_AUTOMATABLE_PER_PORT = 1 << 9, - // Does the parameter support the modulation signal? + // Does this parameter support the modulation signal? CLAP_PARAM_IS_MODULATABLE = 1 << 10, - // Does this param supports per note automations? + // Does this parameter support per note automations? CLAP_PARAM_IS_MODULATABLE_PER_NOTE_ID = 1 << 11, - // Does this param supports per note automations? + // Does this parameter support per key automations? CLAP_PARAM_IS_MODULATABLE_PER_KEY = 1 << 12, - // Does this param supports per channel automations? + // Does this parameter support per channel automations? CLAP_PARAM_IS_MODULATABLE_PER_CHANNEL = 1 << 13, - // Does this param supports per channel automations? + // Does this parameter support per port automations? CLAP_PARAM_IS_MODULATABLE_PER_PORT = 1 << 14, // Any change to this parameter will affect the plugin output and requires to be done via @@ -280,7 +280,7 @@ typedef struct clap_host_params { void (*clear)(const clap_host_t *host, clap_id param_id, clap_param_clear_flags flags); // Request the host to call clap_plugin_params->fush(). - // This is useful if the plugin has parameters value changes to report to the host but the plugin + // This is useful if the plugin has parameter value changes to report to the host but the plugin // is not processing. // // eg. the plugin has a USB socket to some hardware controllers and receives a parameter change From a954e97b09ef319f4387db3f0f9cc5ba77f0bd34 Mon Sep 17 00:00:00 2001 From: joshnatis Date: Fri, 24 Jun 2022 12:16:12 -0400 Subject: [PATCH 30/51] Fix typos in note-name.h --- include/clap/ext/note-name.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/clap/ext/note-name.h b/include/clap/ext/note-name.h index dbee5bff..288ace7b 100644 --- a/include/clap/ext/note-name.h +++ b/include/clap/ext/note-name.h @@ -27,7 +27,7 @@ typedef struct clap_plugin_note_name { } clap_plugin_note_name; typedef struct clap_host_note_name { - // Informs the host that the note names has changed. + // Informs the host that the note names have changed. // [main-thread] void (*changed)(const clap_host_t *host); } clap_host_note_name_t; From f204f71cb83cb8c96141e8c78a2f4367245a847f Mon Sep 17 00:00:00 2001 From: joshnatis Date: Fri, 24 Jun 2022 12:16:54 -0400 Subject: [PATCH 31/51] Fix typos in log.h --- include/clap/ext/log.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/clap/ext/log.h b/include/clap/ext/log.h index fa14e6e0..bc3c2138 100644 --- a/include/clap/ext/log.h +++ b/include/clap/ext/log.h @@ -15,7 +15,7 @@ enum { CLAP_LOG_ERROR = 3, CLAP_LOG_FATAL = 4, - // Those severities should be used to report misbehaviour. + // These severities should be used to report misbehaviour. // The plugin one can be used by a layer between the plugin and the host. CLAP_LOG_HOST_MISBEHAVING = 5, CLAP_LOG_PLUGIN_MISBEHAVING = 6, From 97f18a4c1007bb1bee99070a6723cbdd26b22b5e Mon Sep 17 00:00:00 2001 From: joshnatis Date: Fri, 24 Jun 2022 12:21:54 -0400 Subject: [PATCH 32/51] Fix typos in gui.h --- include/clap/ext/gui.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/clap/ext/gui.h b/include/clap/ext/gui.h index 944dd7ef..c43202da 100644 --- a/include/clap/ext/gui.h +++ b/include/clap/ext/gui.h @@ -80,7 +80,7 @@ typedef struct clap_window { }; } clap_window_t; -// Information to improve window resizement when initiated by the host or window manager. +// Information to improve window resizing when initiated by the host or window manager. typedef struct clap_gui_resize_hints { bool can_resize_horizontally; bool can_resize_vertically; @@ -92,7 +92,7 @@ typedef struct clap_gui_resize_hints { } clap_gui_resize_hints_t; // Size (width, height) is in pixels; the corresponding windowing system extension is -// responsible to define if it is physical pixels or logical pixels. +// responsible for defining if it is physical pixels or logical pixels. typedef struct clap_plugin_gui { // Returns true if the requested gui api is supported // [main-thread] @@ -173,8 +173,8 @@ typedef struct clap_plugin_gui { // [main-thread] bool (*show)(const clap_plugin_t *plugin); - // Hide the window, this method do not free the resources, it just hides - // the window content. Yet it maybe a good idea to stop painting timers. + // Hide the window, this method does not free the resources, it just hides + // the window content. Yet it may be a good idea to stop painting timers. // [main-thread] bool (*hide)(const clap_plugin_t *plugin); } clap_plugin_gui_t; @@ -189,7 +189,7 @@ typedef struct clap_host_gui { * The host doesn't have to call set_size(). * * Note: if not called from the main thread, then a return value simply means that the host - * acknowledge the request and will process it asynchronously. If the request then can't be + * acknowledged the request and will process it asynchronously. If the request then can't be * satisfied then the host will call set_size() to revert the operation. * * [thread-safe] */ From 19b06367172b08ac2d34ae21d9aaaff6a9f7ab75 Mon Sep 17 00:00:00 2001 From: joshnatis Date: Fri, 24 Jun 2022 12:26:04 -0400 Subject: [PATCH 33/51] Fix typos in audio-ports.h --- include/clap/ext/audio-ports.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/clap/ext/audio-ports.h b/include/clap/ext/audio-ports.h index 78ebe8a0..64b3b248 100644 --- a/include/clap/ext/audio-ports.h +++ b/include/clap/ext/audio-ports.h @@ -27,14 +27,14 @@ enum { // Main port must be at index 0. CLAP_AUDIO_PORT_IS_MAIN = 1 << 0, - // The port can be used with 64 bits audio + // This port can be used with 64 bits audio CLAP_AUDIO_PORT_SUPPORTS_64BITS = 1 << 1, // 64 bits audio is preferred with this port CLAP_AUDIO_PORT_PREFERS_64BITS = 1 << 2, - // This port must be used with the same sample size as all the other ports which have this flags. - // In other words if all ports have this flags then the plugin may either be used entirely with + // This port must be used with the same sample size as all the other ports which have this flag. + // In other words if all ports have this flag then the plugin may either be used entirely with // 64 bits audio or 32 bits audio, but it can't be mixed. CLAP_AUDIO_PORT_REQUIRES_COMMON_SAMPLE_SIZE = 1 << 3, }; From 33a730da4dfe8e3408eb4a54f11e0cacdefa1e1c Mon Sep 17 00:00:00 2001 From: joshnatis Date: Fri, 24 Jun 2022 12:27:41 -0400 Subject: [PATCH 34/51] Fix typos in audio-ports-config.h --- include/clap/ext/audio-ports-config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/clap/ext/audio-ports-config.h b/include/clap/ext/audio-ports-config.h index 4cb0119c..1ab94d83 100644 --- a/include/clap/ext/audio-ports-config.h +++ b/include/clap/ext/audio-ports-config.h @@ -5,7 +5,7 @@ /// @page Audio Ports Config /// -/// This extension provides a way for the plugin to describe possible ports configurations, for +/// This extension provides a way for the plugin to describe possible port configurations, for /// example mono, stereo, surround, ... and a way for the host to select a configuration. /// /// After the plugin initialization, the host may scan the list of configurations and eventually @@ -18,7 +18,7 @@ /// /// The idea behind the configurations, is to let the user choose one via a menu. /// -/// Plugin with very complex configuration possibilities should let the user configure the ports +/// Plugins with very complex configuration possibilities should let the user configure the ports /// from the plugin GUI, and call @ref clap_host_audio_ports.rescan(CLAP_AUDIO_PORTS_RESCAN_ALL). static CLAP_CONSTEXPR const char CLAP_EXT_AUDIO_PORTS_CONFIG[] = "clap.audio-ports-config"; From c6260fafd420069ffb26007d0f677fdbfc603087 Mon Sep 17 00:00:00 2001 From: joshnatis Date: Fri, 24 Jun 2022 12:32:48 -0400 Subject: [PATCH 35/51] Fix typos in voice-info.h --- include/clap/ext/draft/voice-info.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/clap/ext/draft/voice-info.h b/include/clap/ext/draft/voice-info.h index 2d776543..8e9341b0 100644 --- a/include/clap/ext/draft/voice-info.h +++ b/include/clap/ext/draft/voice-info.h @@ -2,7 +2,7 @@ #include "../../plugin.h" -// This extensions indicates the number of voices the synthesizer. +// This extension indicates the number of voices the synthesizer has. // It is useful for the host when performing polyphonic modulations, // because the host needs its own voice management and should try to follow // what the plugin is doing: @@ -46,7 +46,7 @@ typedef struct clap_plugin_voice_info { } clap_plugin_voice_info_t; typedef struct clap_host_voice_info { - // informs the host that the voice info have changed + // informs the host that the voice info has changed // [main-thread] void (*changed)(const clap_host_t *host); } clap_host_voice_info_t; From 72ba706da75e81c41f92936bc4870d838baa8893 Mon Sep 17 00:00:00 2001 From: joshnatis Date: Fri, 24 Jun 2022 12:33:05 -0400 Subject: [PATCH 36/51] Fix typos in tuning.h --- include/clap/ext/draft/tuning.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/clap/ext/draft/tuning.h b/include/clap/ext/draft/tuning.h index 442b15b6..8bb5327a 100644 --- a/include/clap/ext/draft/tuning.h +++ b/include/clap/ext/draft/tuning.h @@ -35,7 +35,7 @@ typedef struct clap_plugin_tuning { // This extension provides a dynamic tuning table to the plugin. typedef struct clap_host_tuning { - // Gets the relative tuning in semitone against equal temperament with A4=440Hz. + // Gets the relative tuning in semitones against equal temperament with A4=440Hz. // The plugin may query the tuning at a rate that makes sense for *low* frequency modulations. // // If the tuning_id is not found or equals to CLAP_INVALID_ID, From e4310b7181699d125b146c8693638283e42f6b8a Mon Sep 17 00:00:00 2001 From: joshnatis Date: Fri, 24 Jun 2022 12:36:23 -0400 Subject: [PATCH 37/51] Fix typos in transport-control.h --- include/clap/ext/draft/transport-control.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/clap/ext/draft/transport-control.h b/include/clap/ext/draft/transport-control.h index 70b4df1b..e947337e 100644 --- a/include/clap/ext/draft/transport-control.h +++ b/include/clap/ext/draft/transport-control.h @@ -2,8 +2,8 @@ #include "../../plugin.h" -// This extension let the plugin submit transport requests to the host. -// The host has no obligation to execute those request, so the interface maybe +// This extension lets the plugin submit transport requests to the host. +// The host has no obligation to execute these requests, so the interface may be // partially working. static CLAP_CONSTEXPR const char CLAP_EXT_TRANSPORT_CONTROL[] = "clap.transport-control.draft/0"; @@ -29,7 +29,7 @@ typedef struct clap_host_transport_control { // [main-thread] void (*request_pause)(const clap_host_t *host); - // Equivalent to what "space bar" does with most DAW + // Equivalent to what "space bar" does with most DAWs // [main-thread] void (*request_toggle_play)(const clap_host_t *host); From 1865ff89b3cb0efec09a89076eb0b82fcf0b5ad5 Mon Sep 17 00:00:00 2001 From: joshnatis Date: Fri, 24 Jun 2022 12:38:01 -0400 Subject: [PATCH 38/51] Fix typos in surround.h --- include/clap/ext/draft/surround.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/clap/ext/draft/surround.h b/include/clap/ext/draft/surround.h index bd07c605..0663f406 100644 --- a/include/clap/ext/draft/surround.h +++ b/include/clap/ext/draft/surround.h @@ -4,7 +4,7 @@ // This extension can be used to specify the channel mapping used by the plugin. // -// To have a consistent surround features across all the plugin instances, +// To have consistent surround features across all the plugin instances, // here is the proposed workflow: // 1. the plugin queries the host preferred channel mapping and // adjusts its configuration to match it. @@ -14,7 +14,7 @@ // 1. deactivate the plugin // 2. host calls clap_plugin_surround->changed() // 3. plugin calls clap_host_surround->get_preferred_channel_map() -// 4. plugin eventualy calls clap_host_surround->changed() +// 4. plugin eventually calls clap_host_surround->changed() // 5. host calls clap_plugin_surround->get_channel_map() if changed // 6. host activates the plugin and can start processing audio // @@ -69,7 +69,7 @@ typedef struct clap_plugin_surround { } clap_plugin_surround_t; typedef struct clap_host_surround { - // Informs the host that the channel map have changed. + // Informs the host that the channel map has changed. // The channel map can only change when the plugin is de-activated. // [main-thread] void (*changed)(const clap_host_t *host); From 4067fc4c84016f0ca15ba6c52ea61112b63018cb Mon Sep 17 00:00:00 2001 From: joshnatis Date: Fri, 24 Jun 2022 12:38:52 -0400 Subject: [PATCH 39/51] Fix typos in quick-controls.h --- include/clap/ext/draft/quick-controls.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/clap/ext/draft/quick-controls.h b/include/clap/ext/draft/quick-controls.h index a555c96a..4db09d94 100644 --- a/include/clap/ext/draft/quick-controls.h +++ b/include/clap/ext/draft/quick-controls.h @@ -5,7 +5,7 @@ // This extensions provides a set a pages, where each page contains up to 8 controls. // Those controls are param_id, and they are meant to be mapped onto a physical controller. -// We chose 8 because this what most controllers offers, and it is more or less a standard. +// We chose 8 because this what most controllers offer, and it is more or less a standard. static CLAP_CONSTEXPR const char CLAP_EXT_QUICK_CONTROLS[] = "clap.quick-controls.draft/0"; From 6895a622b9f3998deebc2d03722616c666997aae Mon Sep 17 00:00:00 2001 From: joshnatis Date: Fri, 24 Jun 2022 12:40:56 -0400 Subject: [PATCH 40/51] Fix typos in file-reference.h --- include/clap/ext/draft/file-reference.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/clap/ext/draft/file-reference.h b/include/clap/ext/draft/file-reference.h index 5d7f083e..f34aef87 100644 --- a/include/clap/ext/draft/file-reference.h +++ b/include/clap/ext/draft/file-reference.h @@ -20,13 +20,13 @@ extern "C" { /// - filename /// - hash /// - file size -/// - be aware that some external file references are marked as dirty and needs to be saved. +/// - be aware that some external file references are marked as dirty and need to be saved. /// /// Regarding the hashing algorithm, as of 2022 BLAKE3 seems to be the best choice in regards to /// performances and robustness while also providing a very small pure C library with permissive /// licensing. For more info see https://github.com/BLAKE3-team/BLAKE3 /// -/// This extension only expose one hashing algorithm on purpose. +/// This extension only exposes one hashing algorithm on purpose. // This describes a file currently used by the plugin typedef struct clap_file_reference { @@ -35,7 +35,7 @@ typedef struct clap_file_reference { size_t path_capacity; // [in] the number of bytes reserved in path size_t path_size; // [out] the actual length of the path, can be bigger than path_capacity - char *path; // [in,out] path to the file on the disk, must be null terminated, and maybe + char *path; // [in,out] path to the file on the disk, must be null terminated, and may be // truncated if the capacity is less than the size } clap_file_reference_t; From add8847cffcf973a803f3d297e231d9dbd2750df Mon Sep 17 00:00:00 2001 From: joshnatis Date: Fri, 24 Jun 2022 12:43:09 -0400 Subject: [PATCH 41/51] Fix typos in ambisonic.h --- include/clap/ext/draft/ambisonic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/clap/ext/draft/ambisonic.h b/include/clap/ext/draft/ambisonic.h index 0cc27297..b545232c 100644 --- a/include/clap/ext/draft/ambisonic.h +++ b/include/clap/ext/draft/ambisonic.h @@ -44,7 +44,7 @@ typedef struct clap_plugin_ambisonic { } clap_plugin_ambisonic_t; typedef struct clap_host_ambisonic { - // Informs the host that the info have changed. + // Informs the host that the info has changed. // The info can only change when the plugin is de-activated. // [main-thread] void (*changed)(const clap_host_t *host); From c1a60c06241f788de1d6648802ed8f68a0e073c1 Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Tue, 28 Jun 2022 13:38:16 +0200 Subject: [PATCH 42/51] Doc: clarify note ports id overlapping Fixes #125 --- include/clap/ext/note-ports.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/clap/ext/note-ports.h b/include/clap/ext/note-ports.h index eeb9d0b0..10bb2d87 100644 --- a/include/clap/ext/note-ports.h +++ b/include/clap/ext/note-ports.h @@ -30,7 +30,9 @@ enum clap_note_dialect { }; typedef struct clap_note_port_info { - clap_id id; // stable identifier + // id identifies a port and must be stable. + // id may overlap between input and output ports. + clap_id id; uint32_t supported_dialects; // bitfield, see clap_note_dialect uint32_t preferred_dialect; // one value of clap_note_dialect char name[CLAP_NAME_SIZE]; // displayable name, i18n? From da9a0ae33f1f9f630ed29cb4a340711c0758ec29 Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Tue, 28 Jun 2022 13:38:51 +0200 Subject: [PATCH 43/51] Same for audio-ports --- include/clap/ext/audio-ports.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/clap/ext/audio-ports.h b/include/clap/ext/audio-ports.h index 64b3b248..5d0af462 100644 --- a/include/clap/ext/audio-ports.h +++ b/include/clap/ext/audio-ports.h @@ -40,7 +40,9 @@ enum { }; typedef struct clap_audio_port_info { - clap_id id; // stable identifier + // id identifies a port and must be stable. + // id may overlap between input and output ports. + clap_id id; char name[CLAP_NAME_SIZE]; // displayable name uint32_t flags; From 5723b7c0d7b7ffc1a8e53b712e53f59ec0855552 Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Tue, 28 Jun 2022 14:05:21 +0200 Subject: [PATCH 44/51] Clarify param flush Fixes #124 --- include/clap/ext/params.h | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/include/clap/ext/params.h b/include/clap/ext/params.h index d1c84d26..27396a3d 100644 --- a/include/clap/ext/params.h +++ b/include/clap/ext/params.h @@ -16,8 +16,8 @@ /// /// There are two options to communicate parameter value changes, and they are not concurrent. /// - send automation points during clap_plugin.process() -/// - send automation points during clap_plugin_params.flush(), this one is used when the plugin is -/// not processing +/// - send automation points during clap_plugin_params.flush(), for parameter changes +/// without processing audio /// /// When the plugin changes a parameter value, it must inform the host. /// It will send @ref CLAP_EVENT_PARAM_VALUE event during process() or flush(). @@ -51,11 +51,11 @@ /// - the host will send an automation event to the plugin via a process() or flush() /// /// III. Turning a knob on the Plugin interface -/// - if the plugin is not processing, call clap_host_params->request_flush() or -/// clap_host->request_process(). -/// - send an automation event and don't forget to set begin_adjust, end_adjust and should_record -/// flags /// - the plugin is responsible for sending the parameter value to its audio processor +/// - call clap_host_params->request_flush() or clap_host->request_process(). +/// - when the host calls either clap_plugin->process() or clap_plugin_params->flush(), +/// send an automation event and don't forget to set begin_adjust, +/// end_adjust and should_record flags /// /// IV. Turning a knob via automation /// - host sends an automation point during clap_plugin->process() or clap_plugin_params->flush(). @@ -210,10 +210,8 @@ typedef struct clap_plugin_params { // Flushes a set of parameter changes. // This method must not be called concurrently to clap_plugin->process(). - // This method must not be used if the plugin is processing. // - // [active && !processing : audio-thread] - // [!active : main-thread] + // [active ? audio-thread : main-thread] void (*flush)(const clap_plugin_t *plugin, const clap_input_events_t *in, const clap_output_events_t *out); @@ -282,13 +280,11 @@ typedef struct clap_host_params { // Request a parameter flush. // - // If the plugin is processing, this will result in no action. The process call - // will run normally. If plugin isn't processing, the host will make a subsequent - // call to clap_plugin_params->flush(). As a result, this function is always - // safe to call from a non-audio thread (typically the UI thread on a gesture) - // whether processing is active or not. + // The host will then schedule a call to either: + // - clap_plugin.process() + // - clap_plugin_params->flush() // - // This must not be called on the [audio-thread]. + // This function is always safe to use and must not be called on the [audio-thread]. // [thread-safe,!audio-thread] void (*request_flush)(const clap_host_t *host); } clap_host_params_t; From 3a153864142fee2701b2a11026b1a41a488a1206 Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Tue, 28 Jun 2022 14:19:37 +0200 Subject: [PATCH 45/51] Clarify initialization failure Fixes #116 --- include/clap/entry.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/clap/entry.h b/include/clap/entry.h index 5bf59e6c..8f3cc1da 100644 --- a/include/clap/entry.h +++ b/include/clap/entry.h @@ -45,6 +45,9 @@ typedef struct clap_plugin_entry { // // If the initialization depends upon expensive computation, maybe try to do them ahead of time // and cache the result. + // + // If init() returns false, then the host must not call deinit() nor any other clap + // related symbols from the DSO. bool (*init)(const char *plugin_path); // No more calls into the DSO must be made after calling deinit(). From 6a686c0f3473e4e95db484ade8ea00fc3e4d67ce Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Tue, 28 Jun 2022 15:20:46 +0200 Subject: [PATCH 46/51] Update changelog --- ChangeLog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog.md b/ChangeLog.md index d5fbfb1a..c142b674 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -6,6 +6,7 @@ * [entry.h](include/clap/entry.h): improve documentation regarding CLAP search path. * [gui.h](inclued/clap/gui.h): fix typo `clap_gui_resize_hints.preserve_aspect_ratio` * [plugin-template](src/plugin-template.c): missing impl of plugin destroy. +* various documentation improvements # Changes in 1.0.2 From 7544d9a4454ad6e4e0b903003bd2ac5e05bfe797 Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Tue, 28 Jun 2022 15:32:05 +0200 Subject: [PATCH 47/51] Add a link to clapdb in the readme --- README.md | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 9189f065..455cb7da 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,6 @@ - [Support extensions](#support-extensions) - [Extra extensions](#extra-extensions) - [Resources](#resources) - - [Plugins](#plugins) - - [Hosts](#hosts) - [Examples](#examples) - [Community related projects](#community-related-projects) - [Programming Language Bindings](#programming-language-bindings) @@ -106,17 +104,7 @@ and use to get a basic plugin experience: # Resources -## Plugins - -- [u-he](https://u-he.com/fwd/clap/), synthesizers and effects -- [Surge](https://surge-synthesizer.github.io/), open source synthesizer and effects - - CLAP is enabled in [nightly builds](https://github.com/surge-synthesizer/releases-xt/releases/tag/Nightly) - -## Hosts - -- [Bitwig](https://bitwig.com), you need at least _Bitwig Studio 4.3 Beta 5_ -- [MultitrackStudio](https://www.multitrackstudio.com/), you need at least _MultitrackStudio 10.4.1_ -- [Qtractor](https://www.qtractor.org) +- [clapdb](https://clapdb.tech), a list of plugins and DAWs which supports CLAP ## Examples @@ -137,4 +125,5 @@ and use to get a basic plugin experience: - [CLAP-for-Delphi](https://github.com/Bremmers/CLAP-for-Delphi), Delphi binding ## Artwork + - [CLAP Logo Pack.zip](https://github.com/free-audio/clap/files/8805281/CLAP.Logo.Pack.zip) From ab70e9889832bfa2769cae4086530153b2f39096 Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Tue, 28 Jun 2022 16:37:15 +0200 Subject: [PATCH 48/51] Backout earlier change --- include/clap/entry.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/include/clap/entry.h b/include/clap/entry.h index 78d4ff3d..8f3cc1da 100644 --- a/include/clap/entry.h +++ b/include/clap/entry.h @@ -31,11 +31,6 @@ extern "C" { // Each directory should be recursively searched for files and/or bundles as appropriate in your OS // ending with the extension `.clap`. // -// On Windows and Linux, the '.clap' file is a renamed shared library object, so traversing the path -// should stop at the first non-directory (regular file, symlink, etc...) whose name ends in '.clap'. -// On macOS the '.clap' file is a bundle, so traversing the path should stop at directories whose -// name ends in '.clap'. -// // Every method must be thread-safe. typedef struct clap_plugin_entry { clap_version_t clap_version; // initialized to CLAP_VERSION From baeb35b15be429a0c49ce054dc46ff4634b874a7 Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Tue, 28 Jun 2022 16:39:25 +0200 Subject: [PATCH 49/51] Update changelog --- ChangeLog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index c142b674..b6e2cd6a 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -3,7 +3,7 @@ * [plugin.h](include/clap/plugin.h): fix an inconsistency in `clap_plugin->destroy()` documentation: it is now **required** to deactivate the plugin before destroying it. * [params.h](include/clap/ext/params.h): improve documentation for `clap_host_params->request_flush()`. -* [entry.h](include/clap/entry.h): improve documentation regarding CLAP search path. +* [entry.h](include/clap/entry.h): improve documentation regarding `init()`, `deinit()` and CLAP search path. * [gui.h](inclued/clap/gui.h): fix typo `clap_gui_resize_hints.preserve_aspect_ratio` * [plugin-template](src/plugin-template.c): missing impl of plugin destroy. * various documentation improvements From 1382ddd767531b6405c9e317789849d4adaecf77 Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Thu, 30 Jun 2022 15:03:26 +0200 Subject: [PATCH 50/51] Mark version 1.0.3 --- include/clap/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/clap/version.h b/include/clap/version.h index da2a2a6c..ab66ea3a 100644 --- a/include/clap/version.h +++ b/include/clap/version.h @@ -22,7 +22,7 @@ typedef struct clap_version { #define CLAP_VERSION_MAJOR ((uint32_t)1) #define CLAP_VERSION_MINOR ((uint32_t)0) -#define CLAP_VERSION_REVISION ((uint32_t)2) +#define CLAP_VERSION_REVISION ((uint32_t)3) #define CLAP_VERSION_INIT {CLAP_VERSION_MAJOR, CLAP_VERSION_MINOR, CLAP_VERSION_REVISION} static const CLAP_CONSTEXPR clap_version_t CLAP_VERSION = CLAP_VERSION_INIT; From 088f5480fc5f32fdc673b5d9609015df96946ecf Mon Sep 17 00:00:00 2001 From: Alexandre Bique Date: Thu, 30 Jun 2022 20:41:17 +0200 Subject: [PATCH 51/51] Add clap-validator to the readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 455cb7da..39591719 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,7 @@ and use to get a basic plugin experience: # Resources +- [clap-validator](https://github.com/robbert-vdh/clap-validator), a validator and automatic test suite for CLAP plugins. - [clapdb](https://clapdb.tech), a list of plugins and DAWs which supports CLAP ## Examples