DISTRHO Plugin Framework
Macros
Plugin Macros

Macros

#define DISTRHO_PLUGIN_NAME   "Plugin Name"
 
#define DISTRHO_PLUGIN_NUM_INPUTS   2
 
#define DISTRHO_PLUGIN_NUM_OUTPUTS   2
 
#define DISTRHO_PLUGIN_URI   "urn:distrho:name"
 
#define DISTRHO_PLUGIN_HAS_UI   1
 
#define DISTRHO_PLUGIN_IS_RT_SAFE   1
 
#define DISTRHO_PLUGIN_IS_SYNTH   1
 
#define DISTRHO_PLUGIN_MINIMUM_BUFFER_SIZE   2048
 
#define DISTRHO_PLUGIN_USES_MODGUI   0
 
#define DISTRHO_PLUGIN_WANT_DIRECT_ACCESS   0
 
#define DISTRHO_PLUGIN_WANT_LATENCY   1
 
#define DISTRHO_PLUGIN_WANT_MIDI_INPUT   1
 
#define DISTRHO_PLUGIN_WANT_MIDI_OUTPUT   1
 
#define DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST   1
 
#define DISTRHO_PLUGIN_WANT_PROGRAMS   1
 
#define DISTRHO_PLUGIN_WANT_STATE   1
 
#define DISTRHO_PLUGIN_WANT_FULL_STATE   1
 
#define DISTRHO_PLUGIN_WANT_TIMEPOS   1
 
#define DISTRHO_UI_USE_CUSTOM   1
 
#define DISTRHO_UI_CUSTOM_INCLUDE_PATH
 
#define DISTRHO_UI_CUSTOM_WIDGET_TYPE
 
#define DISTRHO_UI_DEFAULT_WIDTH   300
 
#define DISTRHO_UI_DEFAULT_HEIGHT   300
 
#define DISTRHO_UI_USE_NANOVG   1
 
#define DISTRHO_UI_USER_RESIZABLE   1
 
#define DISTRHO_UI_URI   DISTRHO_PLUGIN_URI "#UI"
 
#define DISTRHO_PLUGIN_AU_TYPE   aufx
 
#define DISTRHO_PLUGIN_BRAND_ID   Dstr
 
#define DISTRHO_PLUGIN_UNIQUE_ID   test
 
#define DISTRHO_PLUGIN_LV2_CATEGORY   "lv2:Plugin"
 
#define DISTRHO_PLUGIN_VST3_CATEGORIES   "Fx|Stereo"
 
#define DISTRHO_PLUGIN_CLAP_FEATURES   "audio-effect", "stereo"
 
#define DISTRHO_PLUGIN_CLAP_ID   "studio.kx.distrho.effect"
 

Detailed Description

C Macros that describe your plugin. (defined in the "DistrhoPluginInfo.h" file)

With these macros you can tell the host what features your plugin requires.
Depending on which macros you enable, new functions will be available to call and/or override.

All values are either integer or strings.
For boolean-like values 1 means 'on' and 0 means 'off'.

The values defined in this group are for documentation purposes only.
All macros are disabled by default.

Only 4 macros are required, they are:

Additionally, DISTRHO_PLUGIN_CLAP_ID is required if building CLAP plugins.

Macro Definition Documentation

◆ DISTRHO_PLUGIN_NAME

#define DISTRHO_PLUGIN_NAME   "Plugin Name"

The plugin name.
This is used to identify your plugin before a Plugin instance can be created.

Note
This macro is required.

◆ DISTRHO_PLUGIN_NUM_INPUTS

#define DISTRHO_PLUGIN_NUM_INPUTS   2

Number of audio inputs the plugin has.

Note
This macro is required.

◆ DISTRHO_PLUGIN_NUM_OUTPUTS

#define DISTRHO_PLUGIN_NUM_OUTPUTS   2

Number of audio outputs the plugin has.

Note
This macro is required.

◆ DISTRHO_PLUGIN_URI

#define DISTRHO_PLUGIN_URI   "urn:distrho:name"

The plugin URI when exporting in LV2 format.

Note
This macro is required.

◆ DISTRHO_PLUGIN_HAS_UI

