commit 973c5d437f47b4d037e310c256bae4da644be161 parent 8749b6a22488c6dcbb2316b960d233330053b5a5 Author: Alexandre BIQUE <bique.alexandre@gmail.com> Date: Fri, 25 Feb 2022 18:45:37 +0100 Merge branch 'next' into gui-v2 Diffstat:
29 files changed, 151 insertions(+), 161 deletions(-)
diff --git a/README.md b/README.md @@ -20,9 +20,11 @@ - [GUI extensions](#gui-extensions) - [Extra extensions](#extra-extensions) - [Resources](#resources) - - [Programming Language Bingings](#programming-language-bingings) + - [Plugins](#plugins) + - [Hosts](#hosts) - [Examples](#examples) - [Community related projects](#community-related-projects) + - [Programming Language Bingings](#programming-language-bingings) # Learn about CLAP @@ -107,18 +109,32 @@ and use to get a basic plugin experience: # Resources -## Programming Language Bingings +## Plugins -- [clap-sys](https://github.com/glowcoil/clap-sys), rust binding -- [CLAP-for-Delphi](https://github.com/Bremmers/CLAP-for-Delphi), Delphi binding +- [u-he](https://u-he.com/fwd/clap/), synthesizers and effects +- [Surge](https://surge-synthesizer.github.io/), open source synthesizer and effect + - CLAP is enabled in [nightly builds](https://github.com/surge-synthesizer/releases-xt/releases/tag/Nightly) + +## Hosts + +- [Bitwig](https://bitwig.com), DAW + - To enable CLAP, you need at least _Bitwig Studio 4.2 Beta 1_ and you'll have to add `clap : true` to: + - Linux: `$HOME/.BitwigStudio/config.json` + - macOS: `$HOME/Library/Application Support/Bitwig/Bitwig Studio/config.json` + - Windows: `%LOCALAPPDATA%\Bitwig Studio\config.json` ## Examples - [clap-host](https://github.com/free-audio/clap-host), very simple host - [clap-plugins](https://github.com/free-audio/clap-plugins), very simple plugins +- [schwaaa's plugin](https://github.com/schwaaa/clap-plugin), basic example for prototyping CLAP audio plugins using Dear ImGui as the user interface ## Community related projects - [clap-juce-extension](https://github.com/free-audio/clap-juce-extension), juce add-on - [MIP2](https://github.com/skei/MIP2), host and plugins -- [schwaaa's plugin](https://github.com/schwaaa/clap-plugin), basic example for prototyping CLAP audio plugins using Dear ImGui as the user interface -\ No newline at end of file + +## Programming Language Bingings + +- [clap-sys](https://github.com/glowcoil/clap-sys), rust binding +- [CLAP-for-Delphi](https://github.com/Bremmers/CLAP-for-Delphi), Delphi binding diff --git a/include/clap/audio-buffer.h b/include/clap/audio-buffer.h @@ -29,13 +29,13 @@ typedef struct clap_audio_buffer { // Either data32 or data64 pointer will be set. float **data32; double **data64; - alignas(4) uint32_t channel_count; - alignas(4) uint32_t latency; // latency from/to the audio interface - alignas(8) uint64_t constant_mask; // mask & (1 << N) to test if channel N is constant + uint32_t channel_count; + uint32_t latency; // latency from/to the audio interface + uint64_t constant_mask; // mask & (1 << N) to test if channel N is constant } clap_audio_buffer_t; #pragma pack(pop) #ifdef __cplusplus } -#endif -\ No newline at end of file +#endif diff --git a/include/clap/color.h b/include/clap/color.h @@ -19,4 +19,4 @@ typedef struct clap_color { #ifdef __cplusplus } -#endif -\ No newline at end of file +#endif diff --git a/include/clap/converters/vst3-converter.h b/include/clap/converters/vst3-converter.h @@ -15,7 +15,7 @@ typedef struct clap_vst3_converter { // The VST FUID can be constructed by: // Steinberg::FUID::fromTUID(conv->vst3_plugin_tuid); const int8_t vst3_plugin_tuid[16]; - const char *clap_plugin_id; + const char *clap_plugin_id; // [main-thread] bool (*convert_state)(const struct clap_vst3_converter *converter, diff --git a/include/clap/entry.h b/include/clap/entry.h @@ -62,4 +62,4 @@ CLAP_EXPORT extern const clap_plugin_entry_t clap_entry; #ifdef __cplusplus } -#endif -\ No newline at end of file +#endif diff --git a/include/clap/events.h b/include/clap/events.h @@ -15,11 +15,11 @@ extern "C" { // event header // must be the first attribute of the event typedef struct clap_event_header { - alignas(4) uint32_t size; // event size including this header, eg: sizeof (clap_event_note) - alignas(4) uint32_t time; // time at which the event happens - alignas(2) uint16_t space_id; // event space, see clap_host_event_registry - alignas(2) uint16_t type; // event type - alignas(4) uint32_t flags; // see clap_event_flags + uint32_t size; // event size including this header, eg: sizeof (clap_event_note) + uint32_t time; // time at which the event happens + uint16_t space_id; // event space, see clap_host_event_registry + uint16_t type; // event type + uint32_t flags; // see clap_event_flags } clap_event_header_t; // The clap core event space @@ -96,12 +96,12 @@ typedef int32_t clap_event_type; * - key and channel are used to match active notes, a value of -1 matches all. */ typedef struct clap_event_note { - alignas(4) clap_event_header_t header; + clap_event_header_t header; - alignas(2) int16_t port_index; - alignas(2) int16_t key; // 0..127 - alignas(2) int16_t channel; // 0..15 - alignas(8) double velocity; // 0..1 + int16_t port_index; + int16_t key; // 0..127 + int16_t channel; // 0..15 + double velocity; // 0..1 } clap_event_note_t; enum { @@ -126,46 +126,46 @@ enum { typedef int32_t clap_note_expression; typedef struct clap_event_note_expression { - alignas(4) clap_event_header_t header; + clap_event_header_t header; - alignas(4) clap_note_expression expression_id; + clap_note_expression expression_id; // target a specific port, key and channel, -1 for global - alignas(2) int16_t port_index; - alignas(2) int16_t key; - alignas(2) int16_t channel; + int16_t port_index; + int16_t key; + int16_t channel; - alignas(8) double value; // see expression for the range + double value; // see expression for the range } clap_event_note_expression_t; typedef struct clap_event_param_value { - alignas(4) clap_event_header_t header; + clap_event_header_t header; // target parameter - alignas(4) clap_id param_id; // @ref clap_param_info.id - void *cookie; // @ref clap_param_info.cookie + clap_id param_id; // @ref clap_param_info.id + void *cookie; // @ref clap_param_info.cookie // target a specific port, key and channel, -1 for global - alignas(2) int16_t port_index; - alignas(2) int16_t key; - alignas(2) int16_t channel; + int16_t port_index; + int16_t key; + int16_t channel; - alignas(8) double value; + double value; } clap_event_param_value_t; typedef struct clap_event_param_mod { - alignas(4) clap_event_header_t header; + clap_event_header_t header; // target parameter - alignas(4) clap_id param_id; // @ref clap_param_info.id - void *cookie; // @ref clap_param_info.cookie + clap_id param_id; // @ref clap_param_info.id + void *cookie; // @ref clap_param_info.cookie // target a specific port, key and channel, -1 for global - alignas(2) int16_t port_index; - alignas(2) int16_t key; - alignas(2) int16_t channel; + int16_t port_index; + int16_t key; + int16_t channel; - alignas(8) double amount; // modulation amount + double amount; // modulation amount } clap_event_param_mod_t; enum clap_transport_flags { @@ -180,51 +180,51 @@ enum clap_transport_flags { }; typedef struct clap_event_transport { - alignas(4) clap_event_header_t header; + clap_event_header_t header; - alignas(4) uint32_t flags; // see clap_transport_flags + uint32_t flags; // see clap_transport_flags - alignas(8) clap_beattime song_pos_beats; // position in beats - alignas(8) clap_sectime song_pos_seconds; // position in seconds + clap_beattime song_pos_beats; // position in beats + clap_sectime song_pos_seconds; // position in seconds - alignas(8) double tempo; // in bpm - alignas(8) double tempo_inc; // tempo increment for each samples and until the next - // time info event + double tempo; // in bpm + double tempo_inc; // tempo increment for each samples and until the next + // time info event - alignas(8) clap_beattime loop_start_beats; - alignas(8) clap_beattime loop_end_beats; - alignas(8) clap_sectime loop_start_seconds; - alignas(8) clap_sectime loop_end_seconds; + clap_beattime loop_start_beats; + clap_beattime loop_end_beats; + clap_sectime loop_start_seconds; + clap_sectime loop_end_seconds; - alignas(8) clap_beattime bar_start; // start pos of the current bar - alignas(4) int32_t bar_number; // bar at song pos 0 has the number 0 + clap_beattime bar_start; // start pos of the current bar + int32_t bar_number; // bar at song pos 0 has the number 0 - alignas(2) int16_t tsig_num; // time signature numerator - alignas(2) int16_t tsig_denom; // time signature denominator + int16_t tsig_num; // time signature numerator + int16_t tsig_denom; // time signature denominator } clap_event_transport_t; typedef struct clap_event_midi { - alignas(4) clap_event_header_t header; + clap_event_header_t header; - alignas(2) uint16_t port_index; - alignas(1) uint8_t data[3]; + uint16_t port_index; + uint8_t data[3]; } clap_event_midi_t; typedef struct clap_event_midi_sysex { - alignas(4) clap_event_header_t header; + clap_event_header_t header; - alignas(2) uint16_t port_index; + uint16_t port_index; const uint8_t *buffer; // midi buffer - alignas(4) uint32_t size; + uint32_t size; } clap_event_midi_sysex_t; // While it is possible to use a series of midi2 event to send a sysex, // prefer clap_event_midi_sysex if possible for efficiency. typedef struct clap_event_midi2 { - alignas(4) clap_event_header_t header; + clap_event_header_t header; - alignas(2) uint16_t port_index; - alignas(4) uint32_t data[4]; + uint16_t port_index; + uint32_t data[4]; } clap_event_midi2_t; // Input event list, events must be sorted by time. @@ -249,4 +249,4 @@ typedef struct clap_output_events { #ifdef __cplusplus } -#endif -\ No newline at end of file +#endif diff --git a/include/clap/ext/audio-ports-config.h b/include/clap/ext/audio-ports-config.h @@ -31,15 +31,15 @@ extern "C" { // Minimalistic description of ports configuration typedef struct clap_audio_ports_config { - alignas(4) clap_id id; - alignas(1) char name[CLAP_NAME_SIZE]; + clap_id id; + char name[CLAP_NAME_SIZE]; // main input info - alignas(4) uint32_t input_channel_count; + uint32_t input_channel_count; const char *input_port_type; // main output info - alignas(4) uint32_t output_channel_count; + uint32_t output_channel_count; const char * output_port_type; } clap_audio_ports_config_t; diff --git a/include/clap/ext/audio-ports.h b/include/clap/ext/audio-ports.h @@ -32,11 +32,11 @@ enum { }; typedef struct clap_audio_port_info { - alignas(4) clap_id id; // stable identifier - alignas(1) char name[CLAP_NAME_SIZE]; // displayable name + clap_id id; // stable identifier + char name[CLAP_NAME_SIZE]; // displayable name - alignas(4) uint32_t flags; - alignas(4) uint32_t channel_count; + uint32_t flags; + uint32_t channel_count; // If null or empty then it is unspecified (arbitrary audio). // This filed can be compared against: @@ -52,7 +52,7 @@ typedef struct clap_audio_port_info { // in-place processing: allow the host to use the same buffer for input and output // if supported set the pair port id. // if not supported set to CLAP_INVALID_ID - alignas(4) clap_id in_place_pair; + clap_id in_place_pair; } clap_audio_port_info_t; // The audio ports scan has to be done while the plugin is deactivated. diff --git a/include/clap/ext/draft/ambisonic.h b/include/clap/ext/draft/ambisonic.h @@ -31,8 +31,8 @@ enum { }; typedef struct clap_ambisonic_info { - alignas(4) uint32_t ordering; - alignas(4) uint32_t normalization; + uint32_t ordering; + uint32_t normalization; } clap_ambisonic_info_t; typedef struct clap_plugin_ambisonic { diff --git a/include/clap/ext/draft/check-for-update.h b/include/clap/ext/draft/check-for-update.h @@ -15,7 +15,7 @@ typedef struct clap_check_for_update_info { const char *release_date; // YYYY-MM-DD const char *url; - alignas(1) bool is_stable; + bool is_stable; } clap_check_for_update_info_t; typedef struct clap_plugin_check_for_update { diff --git a/include/clap/ext/draft/file-reference.h b/include/clap/ext/draft/file-reference.h @@ -26,9 +26,9 @@ extern "C" { /// and needs to be saved. typedef struct clap_file_reference { - alignas(4) clap_id resource_id; - alignas(1) char path[CLAP_PATH_SIZE]; - alignas(1) bool belongs_to_plugin_collection; + clap_id resource_id; + char path[CLAP_PATH_SIZE]; + bool belongs_to_plugin_collection; } clap_file_reference_t; typedef struct clap_plugin_file_reference { diff --git a/include/clap/ext/draft/midi-mappings.h b/include/clap/ext/draft/midi-mappings.h @@ -19,9 +19,9 @@ enum { typedef int32_t clap_midi_mapping_type; typedef struct clap_midi_mapping { - alignas(4) int32_t channel; - alignas(4) int32_t number; - alignas(4) clap_id param_id; + int32_t channel; + int32_t number; + clap_id param_id; } clap_midi_mapping_t; typedef struct clap_plugin_midi_mappings { diff --git a/include/clap/ext/draft/quick-controls.h b/include/clap/ext/draft/quick-controls.h @@ -14,10 +14,10 @@ extern "C" { enum { CLAP_QUICK_CONTROLS_COUNT = 8 }; typedef struct clap_quick_controls_page { - alignas(4) clap_id id; - alignas(1) char name[CLAP_NAME_SIZE]; - alignas(1) char keywords[CLAP_KEYWORDS_SIZE]; - alignas(4) clap_id param_ids[CLAP_QUICK_CONTROLS_COUNT]; + clap_id id; + char name[CLAP_NAME_SIZE]; + char keywords[CLAP_KEYWORDS_SIZE]; + clap_id param_ids[CLAP_QUICK_CONTROLS_COUNT]; } clap_quick_controls_page_t; typedef struct clap_plugin_quick_controls { diff --git a/include/clap/ext/draft/track-info.h b/include/clap/ext/draft/track-info.h @@ -13,14 +13,14 @@ extern "C" { #pragma pack(push, CLAP_ALIGN) typedef struct clap_track_info { - alignas(4) clap_id id; - alignas(4) int32_t index; - alignas(1) char name[CLAP_NAME_SIZE]; - alignas(1) char path[CLAP_MODULE_SIZE]; // Like "/group1/group2/drum-machine/drum-pad-13" - alignas(4) int32_t channel_count; + clap_id id; + int32_t index; + char name[CLAP_NAME_SIZE]; + char path[CLAP_MODULE_SIZE]; // Like "/group1/group2/drum-machine/drum-pad-13" + int32_t channel_count; const char *audio_port_type; - alignas(4) clap_color_t color; - alignas(4) bool is_return_track; + clap_color_t color; + bool is_return_track; } clap_track_info_t; typedef struct clap_plugin_track_info { diff --git a/include/clap/ext/note-name.h b/include/clap/ext/note-name.h @@ -12,10 +12,10 @@ extern "C" { static CLAP_CONSTEXPR const char CLAP_EXT_NOTE_NAME[] = "clap.note-name"; typedef struct clap_note_name { - alignas(1) char name[CLAP_NAME_SIZE]; - alignas(2) int16_t port; // -1 for every ports - alignas(2) int16_t key; // -1 for every keys - alignas(2) int16_t channel; // -1 for every channels + char name[CLAP_NAME_SIZE]; + int16_t port; // -1 for every ports + int16_t key; // -1 for every keys + int16_t channel; // -1 for every channels } clap_note_name_t; typedef struct clap_plugin_note_name { diff --git a/include/clap/ext/note-ports.h b/include/clap/ext/note-ports.h @@ -35,10 +35,10 @@ enum clap_note_dialect { }; typedef struct clap_note_port_info { - alignas(4) clap_id id; // stable identifier - alignas(4) uint32_t supported_dialects; // bitfield, see clap_note_dialect - alignas(4) uint32_t preferred_dialect; // one value of clap_note_dialect - alignas(1) char name[CLAP_NAME_SIZE]; // displayable name, i18n? + clap_id id; // stable identifier + 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? } clap_note_port_info_t; // The note ports scan has to be done while the plugin is deactivated. diff --git a/include/clap/ext/params.h b/include/clap/ext/params.h @@ -138,9 +138,9 @@ typedef uint32_t clap_param_info_flags; /* This describes a parameter */ typedef struct clap_param_info { // stable parameter identifier, it must never change. - alignas(4) clap_id id; + clap_id id; - alignas(4) clap_param_info_flags flags; + clap_param_info_flags flags; // This value is optional and set by the plugin. // Its purpose is to provide a fast access to the plugin parameter: @@ -155,14 +155,14 @@ typedef struct clap_param_info { // destroyed. void *cookie; - alignas(1) char name[CLAP_NAME_SIZE]; // the display name - alignas(1) char module[CLAP_MODULE_SIZE]; // the module containing the param, eg: + char name[CLAP_NAME_SIZE]; // the display name + char module[CLAP_MODULE_SIZE]; // the module containing the param, eg: // "oscillators/wt1"; '/' will be used as a // separator to show a tree like structure. - alignas(8) double min_value; // minimum plain value - alignas(8) double max_value; // maximum plain value - alignas(8) double default_value; // default plain value + double min_value; // minimum plain value + double max_value; // maximum plain value + double default_value; // default plain value } clap_param_info_t; typedef struct clap_plugin_params { diff --git a/include/clap/fixedpoint.h b/include/clap/fixedpoint.h @@ -13,4 +13,4 @@ static const CLAP_CONSTEXPR int64_t CLAP_BEATTIME_FACTOR = 1LL << 31; static const CLAP_CONSTEXPR int64_t CLAP_SECTIME_FACTOR = 1LL << 31; typedef int64_t clap_beattime; -typedef int64_t clap_sectime; -\ No newline at end of file +typedef int64_t clap_sectime; diff --git a/include/clap/hash.h b/include/clap/hash.h @@ -21,4 +21,4 @@ typedef uint32_t clap_hash; #ifdef __cplusplus } -#endif -\ No newline at end of file +#endif diff --git a/include/clap/host.h b/include/clap/host.h @@ -43,4 +43,4 @@ typedef struct clap_host { #ifdef __cplusplus } -#endif -\ No newline at end of file +#endif diff --git a/include/clap/id.h b/include/clap/id.h @@ -5,4 +5,4 @@ typedef uint32_t clap_id; -static const CLAP_CONSTEXPR clap_id CLAP_INVALID_ID = UINT32_MAX; -\ No newline at end of file +static const CLAP_CONSTEXPR clap_id CLAP_INVALID_ID = UINT32_MAX; diff --git a/include/clap/plugin-invalidation.h b/include/clap/plugin-invalidation.h @@ -17,10 +17,11 @@ typedef struct clap_plugin_invalidation_source { const char *filename_glob; // should the directory be scanned recursively? - alignas(1) bool recursive_scan; + bool recursive_scan; } clap_plugin_invalidation_source_t; -static const CLAP_CONSTEXPR char CLAP_PLUGIN_INVALIDATION_FACTORY_ID[] = "clap.plugin-invalidation-factory"; +static const CLAP_CONSTEXPR char CLAP_PLUGIN_INVALIDATION_FACTORY_ID[] = + "clap.plugin-invalidation-factory"; // Used to figure out when a plugin needs to be scanned again. // Imagine a situation with a single entry point: my-plugin.clap which then scans itself diff --git a/include/clap/private/align.h b/include/clap/private/align.h @@ -1,13 +1,3 @@ #pragma once -#include "std.h" - -#if UINTPTR_MAX == UINT64_MAX -# define CLAP_PTR_ALIGN 8 -#elif UINTPTR_MAX == UINT32_MAX -# define CLAP_PTR_ALIGN 4 -#elif UINTPTR_MAX == UINT16_MAX -# define CLAP_PTR_ALIGN 2 -#endif - -#define CLAP_ALIGN CLAP_PTR_ALIGN -\ No newline at end of file +#define CLAP_ALIGN 16 diff --git a/include/clap/private/macros.h b/include/clap/private/macros.h @@ -19,4 +19,4 @@ # define CLAP_CONSTEXPR constexpr #else # define CLAP_CONSTEXPR -#endif -\ No newline at end of file +#endif diff --git a/include/clap/private/std.h b/include/clap/private/std.h @@ -8,4 +8,4 @@ # include <stdbool.h> # include <stdint.h> # include <stdalign.h> -#endif -\ No newline at end of file +#endif diff --git a/include/clap/process.h b/include/clap/process.h @@ -39,10 +39,10 @@ typedef struct clap_process { // // Set to -1 if not available, otherwise the value must be greater or equal to 0, // and must be increased by at least `frames_count` for the next call to process. - alignas(8) int64_t steady_time; + int64_t steady_time; // Number of frame to process - alignas(4) uint32_t frames_count; + uint32_t frames_count; // time info at sample 0 // If null, then this is a free running host, no transport events will be provided @@ -55,9 +55,9 @@ typedef struct clap_process { // If a plugin does not implement clap_plugin_audio_ports, // then it gets a default stereo input and output. const clap_audio_buffer_t *audio_inputs; - clap_audio_buffer_t *audio_outputs; - alignas(4) uint32_t audio_inputs_count; - alignas(4) uint32_t audio_outputs_count; + clap_audio_buffer_t *audio_outputs; + uint32_t audio_inputs_count; + uint32_t audio_outputs_count; // Input and output events. // @@ -66,7 +66,7 @@ typedef struct clap_process { // // If a plugin does not implement clap_plugin_note_ports, // then it gets a default note input and output. - const clap_input_events_t *in_events; + const clap_input_events_t *in_events; const clap_output_events_t *out_events; } clap_process_t; @@ -74,4 +74,4 @@ typedef struct clap_process { #ifdef __cplusplus } -#endif -\ No newline at end of file +#endif diff --git a/include/clap/stream.h b/include/clap/stream.h @@ -29,4 +29,4 @@ typedef struct clap_ostream { #ifdef __cplusplus } -#endif -\ No newline at end of file +#endif diff --git a/include/clap/string-sizes.h b/include/clap/string-sizes.h @@ -1,7 +1,5 @@ #pragma once -#include "private/std.h" - #ifdef __cplusplus extern "C" { #endif diff --git a/include/clap/version.h b/include/clap/version.h @@ -2,6 +2,7 @@ #include "private/macros.h" #include "private/align.h" +#include "private/std.h" #ifdef __cplusplus extern "C" { @@ -13,9 +14,9 @@ typedef struct clap_version { // This is the major ABI and API design // Version 0.X.Y correspond to the development stage, API and ABI are not stable // Version 1.X.Y correspont to the release stage, API and ABI are stable - alignas(4) uint32_t major; - alignas(4) uint32_t minor; - alignas(4) uint32_t revision; + uint32_t major; + uint32_t minor; + uint32_t revision; } clap_version_t; #pragma pack(pop) @@ -29,11 +30,10 @@ static CLAP_CONSTEXPR const uint32_t CLAP_VERSION_MINOR = 18; static CLAP_CONSTEXPR const uint32_t CLAP_VERSION_REVISION = 0; static CLAP_CONSTEXPR const clap_version_t CLAP_VERSION = { - CLAP_VERSION_MAJOR, CLAP_VERSION_MINOR, CLAP_VERSION_REVISION -}; + CLAP_VERSION_MAJOR, CLAP_VERSION_MINOR, CLAP_VERSION_REVISION}; // For version 0, we require the same minor version because // we may still break the ABI at this point static CLAP_CONSTEXPR inline bool clap_version_is_compatible(const clap_version_t v) { return v.major == CLAP_VERSION_MAJOR && v.minor == CLAP_VERSION_MINOR; -} -\ No newline at end of file +}