#define DISTRHO_PLUGIN_HAS_UI   1

Whether the plugin has a custom UI.

See also
DISTRHO_UI_USE_NANOVG
UI

◆ DISTRHO_PLUGIN_IS_RT_SAFE

#define DISTRHO_PLUGIN_IS_RT_SAFE   1

Whether the plugin processing is realtime-safe.
TODO - list rtsafe requirements

◆ DISTRHO_PLUGIN_IS_SYNTH

#define DISTRHO_PLUGIN_IS_SYNTH   1

Whether the plugin is a synth.
DISTRHO_PLUGIN_WANT_MIDI_INPUT is automatically enabled when this is too.

See also
DISTRHO_PLUGIN_WANT_MIDI_INPUT

◆ DISTRHO_PLUGIN_MINIMUM_BUFFER_SIZE

#define DISTRHO_PLUGIN_MINIMUM_BUFFER_SIZE   2048

Request the minimum buffer size for the input and output event ports.
Currently only used in LV2, with a default value of 2048 if unset.

◆ DISTRHO_PLUGIN_USES_MODGUI

#define DISTRHO_PLUGIN_USES_MODGUI   0

Whether the plugin has an LV2 modgui.

This will simply add a "rdfs:seeAlso <modgui.ttl>" on the LV2 manifest.
It is up to you to create this file.

◆ DISTRHO_PLUGIN_WANT_DIRECT_ACCESS

#define DISTRHO_PLUGIN_WANT_DIRECT_ACCESS   0

Enable direct access between the UI and plugin code.

See also
UI::getPluginInstancePointer()
Note
DO NOT USE THIS UNLESS STRICTLY NECESSARY!! Try to avoid it at all costs!

◆ DISTRHO_PLUGIN_WANT_LATENCY

#define DISTRHO_PLUGIN_WANT_LATENCY   1

Whether the plugin introduces latency during audio or midi processing.

See also
Plugin::setLatency(uint32_t)

◆ DISTRHO_PLUGIN_WANT_MIDI_INPUT

#define DISTRHO_PLUGIN_WANT_MIDI_INPUT   1

Whether the plugin wants MIDI input.
This is automatically enabled if DISTRHO_PLUGIN_IS_SYNTH is true.

◆ DISTRHO_PLUGIN_WANT_MIDI_OUTPUT

#define DISTRHO_PLUGIN_WANT_MIDI_OUTPUT   1

Whether the plugin wants MIDI output.

See also
Plugin::writeMidiEvent(const MidiEvent&)

◆ DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST

#define DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST   1

Whether the plugin wants to change its own parameter inputs.
Not all hosts or plugin formats support this, so Plugin::canRequestParameterValueChanges() can be used to query support at runtime.

See also
Plugin::requestParameterValueChange(uint32_t, float)

◆ DISTRHO_PLUGIN_WANT_PROGRAMS

#define DISTRHO_PLUGIN_WANT_PROGRAMS   1

Whether the plugin provides its own internal programs.

See also
Plugin::initProgramName(uint32_t, String&)
Plugin::loadProgram(uint32_t)

◆ DISTRHO_PLUGIN_WANT_STATE

#define DISTRHO_PLUGIN_WANT_STATE   1

Whether the plugin uses internal non-parameter data.

See also
Plugin::initState(uint32_t, String&, String&)
Plugin::setState(const char*, const char*)

◆ DISTRHO_PLUGIN_WANT_FULL_STATE

#define DISTRHO_PLUGIN_WANT_FULL_STATE   1

Whether the plugin implements the full state API. When this macro is enabled, the plugin must implement a new getState(const char* key) function, which the host calls when saving its session/project. This is useful for plugins that have custom internal values not exposed to the host as key-value state pairs or parameters. Most simple effects and synths will not need this.

Note
this macro is automatically enabled if a plugin has programs and state, as the key-value state pairs need to be updated when the current program changes.
See also
Plugin::getState(const char*)

◆ DISTRHO_PLUGIN_WANT_TIMEPOS

#define DISTRHO_PLUGIN_WANT_TIMEPOS   1

Whether the plugin wants time position information from the host.

See also
Plugin::getTimePosition()

◆ DISTRHO_UI_USE_CUSTOM

#define DISTRHO_UI_USE_CUSTOM   1

Whether the UI uses a custom toolkit implementation based on OpenGL.
When enabled, the macros DISTRHO_UI_CUSTOM_INCLUDE_PATH and DISTRHO_UI_CUSTOM_WIDGET_TYPE are required.

◆ DISTRHO_UI_CUSTOM_INCLUDE_PATH

#define DISTRHO_UI_CUSTOM_INCLUDE_PATH

The include path to the header file used by the custom toolkit implementation. This path must be relative to dpf/distrho/DistrhoUI.hpp

See also
DISTRHO_UI_USE_CUSTOM

◆ DISTRHO_UI_CUSTOM_WIDGET_TYPE

#define DISTRHO_UI_CUSTOM_WIDGET_TYPE

The top-level-widget typedef to use for the custom toolkit. This widget class MUST be a subclass of DGL TopLevelWindow class. It is recommended that you keep this widget class inside the DGL namespace, and define widget type as e.g. DGL_NAMESPACE::MyCustomTopLevelWidget.

See also
DISTRHO_UI_USE_CUSTOM

◆ DISTRHO_UI_DEFAULT_WIDTH

#define DISTRHO_UI_DEFAULT_WIDTH   300

Default UI width to use when creating initial and temporary windows.
Setting this macro allows to skip a temporary UI from being created in certain VST2 and VST3 hosts. (which would normally be done for knowing the UI size before host creates a window for it)

Value must match 1x scale factor.

When this macro is defined, the companion DISTRHO_UI_DEFAULT_HEIGHT macro must be defined as well.

◆ DISTRHO_UI_DEFAULT_HEIGHT

#define DISTRHO_UI_DEFAULT_HEIGHT   300

Default UI height to use when creating initial and temporary windows.
Setting this macro allows to skip a temporary UI from being created in certain VST2 and VST3 hosts. (which would normally be done for knowing the UI size before host creates a window for it)

Value must match 1x scale factor.

When this macro is defined, the companion DISTRHO_UI_DEFAULT_WIDTH macro must be defined as well.

◆ DISTRHO_UI_USE_NANOVG

#define DISTRHO_UI_USE_NANOVG   1

Whether the UI uses NanoVG for drawing instead of the default raw OpenGL calls.
When enabled your UI instance will subclass NanoWidget instead of Widget.

◆ DISTRHO_UI_USER_RESIZABLE

#define DISTRHO_UI_USER_RESIZABLE   1

Whether the UI is resizable to any size by the user.
By default this is false, and resizing is only allowed under the plugin UI control,
Enabling this options makes it possible for the user to resize the plugin UI at anytime.

See also
UI::setGeometryConstraints(uint, uint, bool, bool)

◆ DISTRHO_UI_URI

#define DISTRHO_UI_URI   DISTRHO_PLUGIN_URI "#UI"

The UI URI when exporting in LV2 format.
By default this is set to DISTRHO_PLUGIN_URI with "#UI" as suffix.

◆ DISTRHO_PLUGIN_AU_TYPE

#define DISTRHO_PLUGIN_AU_TYPE   aufx

The AudioUnit type for a plugin.
This is a 4-character symbol, automatically set by DPF based on other plugin macros. See https://developer.apple.com/documentation/audiotoolbox/1584142-audio_unit_types for more information.

◆ DISTRHO_PLUGIN_BRAND_ID

#define DISTRHO_PLUGIN_BRAND_ID   Dstr

A 4-character symbol that identifies a brand or manufacturer, with at least one non-lower case character.
Plugins from the same brand should use the same symbol.

Note
This macro is required when building AU plugins, and used for VST3 if present
Setting this macro will change the uid of a VST3 plugin. If you already released a DPF-based VST3 plugin make sure to also enable DPF_VST3_DONT_USE_BRAND_ID

◆ DISTRHO_PLUGIN_UNIQUE_ID

#define DISTRHO_PLUGIN_UNIQUE_ID   test

A 4-character symbol which identifies a plugin.
It must be unique within at least a set of plugins from the brand.

Note
This macro is required when building AU plugins

◆ DISTRHO_PLUGIN_LV2_CATEGORY

#define DISTRHO_PLUGIN_LV2_CATEGORY   "lv2:Plugin"

Custom LV2 category for the plugin.
This is a single string, and can be one of the following values:

  • lv2:AllpassPlugin
  • lv2:AmplifierPlugin
  • lv2:AnalyserPlugin
  • lv2:BandpassPlugin
  • lv2:ChorusPlugin
  • lv2:CombPlugin
  • lv2:CompressorPlugin
  • lv2:ConstantPlugin
  • lv2:ConverterPlugin
  • lv2:DelayPlugin
  • lv2:DistortionPlugin
  • lv2:DynamicsPlugin
  • lv2:EQPlugin
  • lv2:EnvelopePlugin
  • lv2:ExpanderPlugin
  • lv2:FilterPlugin
  • lv2:FlangerPlugin
  • lv2:FunctionPlugin
  • lv2:GatePlugin
  • lv2:GeneratorPlugin
  • lv2:HighpassPlugin
  • lv2:InstrumentPlugin
  • lv2:LimiterPlugin
  • lv2:LowpassPlugin
  • lv2:MIDIPlugin
  • lv2:MixerPlugin
  • lv2:ModulatorPlugin
  • lv2:MultiEQPlugin
  • lv2:OscillatorPlugin
  • lv2:ParaEQPlugin
  • lv2:PhaserPlugin
  • lv2:PitchPlugin
  • lv2:ReverbPlugin
  • lv2:SimulatorPlugin
  • lv2:SpatialPlugin
  • lv2:SpectralPlugin
  • lv2:UtilityPlugin
  • lv2:WaveshaperPlugin

See http://lv2plug.in/ns/lv2core for more information.

◆ DISTRHO_PLUGIN_VST3_CATEGORIES

#define DISTRHO_PLUGIN_VST3_CATEGORIES   "Fx|Stereo"

Custom VST3 categories for the plugin.
This is a single concatenated string of categories, separated by a |.

Each effect category can be one of the following values:

  • Fx
  • Fx|Ambisonics
  • Fx|Analyzer
  • Fx|Delay
  • Fx|Distortion
  • Fx|Dynamics
  • Fx|EQ
  • Fx|Filter
  • Fx|Instrument
  • Fx|Instrument|External
  • Fx|Spatial
  • Fx|Generator
  • Fx|Mastering
  • Fx|Modulation
  • Fx|Network
  • Fx|Pitch Shift
  • Fx|Restoration
  • Fx|Reverb
  • Fx|Surround
  • Fx|Tools

Each instrument category can be one of the following values:

  • Instrument
  • Instrument|Drum
  • Instrument|External
  • Instrument|Piano
  • Instrument|Sampler
  • Instrument|Synth
  • Instrument|Synth|Sampler

And extra categories possible for any plugin type:

  • Mono
  • Stereo

◆ DISTRHO_PLUGIN_CLAP_FEATURES

#define DISTRHO_PLUGIN_CLAP_FEATURES   "audio-effect", "stereo"

Custom CLAP features for the plugin.
This is a list of features defined as a string array body, without the terminating , or nullptr.

A top-level category can be set as feature and be one of the following values:

  • instrument
  • audio-effect
  • note-effect
  • analyzer

The following sub-categories can also be set:

  • synthesizer
  • sampler
  • drum
  • drum-machine
  • filter
  • phaser
  • equalizer
  • de-esser
  • phase-vocoder
  • granular
  • frequency-shifter
  • pitch-shifter
  • distortion
  • transient-shaper
  • compressor
  • limiter
  • flanger
  • chorus
  • delay
  • reverb
  • tremolo
  • glitch
  • utility
  • pitch-correction
  • restoration
  • multi-effects
  • mixing
  • mastering

And finally the following audio capabilities can be set:

  • mono
  • stereo
  • surround
  • ambisonic

◆ DISTRHO_PLUGIN_CLAP_ID

#define DISTRHO_PLUGIN_CLAP_ID   "studio.kx.distrho.effect"

The plugin id when exporting in CLAP format, in reverse URI form.

Note
This macro is required when building CLAP plugins