LV2 is an interface for writing audio processors, or plugins, in C/C++ which can be dynamically loaded into many applications, or hosts. This core specification is simple and minimal, but is designed so that extensions can be defined to add more advanced features, making it possibly to implement nearly any feature imaginable.

LV2 maintains a strong distinction between code and data. Plugin code is in a shared library, while data is in a companion data file written in Turtle. Code, data, and any other resources (e.g. waveforms) are shipped together in a bundle directory. The code contains only the executable portions of the plugin which inherently must be written in code. All other data is provided in the data file(s). This makes plugin data flexible and extensible, and allows the host to do everything but run the plugin without loading or executing any code. Among other advantages, this makes hosts more robust (broken plugins can't crash a host during discovery) and allows generic tools and non-C programs to work with LV2 data. LV2 itself and extensions are distributed in a similar way.

An LV2 plugin library is suitable for dynamic loading (e.g. via dlopen()) and provides one or more plugin descriptors via lv2_descriptor() or lv2_lib_descriptor(). These can be instantiated to create plugin instances, which can be run directly on data or connected together to perform advanced signal processing tasks.

Plugins communicate via ports, which can transmit any type of data. Data is processed by first connecting each port to a buffer, then repeatedly calling a plugin's run() method to process blocks of data.

This core specification defines two types of port, equivalent to those in LADSPA: lv2:ControlPort and lv2:AudioPort. Audio ports contain arrays with one float element per sample, allowing a block of audio to be processed in a single call to run(). Control ports contain single float values, which are fixed and valid for the duration of the call to run(). Thus the control rate is determined by the block size, which is controlled by the host (and not necessarily constant).

Threading Rules

To faciliate use in multi-threaded programs, LV2 functions are partitioned into several threading classes:

Discovery Class Instantiation Class Audio Class
lv2_descriptor() LV2_Descriptor::instantiate() LV2_Descriptor::run()
lv2_lib_descriptor() LV2_Descriptor::cleanup() LV2_Descriptor::connect_port()
LV2_Descriptor::extension_data() LV2_Descriptor::activate()
LV2_Descriptor::deactivate()

The rules that hosts MUST follow are:

  • When any function is running for a plugin instance, no other function in the same class may run for that instance.
  • When a Discovery function is running, no other functions in the same shared object file may run.
  • When an Instantiation function is running for a plugin instance, no other functions for that instance may run.

Any simultaneous calls that are not explicitly forbidden by these rules are allowed. For example, a host may call run() for two different plugin instances simultaneously.

Plugin functions in any class MUST NOT manipulate any state which might affect other plugin or host code, e.g. by using non-reentrant global functions.

Extensions to this specification which add new functions MUST declare in which of these classes the functions belong, define new classes for them, or otherwise precisely describe their threading rules.

Reference

ClassesPropertiesInstances

Classes

AllpassPlugin

Subclass ofFilterPlugin
Allpass

AmplifierPlugin

Subclass ofDynamicsPlugin
Amplifier

AnalyserPlugin

Subclass ofUtilityPlugin
Analyser

Any plugin that analyses input to output some useful information.

AudioPort

Subclass ofPort
Audio Port

Ports of this type will be connected to an array of length sample_count with elements of C type float.

BandpassPlugin

Subclass ofFilterPlugin
Bandpass

CVPort

Subclass ofPort
CV Port

Ports of this type have the same buffer format as an lv2:AudioPort, except the buffer represents audio-rate control data rather than audio. Like an lv2:ControlPort, a CVPort SHOULD have properties describing its value (e.g. lv2:minimum, lv2:maximum, and lv2:default), and may be presented to the user as a control.

It is generally safe to connect an audio output to a CV input, but not vice versa. Hosts SHOULD take care to prevent data from a CVPort port from being used as audio.

Channel

Subclass ofDesignation
Channel

A specific channel, e.g. left or right. A channel may be audio, or another type such as a MIDI control stream.

ChorusPlugin

Subclass ofModulatorPlugin
Chorus

CombPlugin

Subclass ofFilterPlugin
Comb

CompressorPlugin

Subclass ofDynamicsPlugin
Compressor

ConstantPlugin

Subclass ofGeneratorPlugin
Constant

ControlPort

Subclass ofPort
Control Port

Ports of this type will be connected to a pointer to a single value of C type float.

ConverterPlugin

Subclass ofUtilityPlugin
Converter

Any plugin that converts some form of input into a different form of output.

DelayPlugin

Subclass ofPlugin
Delay

Plugins that intentionally delay their input signal as an effect.

Designation

Subclass ofrdf:Property
Designation

The designation (or assignment) of an input or output. A designation is metadata that describes the meaning or role of data. By assigning a designation to a port using lv2:designation, the port's content becomes meaningful and can be used more intelligently by the host.

DistortionPlugin

Subclass ofPlugin
Distortion

DynamicsPlugin

Subclass ofPlugin
Dynamics

Plugins that alter the envelope or dynamic range of audio.

EQPlugin

Subclass ofFilterPlugin
Equaliser

EnvelopePlugin

Subclass ofDynamicsPlugin
Envelope

ExpanderPlugin

Subclass ofDynamicsPlugin
Expander

ExtensionData

In range ofextensionData
Extension Data

Additional data and/or functions a plugin may return from LV2_Descriptor::extension_data() which can be used to add additional API beyond that defined by LV2_Descriptor.

Feature

In range ofoptionalFeature
requiredFeature
Feature

An additional feature which a plugin or other resource may use or require.

FilterPlugin

Subclass ofPlugin
Filter

FlangerPlugin

Subclass ofModulatorPlugin
Flanger

FunctionPlugin

Subclass ofUtilityPlugin
Function

GatePlugin

Subclass ofDynamicsPlugin
Gate

GeneratorPlugin

Subclass ofPlugin
Generator

Any plugin that generates sound internally, rather than processing its input.

HighpassPlugin

Subclass ofFilterPlugin
Highpass

InputPort

Subclass ofPort
Input Port

Ports of this type will be connected to a pointer to some value, which will be read by the plugin during their run method.

InstrumentPlugin

Subclass ofGeneratorPlugin
Instrument

Any plugin that is intended to be played as a musical instrument.

LimiterPlugin

Subclass ofDynamicsPlugin
Limiter

LowpassPlugin

Subclass ofFilterPlugin
Lowpass

MIDIPlugin

Subclass ofPlugin
MIDI

MixerPlugin

Subclass ofUtilityPlugin
Mixer

A plugin which mixes some number of inputs into some number of outputs.

ModulatorPlugin

Subclass ofPlugin
Modulator

MultiEQPlugin

Subclass ofEQPlugin
Multiband

OscillatorPlugin

Subclass ofGeneratorPlugin
Oscillator

OutputPort

Subclass ofPort
Output Port

Ports of this type will be connected to a pointer to some value, which will be written to by the plugin during their run method.

ParaEQPlugin

Subclass ofEQPlugin
Parametric

Parameter

Subclass ofDesignation
rdf:Property
Parameter

A parameter, i.e. a recognized property. A parameter is a designation for a control.

A parameter defines the meaning of a control (not the method of conveying its value). The standard way of exposing a plugin parameter is via an lv2:ControlPort, which can be given a parameter designation with lv2:designation. Other methods, such as setting dynamic parameters via messages, are possible but not defined here.

PhaserPlugin

Subclass ofModulatorPlugin
Phaser

PitchPlugin

Subclass ofSpectralPlugin
Pitch Shifter

Plugin

Subclass ofPluginBase
In range ofappliesTo
Plugin

The class which represents an LV2 plugin.

To be discovered by hosts, plugins MUST explicitly have rdf:type lv2:Plugin listed in their bundle's manifest, e.g.:

<http://example.org/my-plugin> a lv2:Plugin .

Plugins SHOULD have a doap:license property whenever possible. The doap:name property should be at most a few words in length using title capitalization, e.g. Tape Delay Unit. Use doap:shortdesc or doap:description for more detailed descriptions.

Restriction on doap:name
owl:someValuesFrom rdf:PlainLiteral
A plugin MUST have at least one untranslated doap:name.
Restriction on port
owl:allValuesFrom Port
All ports on a plugin MUST be fully specified lv2:Port instances.

PluginBase

In domain ofport
Plugin Base

An abstract plugin-like resource that MAY not actually be an LV2 plugin (e.g. may not actually have a plugin binary).

PluginBase SHOULD be used as a base type for any resource that may have ports or otherwise mimic the structure of a Plugin (e.g. a preset), since hosts and other tools already understand this structure.

Point

Point

A Point describes an interesting value in a Port's range (much like a labeled notch on a physical knob).

  • A Point MUST have at least one rdfs:label which is a string.
  • A Point MUST have exactly one rdf:value with a type that is compatible with the type of the corresponding Port.

Port

Subclass ofPortBase
In domain ofportProperty
Port

The class which represents an LV2 port.

All LV2 port descriptions MUST have a rdf:type that is one of lv2:Port lv2:InputPort or lv2:OutputPort. Additionally there MUST be at least one other rdf:type which more precisely describes type of the port (e.g. lv2:AudioPort).

Hosts that do not support a specific port class MUST NOT instantiate the plugin, unless that port has the connectionOptional property set (in which case the host can simply connect that port to NULL). If a host is interested in plugins to insert in a certain signal path (e.g. stereo audio), it SHOULD consider all the classes of a port to determine which ports are most suitable for connection (e.g. by ignoring ports with additional classes the host does not recognize).

A port has two identifiers: a (numeric) index, and a (textual) symbol. The index can be used as an identifier at run-time, but persistent references to ports (e.g. in a saved preset) MUST use the symbol. A symbol is guaranteed to refer to the same port on all plugins with a given URI. An index does NOT necessarily refer to the same port on all plugins with a given URI (i.e. the index for a port may differ between plugin binaries).

Restriction on name
owl:minCardinality 1
A port MUST have at least one lv2:name.

PortBase

In range ofport
Port Base

Similar to lv2:PluginBase, an abstract port-like resource that MAY not actually be a fully specified LV2 port. For example, this is used for preset "ports" which do not specify an index.

Restriction on symbol
owl:cardinality 1
A port MUST have exactly one lv2:symbol.

PortProperty

In range ofportProperty
Port Property

A property of this port that allows a host to make more sensible decisions (e.g. to provide a better interface).

ScalePoint

Subclass ofPoint
In range ofscalePoint
Scale Point

A single float Point (for control inputs).

SimulatorPlugin

Subclass ofPlugin
Simulator

Plugins that aim to duplicate the effect of some environmental effect or musical equipment.

SpatialPlugin

Subclass ofPlugin
Spatial

Plugins that manipulate the position of audio in space (e.g. panning, stereo width, surround encoding, etc.).

Specification

Subclass ofdoap:Project

An LV2 specification (i.e. this specification, or an LV2 extension).

Specification data, like plugin data, is distributed in bundles so hosts may discover all present LV2 data.

SpectralPlugin

Subclass ofPlugin
Spectral

Plugins that alter the spectral properties (e.g. frequency) of audio.

Symbol

In range ofsymbol
owl:onDatatype xsd:string

A short restricted name used as a machine and human readable identifier. The first character must be one of _, a-z or A-Z and subsequent characters can be from _, a-z, A-Z and 0-9. This is a valid C identifier, and compatible in most other contexts with restricted string identifiers (e.g. file paths).

UtilityPlugin

Subclass ofPlugin
Utility

Includes things like mathematical functions and non-musical delays.

WaveshaperPlugin

Subclass ofDistortionPlugin
Waveshaper

Properties

appliesTo

TypeObject Property
RangePlugin
applies to

Specifies that a resource is related to a plugin. This is primarily intended for discovery purposes: bundles that describe resources that work with particular plugins (e.g. presets or user interfaces) SHOULD use this predicate in manifest.ttl to relate the resource to the applicable plugin(s), e.g.:

<thing>
    a             ext:Thing ;
    lv2:appliesTo <plugin> ;
    rdfs:seeAlso  <thing.ttl> .

Particularly for large amounts of data, this is preferable to extending the plugin description with rdfs:seeAlso since the host may choose if/when to load the data, knowing that it describes an additional resource and not the plugin itself.

binary

TypeObject Property
Rangeowl:Thing
binary

The binary of an LV2 resource. The value of this property must be a URI that resolves to a shared library object (the actual type of this library is system specific).

This is a required property of a Plugin which MUST be included in the bundle's manifest.ttl file. The lv2:binary of an lv2:Plugin is the shared object containing the lv2_descriptor() or lv2_lib_descriptor() function which can be used to access the descriptor for that plugin. This property may be used similarly by extensions to relate other resources to their implementations.

default

TypeDatatype Property
default

The default value that the host SHOULD set this port to when there is no other information available.

designation

TypeObject Property
Rangerdf:Property
designation

Indicates a channel or parameter designation.

This property is used to give the port's contents a well-defined meaning. For example, if a port has lv2:designation eg:gain, then the value of that port represents the eg:gain of the plugin instance.

Ports should be given designations whenever a well-defined designation exists. This allows the host to act more intelligently and/or provide a more effective user interface. For example, if the plugin has a BPM parameter, the host may automatically set that parameter to the current tempo.

documentation

TypeAnnotation Property
Rangerdfs:Literal
rdfs:seeAlso http://www.w3.org/TR/xhtml-basic/
documentation

Relates a Resource to documentation markup. The value of this property MUST be a string literal which is a valid XHTML Basic 1.1 fragment suitable for use as the content of the <body> element. This can be used by hosts to provide rich online documentation or by tools to generate external documentation pages. The standard language tagging facility of RDF can be used to provide multi-lingual documentation.

XHTML Basic is a W3C Recommendation which defines a basic subset of XHTML intended to be reasonable to implement with limited resources (e.g. on embedded devices). See XHTML Basic, Section 3 for a list of legal tags.

enabled

TypeDatatype Property
Rangexsd:int
enabled

Whether or not processing is currently enabled, that is, not bypassed.

If this value is greater than zero, the plugin processes normally. If this value is zero, the plugin is expected to bypass all signals unmodified. The plugin must provide a click-free transition between the enabled and disabled (bypassed) states.

Values less than zero are reserved for future use (such as click-free insertion/removal of latent plugins), and should be treated like zero (bypassed) by current implementations.

extensionData

TypeObject Property
RangeExtensionData
extension data

Signifies that a plugin provides additional data or functions (as defined by some extension) via LV2_Descriptor::instantiate().

freeWheeling

TypeDatatype Property
Rangexsd:boolean
free-wheeling

Whether or not processing is currently free-wheeling. If true, this means that all processing is happening as quickly as possible, not in real-time. When free-wheeling there is no relationship between the passage of real wall-clock time and the passage of time in the data being processed (e.g. audio frames).

index

TypeDatatype Property
Rangexsd:unsignedInt
index

A non-negative zero-based 32-bit index.

latency

TypeDatatype Property
Rangexsd:nonNegativeInteger
latency

The latency introduced, in frames.

maximum

TypeDatatype Property
maximum

A hint to the host for the maximum useful value that the port will use. This is a soft limit; the plugin is required to gracefully accept all values in the range of a port's data type.

microVersion

TypeDatatype Property
Rangexsd:nonNegativeInteger
micro version

The micro component of a Resource's version.

Releases of plugins and extensions MUST be explicitly versioned. Correct version numbers MUST always be maintained for any versioned resource that is published. For example, after a release, if a change is made in the development version in source control, the micro version MUST be incremented (to an odd number) to distinguish this modified version from the previous release.

This property describes half of a resource version. For detailed documentation on LV2 resource versioning, see lv2:minorVersion.

minimum

TypeDatatype Property
minimum

A hint to the host for the minimum useful value that the port will use. This is a soft limit; the plugin is required to gracefully accept all values in the range of a port's data type.

minorVersion

TypeDatatype Property
Rangexsd:nonNegativeInteger
minor version

The minor version of an LV2 Resource. This, along with lv2:microVersion, is used to distinguish between different versions of the same resource, e.g. to load only the bundle with the most recent version of a plugin. An LV2 version has a minor and micro number with the usual semantics:

  • The minor version MUST be incremented when backwards (but not forwards) compatible additions are made, e.g. the addition of a port to a plugin.
  • The micro version is incremented for changes which do not affect compatibility at all, e.g. bug fixes or documentation updates.

Note there is deliberately no major version; all versions with the same URI are compatible by definition. Replacing a resource with a newer version of that resource MUST NOT break anything. If a change violates this rule, then the URI of the resource (which serves as the major version) MUST be changed.

Plugins and extensions MUST adhere to at least the following rules:

  • All versions of a plugin with a given URI MUST have the same set of mandatory (i.e. not lv2:connectionOptional) ports with respect to lv2:symbol and rdf:type. In other words, every port on a particular version is guaranteed to exist on a future version with same lv2:symbol and at least those rdf:types.
  • New ports MAY be added without changing the plugin URI if and only if they are lv2:connectionOptional and the minor version is incremented.
  • The minor version MUST be incremented if the index of any port (identified by its symbol) is changed.
  • All versions of a specification MUST be compatible in the sense that an implementation of the new version can interoperate with an implementation of any previous version.

Anything that depends on a specific version of a plugin (e.g. a serialisation that references ports by index) MUST refer to the plugin by both URI and version. However, implementations should be tolerant and extensions should be designed such that there is no need to do this (e.g. indices should only be meaningful for a particular plugin instance at run-time).

When hosts discover several installed versions of a resource, they SHOULD warn the user and load only the most recent version.

An odd minor or micro version, or minor version zero, indicates that the resource is a development version. Hosts and tools SHOULD clearly indicate this wherever appropriate. Minor version zero is a special case for pre-release development of plugins, or experimental plugins that are not intended for stable use at all. Hosts SHOULD NOT expect such a plugin to remain compatible with any future version. If possible, hosts SHOULD hide such plugins from users unless an experimental option is enabled.

name

TypeDatatype Property
Rangexsd:string
name

A display name for labeling in a user interface. Unlike lv2:symbol this is unrestricted and may be translated. The lv2:name MUST NOT be used as an identifier. This property is required for Ports, but MUST NOT be used by the host for port identification. The plugin author may change the values of this property without changing the Plugin URI.

optionalFeature

TypeObject Property
RangeFeature
optional feature

Signifies that a plugin or other resource supports a certain feature. If the host supports this feature, it MUST pass its URI and any additional data to the plugin in LV2_Descriptor::instantiate(). The plugin MUST NOT fail to instantiate if an optional feature is not supported by the host.

port

TypeObject Property
DomainPluginBase
RangePortBase
port

A port (input or output) on this plugin.

portProperty

TypeObject Property
DomainPort
RangePortProperty
port property

Relates Ports to PortProperties. The PortProperty may be ignored without catastrophic effects, though it may be useful e.g. for providing a sensible interface for the port.

project

TypeObject Property
Rangedoap:Project
project

The project this is a component of.

This property provides a way to group plugins and/or related resources. A project may have useful metadata common to all plugins (such as homepage, author, version history) which would be wasteful to list separately for each plugin.

Grouping via projects also allows users to find plugins in hosts by project, which is often how they are remembered. For this reason, a project that contains plugins SHOULD always have a doap:name. It is also a good idea for each plugin and the project itself to have an lv2:symbol property, which allows nice quasi-global identifiers for plugins, e.g. myproj.superamp which can be useful for display or fast user entry.

prototype

TypeObject Property
prototype

The prototype to inherit properties from.

This property can be used to include common properties in several descriptions. If a plugin has a prototype, then the host must load all the properties for the prototype as if they were properties of the plugin. That is, if :plug lv2:prototype :prot, then for each triple :prot p o, the triple :plug p o should be loaded.

This facility is useful for distributing text-only plugins that rely on a common binary, by referring to a prototype which is installed by the corresponding software, along with the plugin binary.

requiredFeature

TypeObject Property
RangeFeature
required feature

Signifies that a plugin or other resource requires a certain feature. If the host supports this feature, it MUST pass its URI and any additional data to the plugin in LV2_Descriptor::instantiate(). The plugin MUST fail to instantiate if a required feature is not present; hosts SHOULD always check this before attempting to instantiate a plugin (i.e. discovery by attempting to instantiate is strongly discouraged).

scalePoint

TypeObject Property
RangeScalePoint
scale point

A scale point of a port or parameter.

shortName

TypeDatatype Property
Rangexsd:string
short name

A short display name for labeling in a user interface. The same rules for port names apply here, with the exception that short names should not be longer than 16 characters.

symbol

TypeDatatype Property
RangeSymbol
rdf:PlainLiteral
symbol

The value of this property MUST conform to the rules for lv2:Symbol, and MUST NOT have a language tag.

A symbol is a unique identifier with respect to the parent (e.g. a port's symbol is a unique identifier with respect to its plugin). The plugin author MUST change the plugin URI if a port symbol is changed or removed.

Instances

connectionOptional

TypePortProperty
connection optional

Indicates that this port does not have to be connected to valid data by the host. If it is to be disconnected then the port MUST set to NULL with a call to the connectPort method.

control

TypeChannel
control

The primary control channel. This should be used as the lv2:designation of ports that are used to send commands and receive responses. Typically this will be an event port that supports some protocol, e.g. MIDI or LV2 Atoms.

enumeration

TypePortProperty
enumeration

Indicates that a port's only reasonable values are the scale points defined for that port. A host SHOULD NOT allow a user to set the value of such a port to anything other than a scale point. However, a plugin MUST operate reasonably even if such a port has an input that is not a scale point, preferably by simply choosing the largest enumeration value less than or equal to the actual input value (i.e. round the input value down).

hardRTCapable

TypeFeature
hard real-time capable

Indicates that the plugin is capable of running not only in a conventional host but also in a hard real-time environment. To qualify for this the plugin MUST satisfy all of the following:

  1. The plugin MUST NOT use malloc(), free() or other heap memory management functions within its Audio class functions.
  2. The plugin MUST NOT attempt to make use of any library functions in its Audio class functions, unless those functions themselves adhere to these rules (i.e. are hard realtime safe). The plugin MAY assume the standard C and C math library functions are safe.
  3. The plugin will not access files, devices, pipes, sockets, IPC or any other mechanism that might result in process or thread blocking within its Audio class functions.
  4. The plugin will take an amount of time to execute a run() call approximately of form A + B * sample_count where A and B depend on the machine and host in use. This amount of time MUST NOT depend on input signals or plugin state.

Note these rules apply to the connect_port() function as well as run().

inPlaceBroken

TypeFeature
in-place broken

Indicates that the plugin may cease to work correctly if the host elects to use the same data location for both input and output. Plugins that will fail to work correctly if ANY input port is connected to the same location as ANY output port MUST require this Feature. Doing so should be avoided as it makes it impossible for hosts to use the plugin to process data in-place.

integer

TypePortProperty
integer

Indicates that a port's reasonable values are integers (eg. a user interface would likely wish to provide a stepped control allowing only integer input). A plugin MUST operate reasonably even if such a port has a non-integer input.

isLive

TypeFeature
is live

Indicates that the plugin has a real-time dependency (e.g. queues data from a socket) and so its output must not be cached or subject to significant latency, and calls to the run method should be done in rapid succession. This property is not related to hard real-time execution requirements (see lv2:hardRTCapable).

isSideChain

TypePortProperty
is side-chain

Indicates that a port is a "sidechain", which affects the output somehow but should not be considered a main input. Sidechain ports should be connectionOptional, and may be ignored by hosts.

reportsLatency

TypePortProperty
reports latency

Indicates that the port is used to express the processing latency incurred by the plugin, expressed in samples. The latency may be affected by the current sample rate, plugin settings, or other factors, and may be changed by the plugin at any time. Where the latency is frequency dependent the plugin may choose any appropriate value. If a plugin introduces latency it MUST provide EXACTLY ONE port with this property set which informs the host of the correct latency. In fuzzy cases the value output should be the most reasonable based on user expectation of input/output alignment (eg. musical delay/echo plugins should not report their delay as latency, as it is an intentional effect).

sampleRate

TypePortProperty
sample rate

Indicates that any bounds specified should be interpreted as multiples of the sample rate. For instance, a frequency range from 0Hz to the Nyquist frequency (half the sample rate) could be requested by this property in conjunction with lv2:minimum 0.0 and lv2:maximum 0.5. Hosts that support bounds at all MUST support this property.

toggled

TypePortProperty
toggled

Indicates that the data item should be considered a Boolean toggle. Data less than or equal to zero should be considered off or false, and data above zero should be considered on or true.

This extension defines a simple mechanism for plugins to map URIs to and from integers, usually for performance reasons (e.g. processing events typed by URIs in real time). Typically, plugins map URIs to integers for things they "understand" at instantiation time, and store those values for use in the audio thread without doing any string comparison. This allows for the extensibility of RDF but with the performance of integers.

This extension is intended as an improved and simplified replacement for the uri-map extension, since the map context parameter has been found problematic. This extension is functionally equivalent to the uri-map extension with a NULL context. New implementations are encouraged to use this extension for URI mapping.

Reference

Instances

Instances

map

Typelv2:Feature

A feature which is used to map URIs to integers. To support this feature, the host must pass an LV2_Feature to LV2_Descriptor::instantiate() with URI LV2_URID__map and data pointed to an instance of LV2_URID_Map.

unmap

Typelv2:Feature

A feature which is used to unmap URIs previously mapped to integers by urid:map. To support this feature, the host must pass an LV2_Feature to LV2_Descriptor::instantiate() with URI LV2_URID__unmap and data pointed to an instance of LV2_URID_Unmap.

This vocabulary defines a number of units for use in audio processing.

For example, to say that a gain port's value is in decibels (units:db)

@prefix units: <http://lv2plug.in/ns/extensions/units#> .
@prefix eg:    <http://example.org/> .

eg:plugin lv2:port [
    a            lv2:ControlPort , lv2:InputPort ;
    lv2:index    0 ;
    lv2:symbol   "gain" ;
    lv2:name     "gain" ;
    units:unit   units:db
] .

Using the same form, plugins may also specify one-off units inline, to give better display hints to hosts:

eg:plugin lv2:port [
    a            lv2:ControlPort , lv2:InputPort ;
    lv2:index    0 ;
    lv2:symbol   "frob" ;
    lv2:name     "frob level" ;
    units:unit [
        a            units:Unit ;
        rdfs:label   "frobnication" ;
        units:symbol "fr" ;
        units:render "%f f"
    ]
] .

It is also possible to define conversions between various units, which makes it possible for hosts to automatically and generically convert from a given unit to a desired unit. The units defined in this extension include conversion definitions where it makes sense to do so.

Reference

ClassesPropertiesInstances

Classes

Conversion

In domain offactor
to
In range ofconversion
prefixConversion
Conversion

A conversion from one unit to another.

Restriction on to
owl:cardinality 1
A conversion MUST have exactly 1 units:to property.

Unit

In domain ofconversion
prefixConversion
render
symbol
In range ofto
unit
Unit

A unit for LV2 port data

Properties

conversion

TypeObject Property
DomainUnit
RangeConversion
conversion

A conversion from this unit to another.

factor

TypeDatatype Property
DomainConversion
conversion factor

The factor to multiply the source value by in order to convert to the target unit.

prefixConversion

TypeObject Property
Sub-property ofconversion
DomainUnit
RangeConversion
prefix conversion

A conversion from this unit to the same unit but with a different SI prefix (e.g. Hz to kHz).

render

TypeDatatype Property
DomainUnit
Rangexsd:string
unit format string

A printf format string for rendering a value (eg. "%f dB").

symbol

TypeDatatype Property
DomainUnit
Rangexsd:string
unit symbol

The abbreviated symbol for the unit (e.g. dB).

to

TypeObject Property
DomainConversion
RangeUnit
conversion target

The target unit this conversion converts to.

unit

TypeObject Property
RangeUnit
unit

The unit used by the value of a port or parameter.

Instances

bar

TypeUnit
render %f bars
symbol bars
bars

beat

TypeUnit
render %f beats
symbol beats
beats

bpm

TypeUnit
prefixConversion
factor 0.0166666666
to hz
render %f BPM
symbol BPM
beats per minute

coef

TypeUnit
conversion
factor 100
to pc
render * %f
symbol
coefficient

db

TypeUnit
render %f dB
symbol dB
decibels

degree

TypeUnit
render %f deg
symbol deg
degrees

frame

TypeUnit
render %f frames
symbol frames
audio frames

inch

TypeUnit
conversion
factor 2.54
to cm
render %f"
symbol in
inches

khz

TypeUnit
prefixConversion
factor 1000
to hz
prefixConversion
factor 0.001
to mhz
render %f kHz
symbol kHz
kilohertz

mhz

TypeUnit
prefixConversion
factor 1000000
to hz
prefixConversion
factor 0.001
to khz
render %f MHz
symbol MHz
megahertz

midiNote

TypeUnit
render MIDI note %d
symbol note
MIDI note

mile

TypeUnit
conversion
factor 1.6093
to km
render %f mi
symbol mi
miles

min

TypeUnit
conversion
factor 60.0
to s
render %f mins
symbol min
minutes

ms

TypeUnit
prefixConversion
factor 0.001
to s
render %f ms
symbol ms
milliseconds

oct

TypeUnit
conversion
factor 12.0
to semitone12TET
render %f octaves
symbol oct
octaves

pc

TypeUnit
conversion
factor 0.01
to coef
render %f%%
symbol %
percent

s

TypeUnit
conversion
factor 0.0166666666
to min
prefixConversion
factor 1000
to ms
render %f s
symbol s
seconds

semitone12TET

TypeUnit
conversion
factor 0.083333333
to oct
render %f semi
symbol semi
semitones

This is a vocabulary for precisely describing a position in time and the passage of time itself, in both real and musical terms.

In addition to real time (e.g. seconds), two units of time are used: frames and beats. A frame is a numbered quantum of time. Frame time is related to real-time by the frame rate or sample rate, time:framesPerSecond. A beat is a single pulse of musical time. Beat time is related to real-time by the tempo, time:beatsPerMinute.

Musical time additionally has a meter which describes passage of time in terms of musical bars. A bar is a higher level grouping of beats. The meter describes how many beats are in one bar.

Reference

ClassesProperties

Classes

Position

In range ofposition
Position

A point in time and/or the speed at which time is passing. A position is both a point and a speed, which precisely defines a time within a timeline.

Rate

Subclass ofPosition
In domain ofbeatUnit
beatsPerBar
beatsPerMinute
framesPerSecond
speed
Rate

The rate of passage of time in terms of one unit with respect to another.

Time

Subclass ofPosition
In domain ofbar
barBeat
beat
frame
Time

A point in time in some unit/dimension.

Properties

bar

TypeDatatype Property
DomainTime
Rangexsd:long
bar

barBeat

TypeDatatype Property
DomainTime
Rangexsd:float
beat within bar

The beat number within the bar, from 0 to beatsPerBar.

beat

TypeDatatype Property
DomainTime
Rangexsd:double
beat

The global running beat number. This is not the beat within a bar like barBeat, but relative to the same origin as time:bar and monotonically increases unless the transport is repositioned.

beatUnit

TypeDatatype Property
DomainRate
Rangexsd:nonNegativeInteger

Beat unit, the note value that counts as one beat. This is the bottom number in a time signature: 2 for half note, 4 for quarter note, and so on.

beatsPerBar

TypeDatatype Property
DomainRate
Rangexsd:float
beats per bar

beatsPerMinute

TypeDatatype Property
DomainRate
Rangexsd:float
beats per minute

Tempo in beats per minute.

frame

TypeDatatype Property
DomainTime
Rangexsd:long
frame

framesPerSecond

TypeDatatype Property
DomainRate
Rangexsd:float
frames per second

Frame rate in frames per second.

position

TypeObject Property
RangePosition
position

speed

TypeDatatype Property
DomainRate
Rangexsd:float
speed

The rate of the progress of time as a fraction of normal speed. For example, a rate of 0.0 is stopped, 1.0 is rolling at normal speed, 0.5 is rolling at half speed, -1.0 is reverse, and so on.

An Atom is a simple generic data container for holding any type of Plain Old Data (POD). An Atom can contain simple primitive types like integers, floating point numbers, and strings; as well as structured data like lists and dictionary-like Objects. Since Atoms are POD, they can be easily copied (e.g. using memcpy) anywhere and are suitable for use in real-time code.

Every atom starts with an LV2_Atom header, followed by the contents. This allows code to process atoms without requiring special code for every type of data. For example, plugins that mutually understand a type can be used together in a host that does not understand that type, because the host is only required to copy atoms, not interpret their contents. Similarly, plugins (such as routers, delays, or data structures) can meaningfully process atoms of a type unknown to them.

Atoms should be used anywhere values of various types must be stored or transmitted. The port type AtomPort can be used to transmit atoms via ports. An AtomPort that contains an Sequence can be used for sample accurate event communication, such as MIDI, and replaces the earlier event extension.

Serialisation

Each Atom type defines a binary format for use at runtime, but also a serialisation that is natural to express in Turtle format. Thus, this specification defines a powerful real-time appropriate data model, as well as a portable way to serialise any data in that model. This is particularly useful for inter-process communication, saving/restoring state, and describing values in plugin data files.

Custom Atom Types

While it is possible to define new Atom types for any binary format, the standard types defined here are powerful enough to describe almost anything. Implementations SHOULD build structures out of the types provided here, rather than define new binary formats (e.g. use Tuple or Object rather than a new C struct type). Current implementations have support for serialising all standard types, so new binary formats are an implementation burden which harms interoperabilty. In particular, plugins SHOULD NOT expect UI communication or state saving with custom Atom types to work. In general, new Atom types should only be defined where absolutely necessary due to performance reasons and serialisation is not a concern.

Reference

ClassesPropertiesInstances

Classes

Atom

cType LV2_Atom
Atom

Abstract base class for all atoms. An LV2_Atom has a 32-bit size and type followed by a body of size bytes. Atoms MUST be 64-bit aligned.

All concrete Atom types (subclasses of this class) MUST define a precise binary layout for their body.

The type field is the URI of an Atom type mapped to an integer. Implementations SHOULD gracefully pass through, or ignore, atoms with unknown types.

All atoms are POD by definition except references, which as a special case have type = 0. An Atom MUST NOT contain a Reference. It is safe to copy any non-reference Atom with a simple memcpy, even if the implementation does not understand type. Though this extension reserves the type 0 for references, the details of reference handling are currently unspecified. A future revision of this extension, or a different extension, may define how to use non-POD data and references. Implementations MUST NOT send references to another implementation unless the receiver is explicitly known to support references (e.g. by supporting a feature).

The atom with both type and size 0 is null, which is not considered a Reference.

AtomPort

Subclass oflv2:Port
In domain ofbufferType
Atom Port

A port which contains an atom:Atom. Ports of this type are connected to an LV2_Atom with a type specified by atom:bufferType.

Output ports with a variably sized type MUST be initialised by the host before every run() to an atom:Chunk with size set to the available space. The plugin reads this size to know how much space is available for writing. In all cases, the plugin MUST write a complete atom (including header) to outputs. However, to be robust, hosts SHOULD initialise output ports to a safe sentinel (e.g. the null Atom) before calling run().

Blank

Subclass ofObject
cType LV2_Atom_Object
owl:deprecated true
Blank
Deprecated

This class is deprecated. Use atom:Object with ID 0 instead.

An atom:Object where the LV2_Atom_Object::id is a blank node ID (NOT a URI). The ID of a Blank is valid only within the context the Blank appears in. For ports this is the context of the associated run() call, i.e. all ports share the same context so outputs can contain IDs that correspond to IDs of blanks in the input.

Bool

Subclass ofAtom
cType LV2_Atom_Bool
owl:onDatatype xsd:boolean
Boolean

An Int where 0 is false and any other value is true.

Chunk

Subclass ofAtom
owl:onDatatype xsd:base64Binary
Chunk of memory

A chunk of memory with undefined contents. This type is used to indicate a certain amount of space is available. For example, output ports with a variably sized type are connected to a Chunk so the plugin knows the size of the buffer available for writing.

The use of a Chunk should be constrained to a local scope, since interpreting it is impossible without context. However, if serialised to RDF, a Chunk may be represented directly as an xsd:base64Binary string, e.g.:

[] eg:someChunk "vu/erQ=="^^xsd:base64Binary .

Double

Subclass ofNumber
cType LV2_Atom_Double
owl:onDatatype xsd:double
64-bit floating point number

Event

cType LV2_Atom_Event
Event

An atom with a time stamp prefix, typically an element of an atom:Sequence. Note this is not an Atom type.

Float

Subclass ofNumber
cType LV2_Atom_Float
owl:onDatatype xsd:float
32-bit floating point number

Int

Subclass ofNumber
cType LV2_Atom_Int
owl:onDatatype xsd:int
Signed 32-bit integer

Literal

Subclass ofAtom
cType LV2_Atom_Literal
String Literal

A UTF-8 encoded string literal, with an optional datatype or language.

This type is compatible with rdfs:Literal and is capable of expressing a string in any language or a value of any type. A Literal has a datatype and lang followed by string data in UTF-8 encoding. The length of the string data in bytes is size - sizeof(LV2_Atom_Literal), including the terminating NULL character. The lang field SHOULD be a URI of the form <http://lexvo.org/id/iso639-3/LANG> or <http://lexvo.org/id/iso639-1/LANG> where LANG is a 3-character ISO 693-3 language code, or a 2-character ISO 693-1 language code, respectively.

A Literal may have a datatype OR a lang, but never both.

For example, a Literal can be "Hello" in English:

void set_to_hello_in_english(LV2_Atom_Literal* lit) {
     lit->atom.type     = map(expand("atom:Literal"));
     lit->atom.size     = 14;
     lit->body.datatype = 0;
     lit->body.lang     = map("http://lexvo.org/id/iso639-1/en");
     memcpy(LV2_ATOM_CONTENTS(LV2_Atom_Literal, lit),
            "Hello",
            sizeof("Hello"));  // Assumes enough space
}

or a Turtle string:

void set_to_turtle_string(LV2_Atom_Literal* lit, const char* ttl) {
     lit->atom.type     = map(expand("atom:Literal"));
     lit->atom.size     = 64;
     lit->body.datatype = map("http://www.w3.org/2008/turtle#turtle");
     lit->body.lang     = 0;
     memcpy(LV2_ATOM_CONTENTS(LV2_Atom_Literal, lit),
            ttl,
            strlen(ttl) + 1);  // Assumes enough space
}

Long

Subclass ofNumber
cType LV2_Atom_Long
owl:onDatatype xsd:long
Signed 64-bit integer

Number

Subclass ofAtom
Number

Object

Subclass ofAtom
cType LV2_Atom_Object
Object

An Object is an atom with a set of properties. This corresponds to an RDF Resource, and can be thought of as a dictionary with URID keys.

An LV2_Atom_Object body has a uint32_t id and type, followed by a series of atom:Property bodies (LV2_Atom_Property_Body). The LV2_Atom_Object_Body::otype field is equivalent to a property with key rdf:type, but is included in the structure to allow for fast dispatching.

Code SHOULD check for objects using lv2_atom_forge_is_object() or lv2_atom_forge_is_blank() if a forge is available, rather than checking the atom type directly. This will correctly handle the deprecated atom:Resource and atom:Blank types.

When serialised to RDF, an Object is represented as a resource, e.g.:

eg:someObject
    eg:firstPropertyKey "first property value" ;
    eg:secondPropertyKey "first loser" ;
    eg:andSoOn "and so on" .

Path

Subclass ofURI
owl:onDatatype URI
File path string

A local file path.

A Path is a URI reference with only a path component: no scheme, authority, query, or fragment. In particular, paths to files in the same bundle may be cleanly written in Turtle files as a relative URI. However, implementations may assume any binary Path (e.g. in an event payload) is a valid file path which can passed to system functions like fopen() directly, without any character encoding or escape expansion required.

Any implemenation that creates a Path atom to transmit to another is responsible for ensuring it is valid. A Path SHOULD always be absolute, unless there is some mechanism in place that defines a base path. Since this is not the case for plugin instances, effectively any Path sent to or received from a plugin instance MUST be absolute.

Property

Subclass ofAtom
cType LV2_Atom_Property
Property

A property of an atom:Object. An LV2_Atom_Property has a URID key and context, and an Atom value. This corresponds to an RDF Property, where the key is the predicate and the value is the object.

The context field can be used to specify a different context for each property, where this is useful. Otherwise, it may be 0.

Properties generally only exist as part of an atom:Object. Accordingly, they will typically be represented directly as properties in RDF (see atom:Object). If this is not possible, they may be expressed as partial reified statements, e.g.:

eg:someProperty
    rdf:predicate eg:theKey ;
    rdf:object eg:theValue .

Resource

Subclass ofObject
cType LV2_Atom_Object
owl:deprecated true
Resource
Deprecated

This class is deprecated. Use atom:Object instead.

An atom:Object where the id field is a URID, i.e. an Object with a URI.

Sequence

Subclass ofAtom
cType LV2_Atom_Sequence
Sequence

A sequence of atom:Event, i.e. a series of time-stamped Atoms.

LV2_Atom_Sequence_Body.unit describes the time unit for the contained atoms. If the unit is known from context (e.g. run() stamps are always audio frames), this field may be zero. Otherwise, it SHOULD be either units:frame or units:beat, in which case ev.time.frames or ev.time.beats is valid, respectively.

If serialised to RDF, a Sequence has a similar form to atom:Vector, but for brevity the elements may be assumed to be atom:Event, e.g.:

eg:someSequence
    a atom:Sequence ;
    rdf:value (
        [
            atom:frameTime 1 ;
            rdf:value "901A01"^^midi:MidiEvent
        ] [
            atom:frameTime 3 ;
            rdf:value "902B02"^^midi:MidiEvent
        ]
    ) .

Sound

Subclass ofVector
cType LV2_Atom_Sound
Sound

An atom:Vector of atom:Float which represents an audio waveform. The format is the same as the buffer format for lv2:AudioPort (except the size may be arbitrary). An atom:Sound inherently depends on the sample rate, which is assumed to be known from context. Because of this, directly serialising an atom:Sound is probably a bad idea, use a standard format like WAV instead.

String

Subclass ofAtom
cType LV2_Atom_String
owl:onDatatype xsd:string
String

A UTF-8 encoded string.

The body of an LV2_Atom_String is a C string in UTF-8 encoding, i.e. an array of bytes (uint8_t) terminated with a NULL byte ('\0').

This type is for free-form strings, but SHOULD NOT be used for typed data or text in any language. Use atom:Literal unless translating the string does not make sense and the string has no meaningful datatype.

Tuple

Subclass ofAtom
Tuple

A series of Atoms with varying type and size.

The body of a Tuple is simply a series of complete atoms, each aligned to 64 bits.

If serialised to RDF, a Tuple SHOULD have the form:

eg:someVector
     a atom:Tuple ;
     rdf:value (
         "1"^^xsd:int
         "3.5"^^xsd:float
         "etc"
     ) .

URI

Subclass ofString
owl:onDatatype xsd:anyURI
URI string

A URI string. This is useful when a URI is needed but mapping is inappropriate, for example with temporary or relative URIs. Since the ability to distinguish URIs from plain strings is often necessary, URIs MUST NOT be transmitted as atom:String.

This is not strictly a URI, since UTF-8 is allowed. Escaping and related issues are the host's responsibility.

URID

Subclass ofAtom
cType LV2_Atom_URID
Integer URID

An unsigned 32-bit integer mapped from a URI (e.g. with LV2_URID_Map).

Vector

Subclass ofAtom
cType LV2_Atom_Vector
Vector

A homogeneous series of atom bodies with equivalent type and size.

An LV2_Atom_Vector is a 32-bit child_size and child_type followed by size / child_size atom bodies.

For example, an atom:Vector containing 42 elements of type atom:Float:

struct VectorOf42Floats {
    uint32_t size;        // sizeof(LV2_Atom_Vector_Body) + (42 * sizeof(float);
    uint32_t type;        // map(expand("atom:Vector"))
    uint32_t child_size;  // sizeof(float)
    uint32_t child_type;  // map(expand("atom:Float"))
    float    elems[42];
};

Note that it is possible to construct a valid Atom for each element of the vector, even by an implementation which does not understand child_type.

If serialised to RDF, a Vector SHOULD have the form:

eg:someVector
     a atom:Vector ;
     atom:childType atom:Int ;
     rdf:value (
         "1"^^xsd:int
         "2"^^xsd:int
         "3"^^xsd:int
         "4"^^xsd:int
     ) .

Properties

beatTime

TypeDatatype Property
Rangexsd:decimal
beat time

Time stamp in beats. Typically used for events.

bufferType

TypeObject Property
DomainAtomPort
Rangerdfs:Class
buffer type

Indicates that an AtomPort may be connected to a certain Atom type. A port MAY support several buffer types. The host MUST NOT connect a port to an Atom with a type not explicitly listed with this property. The value of this property MUST be a sub-class of atom:Atom. For example, an input port that is connected directly to an LV2_Atom_Double value is described like so:

<plugin>
    lv2:port [
        a lv2:InputPort , atom:AtomPort ;
        atom:bufferType atom:Double ;
    ] .

This property only describes the types a port may be directly connected to. It says nothing about the expected contents of containers. For that, use atom:supports.

cType

TypeDatatype Property
Domainrdfs:Class
Rangelv2:Symbol
C type

The identifier for a C type describing the binary representation of an Atom of this type.

childType

TypeObject Property
child type

The type of a container's children.

frameTime

TypeDatatype Property
Rangexsd:decimal
frame time

Time stamp in audio frames. Typically used for events.

supports

Rangerdfs:Class
supports

Indicates that a particular Atom type is supported.

This property is defined loosely, it may be used to indicate that anything supports an Atom type, wherever that may be useful. It applies recursively where collections are involved.

In particular, this property can be used to describe which event types are expected by a port. For example, a port that receives MIDI events is described like so:

<plugin>
    lv2:port [
        a lv2:InputPort , atom:AtomPort ;
        atom:bufferType atom:Sequence ;
        atom:supports midi:MidiEvent ;
    ] .

Instances

atomTransfer

Typeui:PortProtocol
atom transfer

Transfer of the complete atom in a port buffer. Useful as the format for a LV2UI_Write_Function.

This protocol applies to atom ports. The host must transfer the complete atom contained in the port, including header.

eventTransfer

Typeui:PortProtocol
event transfer

Transfer of individual events in a port buffer. Useful as the format for a LV2UI_Write_Function.

This protocol applies to ports which contain events, usually in an atom:Sequence. The host must transfer each individual event to the recipient. The format of the received data is an LV2_Atom, there is no timestamp header.

This specification defines a data type for a MIDI message, midi:MidiEvent, which is normalised for fast and convenient real-time processing. MIDI is the Musical Instrument Digital Interface, a ubiquitous binary standard for controlling digital music devices.

For plugins that process MIDI (or other situations where MIDI is sent via a generic transport) the main type defined here, midi:MidiEvent, can be mapped to an integer and used as the type of an LV2 Atom or Event.

This specification also defines a complete human and machine readable description of the MIDI standard (except for standard controller numbers). These descriptions are detailed enough to express any MIDI message as properties.

Reference

ClassesProperties

Classes

ActiveSense

Subclass ofSystemRealtime
status FE
Active Sense Message

ChannelPressure

Subclass ofVoiceMessage
chunk
byteNumber 0
property pressure
statusMask D0
Channel Pressure Message

Chunk

In domain ofbyteNumber
property
In range ofchunk
MIDI Chunk

A series of contiguous bytes (usually one) in a message.

Clock

Subclass ofSystemRealtime
status F8
Clock Message

Continue

Subclass ofSystemRealtime
status FB
Continue Message

HexByte

In range ofstatus
statusMask
velocity
owl:onDatatype xsd:hexBinary

A hexadecimal byte, which is a xsd:hexBinary value <= FF

MidiEvent

Subclass ofatom:Atom
ev:Event
In range ofbinding
owl:onDatatype xsd:hexBinary
MIDI Message

A single raw MIDI message (i.e. a sequence of bytes).

This is equivalent to a standard MIDI messages, except with the following restrictions to simplify handling:

  • Running status is not allowed, every message must have its own status byte.
  • Note On messages with velocity 0 are not allowed. These messages are equivalent to Note Off in standard MIDI streams, but here only proper Note Off messages are allowed.
  • "Realtime messages" (status bytes 0xF8 to 0xFF) are allowed, but may not occur inside other messages like they can in standard MIDI streams.
  • All messages are complete valid MIDI messages. This means, for example, that only the first byte in each event (the status byte) may have the eighth bit set, that Note On and Note Off events are always 3 bytes long, etc. Where messages are communicated, the writer is responsible for writing valid messages, and the reader may assume that all events are valid.

If a midi:MidiEvent is serialised to a string, the format should be xsd:hexBinary, e.g. (in Turtle notation):

[] eg:someEvent "901A01"^^midi:MidiEvent .

QuarterFrame

Subclass ofSystemCommon
status F1
Quarter Frame Message

Reset

Subclass ofSystemRealtime
status FF
Reset Message

SongPosition

Subclass ofSystemCommon
chunk
byteNumber 0
byteNumber 1
property songPosition
status F2
Song Position Pointer Message

SongSelect

Subclass ofSystemCommon
status F3
Song Select Message

Start

Subclass ofSystemRealtime
status FA
Start Message

Stop

Subclass ofSystemRealtime
status FC
Stop Message

SystemCommon

Subclass ofSystemMessage
System Common Message

SystemExclusive

Subclass ofSystemMessage
status F0
System Exclusive Message

SystemMessage

Subclass ofMidiEvent
statusMask F0
System Message

SystemRealtime

Subclass ofSystemMessage
System Realtime Message

TuneRequest

Subclass ofSystemCommon
status F6
Tune Request Message

VoiceMessage

Subclass ofMidiEvent
statusMask F0
Voice Message

Properties

benderValue

TypeDatatype Property
Rangexsd:short
bender value

The value of a pitch bender (-8192 to 8192).

binding

TypeObject Property
RangeMidiEvent
binding

The MIDI event to bind a parameter to. This describes which MIDI events should be used to control a port, parameter, or other object. The binding should be a midi:MidiEvent but the property that represents the control value may be omitted. For example, to bind to the value of controller 17:

byteNumber

TypeDatatype Property
DomainChunk
Rangexsd:unsignedByte
byte number

The 0-based index of a byte which is part of this chunk.

channel

TypeDatatype Property
Rangexsd:unsignedByte
MIDI channel

The channel number of a MIDI message.

chunk

RangeChunk
MIDI chunk

A chunk of a MIDI message.

controllerNumber

TypeDatatype Property
Rangexsd:byte
MIDI controller number

The numeric ID of a controller (0 to 127).

controllerValue

TypeDatatype Property
Rangexsd:byte
MIDI controller value

The value of a controller (0 to 127).

noteNumber

TypeDatatype Property
Rangexsd:byte
note number

The numeric ID of a note (0 to 127).

pressure

TypeDatatype Property
Rangexsd:byte
key pressure

Key pressure (0 to 127).

programNumber

TypeDatatype Property
Rangexsd:byte
program number

The numeric ID of a program (0 to 127).

property

TypeObject Property
DomainChunk
Rangerdf:Property
property

The property this chunk represents.

songNumber

TypeDatatype Property
Rangexsd:byte
song number

The numeric ID of a song (0 to 127).

songPosition

TypeDatatype Property
Rangexsd:short
song position

Song position in MIDI beats (16th notes) (-8192 to 8192).

status

TypeDatatype Property
RangeHexByte
status byte

The exact status byte for a message of this type.

statusMask

TypeDatatype Property
RangeHexByte
status mask

The status byte for a message of this type on channel 1, i.e. a status byte with the lower nibble set to zero.

velocity

TypeDatatype Property
RangeHexByte
velocity

The velocity of a note message (0 to 127).

This vocabulary defines various properties for plugin ports, which can be used to better describe how a plugin can be controlled. Using this metadata, hosts can build better UIs for plugins, and provide more advanced automatic functionality.

Reference

PropertiesInstances

Properties

displayPriority

Domainlv2:Port
Rangexsd:nonNegativeInteger
display priority

Indicates how important a port is to controlling the plugin. If a host can only display some ports of a plugin, it should prefer ports with a higher display priority. Priorities do not need to be unique, and are only meaningful when compared to each other.

rangeSteps

Domainlv2:Port
Rangexsd:nonNegativeInteger
number of value steps

This value indicates into how many evenly-divided points the (control) port range should be divided for step-wise control. This may be used for changing the value with step-based controllers like arrow keys, mouse wheel, rotary encoders, etc.

Note that when used with a pprops:logarithmic port, the steps are logarithmic too, and port value can be calculated as:

value = lower * pow(upper / lower, step / (steps - 1))

and the step from value is:

step = (steps - 1) * log(value / lower) / log(upper / lower)

where:

  • value is the port value
  • step is the step number (0..steps)
  • steps is the number of steps (= value of :rangeSteps property)
  • lower and upper are the bounds

Instances

causesArtifacts

Typelv2:PortProperty
changes cause artifacts

Input ports only. Indicates that any changes to the port value may produce slight artifacts to produced audio signals (zipper noise and other results of signal discontinuities). Connecting ports of this type to continuous signals is not recommended, and when presenting a list of automation targets, those ports may be marked as artifact-producing.

continuousCV

Typelv2:PortProperty
smooth modulation signal

Indicates that the port carries a "smooth" modulation signal. Control input ports of this type are well-suited for being connected to sources of smooth signals (knobs with smoothing, modulation rate oscillators, output ports with continuousCV type, etc.). Typically, the plugin with ports which have this property will implement appropriate smoothing to avoid audio artifacts. For output ports, this property suggests the value of the port is likely to change frequently, and describes a smooth signal (e.g. successive values may be considered points along a curve).

discreteCV

Typelv2:PortProperty
discrete modulation signal

Indicates that the port carries a "discrete" modulation signal. Input ports of this type are well-suited for being connected to sources of discrete signals (switches, buttons, classifiers, event detectors, etc.). May be combined with pprops:trigger property. For output ports, this property suggests the value of the port describe discrete values that should be interpreted as steps (and not points along a curve).

expensive

Typelv2:PortProperty
changes are expensive

Input ports only. Indicates that any changes to the port value may trigger expensive background calculation (e.g. regenerate some lookup tables in a background thread). Any value changes may have not have immediate effect, or may cause silence or diminished-quality version of the output until background processing is finished. Ports having this property are typically not well suited for connection to outputs of other plugins, and should not be offered as connection targets or for automation by default.

hasStrictBounds

Typelv2:PortProperty
has strict bounds

For hosts that support pprops:supportsStrictBounds, this indicates that the value of the port should never exceed the port's minimum and maximum control points. For input ports, it moves the responsibility for limiting the range of values to host, if it supports pprops:supportsStrictBounds. For output ports, it indicates that values within specified range are to be expected, and breaking that should be considered by the host as error in plugin implementation.

logarithmic

Typelv2:PortProperty
logarithmic scale

Indicates that port value behaviour within specified range (bounds) is a value using logarithmic scale. The lower and upper bounds must be specified, and must be of the same sign.

notAutomatic

Typelv2:PortProperty
not intended as a CV input

Indicates that the port is not primarily intended to be fed with modulation signals from external sources (other plugins, etc.). It is merely a UI hint and hosts may allow the user to override it.

notOnGUI

Typelv2:PortProperty
not on GUI

Indicates that the port is not primarily intended to be represented by a separate control in the user interface window (or any similar mechanism used for direct, immediate control of control ports). It is merely a UI hint and hosts may allow the user to override it.

supportsStrictBounds

Typelv2:Feature
supports strict bounds

Indicates use of host support for pprops:hasStrictBounds port property. A plugin that specifies it as optional feature can omit value clamping for hasStrictBounds ports, if the feature is supported by the host. When specified as required feature, it indicates that the plugin does not do any clamping for input ports that have a pprops:hasStrictBounds property.

trigger

Typelv2:PortProperty
trigger

Indicates that the data item corresponds to a momentary event that has been detected (control output ports) or is to be triggered (control input ports). For input ports, the port needs to be reset to lv2:default value after run() function of the plugin has returned. If the control port is assigned a GUI widget by the host, the widget should be of auto-off (momentary, one-shot) type - for example, a push button if the port is also declared as lv2:toggled, or a series of push button or auto-clear input box with a "Send" button if the port is also lv2:integer.

This extension defines a facility for plugins to get information about the block length (the sample_count parameter of LV2_Descriptor::run) and port buffer sizes, as well as several features which can be used to restrict the block length.

This extension defines features and properties but has no special purpose API of its own. The host provides all the relevant information to the plugin as options.

To require restrictions on the block length, plugins can require additional features: bufsz:boundedBlockLength, bufsz:powerOf2BlockLength, and bufsz:fixedBlockLength. These features are data-only, that is they merely indicate a restriction and do not carry any data or API.

Reference

PropertiesInstances

Properties

maxBlockLength

TypeDatatype Property
Rangexsd:nonNegativeInteger
maximum block length

The maximum block length the host will ever request the plugin to process at once, that is, the maximum sample_count parameter that will ever be passed to LV2_Descriptor::run().

minBlockLength

TypeDatatype Property
Rangexsd:nonNegativeInteger
minimum block length

The minimum block length the host will ever request the plugin to process at once, that is, the minimum sample_count parameter that will ever be passed to LV2_Descriptor::run().

nominalBlockLength

TypeDatatype Property
Rangexsd:nonNegativeInteger
nominal block length

The typical block length the host will request the plugin to process at once, that is, the typical sample_count parameter that will be passed to LV2_Descriptor::run(). This will usually be equivalent, or close to, the maximum block length, but there are no strong guarantees about this value whatsoever. Plugins may use this length for optimization purposes, but MUST NOT assume the host will always process blocks of this length. In particular, the host MAY process longer blocks.

sequenceSize

TypeDatatype Property
Rangexsd:nonNegativeInteger
sequence size

The maximum size of a sequence, in bytes. This should be provided as an option by hosts that support event ports (including but not limited to MIDI), so plugins have the ability to allocate auxiliary buffers large enough to copy the input.

Instances

boundedBlockLength

Typelv2:Feature

A feature that indicates the host will provide both the bufsz:minBlockLength and bufsz:maxBlockLength options to the plugin. Plugins that copy data from audio inputs can require this feature to ensure they know how much space is required for auxiliary buffers. Note the minimum may be zero, this feature is mainly useful to ensure a maximum is available.

All hosts SHOULD support this feature, since it is simple to support and necessary for any plugins that may need to copy the input.

coarseBlockLength

Typelv2:Feature
coarse block length

A feature that indicates the plugin prefers coarse, regular block lengths. For example, plugins that do not implement sample-accurate control use this feature to indicate that the host should not split the run cycle because controls have changed.

Note that this feature is merely a hint, and does not guarantee a fixed block length. The run cycle may be split for other reasons, and the blocksize itself may change anytime.

fixedBlockLength

Typelv2:Feature

A feature that indicates the host will always call LV2_Descriptor::run() with the same value for sample_count. This length MUST be provided as the value of both the bufsz:minBlockLength and bufsz:maxBlockLength options.

Note that requiring this feature may severely limit the number of hosts capable of running the plugin.

powerOf2BlockLength

Typelv2:Feature

A feature that indicates the host will always call LV2_Descriptor::run() with a power of two sample_count. Note that this feature does not guarantee the value is the same each call, to guarantee a fixed power of two block length plugins must require both this feature and bufsz:fixedBlockLength.

Note that requiring this feature may severely limit the number of hosts capable of running the plugin.

This extension defines a feature, rsz:resize, which allows plugins to dynamically resize their output port buffers.

In addition to the dynamic feature, there are properties which describe the space required for a particular port buffer which can be used statically in data files.

Reference

PropertiesInstances

Properties

asLargeAs

TypeDatatype Property
Domainlv2:Port
Rangelv2:Symbol
as large as

Indicates that a port requires at least as much buffer space as the port with the given symbol on the same plugin instance. This may be used for any ports, but is generally most useful to indicate an output port must be at least as large as some input port (because it will copy from it). If a port is asLargeAs several ports, it is asLargeAs the largest such port (not the sum of those ports' sizes).

The host guarantees that whenever an ObjectPort's run method is called, any output O that is obj:asLargeAs an input I is connected to a buffer large enough to copy I, or NULL if the port is lv2:connectionOptional.

minimumSize

TypeDatatype Property
Domainlv2:Port
Rangexsd:nonNegativeInteger
minimum size

Indicates that a port requires a buffer at least this large, in bytes. Any host that supports the resize-port feature MUST connect any port with a minimumSize specified to a buffer at least as large as the value given for this property. Any host, especially those that do NOT support dynamic port resizing, SHOULD do so or reduced functionality may result.

Instances

resize

Typelv2:Feature

A feature to resize output port buffers in LV2_Plugin_Descriptor::run().

To support this feature, the host must pass an LV2_Feature to the plugin's instantiate method with URI LV2_RESIZE_PORT__resize and a pointer to a LV2_Resize_Port_Resize structure. This structure provides a resize_port function which plugins may use to resize output port buffers as necessary.

Reference

ClassesPropertiesInstances

Classes

AmbisonicGroup

Subclass ofGroup

Ambisonic channel configurations. These groups are divided into channels which together represent a position in an abstract n-dimensional space. The position of sound in one of these groups does not depend on a particular speaker configuration; a decoder can be used to convert an ambisonic stream for any speaker configuration.

DiscreteGroup

Subclass ofGroup

Discrete channel configurations. These groups are divided into channels where each represents a particular speaker location. The position of sound in one of these groups depends on a particular speaker configuration.

Element

In range ofelement
Element

An element of a group, which has a designation and an optional index.

Restriction on lv2:designation
owl:cardinality 1
An element MUST have exactly one lv2:designation.

Group

In domain ofsubGroupOf
In range ofgroup
subGroupOf
Port Group

A set of ports/channels/controls/etc that are are logically grouped together, e.g. two audio ports in a group may form a stereo stream. In order to avoid the need to define large numbers of identical group definitions, a group definition may be shared. For example, a plugin collection may define a single URI for a pg:StereoGroup with the symbol "input" and use it in many plugins.

Restriction on lv2:symbol
owl:cardinality 1
A pg:Group MUST have exactly one string lv2:symbol. This symbol must be unique according to the same rules as the lv2:symbol for an lv2:Port, where group symbols and port symbols reside in the same namespace. In other words, a group on a plugin MUST NOT have the same symbol as another group or a port on that plugin. This makes it possible to uniquely reference a port or group on a plugin with a single identifier and no context.

InputGroup

Subclass ofGroup
In range ofmainInput
source
Input Group

A group which contains exclusively inputs.

OutputGroup

Subclass ofGroup
In domain ofsource
In range ofmainOutput
Output Group

A group which contains exclusively outputs.

Properties

element

TypeObject Property
RangeElement
element

Indicates that a group has a certain element (a parameter or channel designation with a possible index).

group

TypeObject Property
Domainlv2:Port
RangeGroup
group

Indicates that this port is a part of a group of ports on the plugin. The port should also have an lv2:designation property to define its designation within that group.

mainInput

TypeObject Property
Domainlv2:Plugin
RangeInputGroup
main input

Indicates that this group should be considered the "main" input, i.e. the primary task is processing the signal in this group. A plugin MUST NOT have more than one pg:mainInput property.

mainOutput

TypeObject Property
Domainlv2:Plugin
RangeOutputGroup
main output

Indicates that this group should be considered the "main" output. The main output group SHOULD have the main input group as a pg:source.

sideChainOf

TypeObject Property
side-chain of

Indicates that this port or group should be considered a "side chain" of some other port or group. The precise definition of "side chain" depends on the plugin, but in general this group should be considered a modifier to some other group, rather than an independent input itself.

source

TypeObject Property
DomainOutputGroup
RangeInputGroup
source

Indicates that this port or group should be considered the "result" of some other port or group. This property only makes sense on groups with outputs when the source is a group with inputs. This can be used to convey a relationship between corresponding input and output groups with different types, e.g. a mono->stereo plugin.

subGroupOf

TypeObject Property
DomainGroup
RangeGroup
sub-group of

Indicates that this group is a child of another group. This property has no meaning with respect to plugin execution, but the host may find this information useful (e.g. to provide a compact user interface). Note that being a sub-group does not relax the restriction that the group MUST have a unique symbol with respect to the plugin.

Instances

center

Typelv2:Channel
center

centerLeft

Typelv2:Channel
center left

centerRight

Typelv2:Channel
center right

left

Typelv2:Channel
left

lowFrequencyEffects

Typelv2:Channel
low-frequency effects

rearCenter

Typelv2:Channel
rear center

rearLeft

Typelv2:Channel
rear left

rearRight

Typelv2:Channel
rear right

side

Typelv2:Channel
side

sideLeft

Typelv2:Channel
side left

sideRight

Typelv2:Channel
side right

This extension defines two port types: morph:MorphPort, which has a host-configurable type, and morph:AutoMorphPort, which may automatically change type when a MorphPort's type is changed. These ports always have a default type and work normally work in hosts that are unaware of this extension. Thus, this extension provides a backwards compatibility mechanism which allows plugins to use new port types but gracefully fall back to a default type in hosts that do not support them.

This extension only defines port types and properties for describing morph ports. The actual run-time switching is done via the opts:interface API.

Reference

ClassesProperties

Classes

AutoMorphPort

Subclass oflv2:Port
Auto Morph Port

Ports of this type MUST have another type which defines the default buffer format (e.g. lv2:ControlPort) but may dynamically change types based on the configured types of any morph:MorphPort ports on the same plugin instance.

The type of a port may only change in response to a host call to LV2_Options_Interface::set(). Whenever any port type on the instance changes, the host MUST check the type of all morph:AutoMorphPort ports with LV2_Options_Interface::get() before calling run() again, since they may have changed. If the type of any port is zero, it means the current configuration is invalid and the plugin may not be run (unless that port is lv2:connectionOptional and connected to NULL).

This is mainly useful for outputs whose type depends on the type of corresponding inputs.

MorphPort

Subclass oflv2:Port
In domain ofcurrentType
supportsType
Morph Port

Ports of this type MUST have another type which defines the default buffer format (e.g. lv2:ControlPort) but can be dynamically changed to a different type in hosts that support opts:interface.

The host may change the type of a MorphPort by setting its morph:currentType with LV2_Options_Interface::set(). If the plugin has any morph:AutoMorphPort ports, the host MUST check their types after changing any port type since they may have changed.

Properties

currentType

TypeObject Property
DomainMorphPort
current type

The currently active type of the port. This is for dynamic use as an option and SHOULD NOT be listed in the static plugin data.

supportsType

TypeObject Property
DomainMorphPort
supports type

Indicates that a port supports being switched to a certain type. A MorphPort MUST list each type it supports being switched to in the plugin data using this property.

This extension defines a facility for options, which are dynamic properties that may be changed at run time.

There are two facilities for passing options to an instance: opts:options allows passing options at instantiation time, and the opts:interface interface allows options to be dynamically set and retrieved after instantiation.

Note that this extension is only for allowing hosts to configure plugins, and is not a live control mechanism. For real-time control, use event-based control via an atom:AtomPort with an atom:Sequence buffer.

Instances may indicate they require an option with the opts:requiredOption property, or that they optionally support an option with the opts:supportedOption property.

Reference

ClassesPropertiesInstances

Classes

Option

Subclass ofrdf:Property
Option

A property intended to be used as a static option for an instance.

It is not required for a property to explicitly be an Option in order to be used as such. However, properties which are primarily intended for use as options, or are at least particularly useful as options, should be explicitly given this type for documentation purposes, and to assist hosts in discovering option definitions.

Properties

requiredOption

TypeObject Property
Rangerdf:Property
required option

An option required by the instance to function at all. The host MUST pass a value for the specified option via opts:options in order to create an instance.

Note that use of this property may reduce the number of compatible hosts. Wherever possible, it is better to list options with opts:supportedOption and fall back to a reasonable default value if it is not provided.

supportedOption

TypeObject Property
Rangerdf:Property
supported option

An option supported or understood by the instance. The host SHOULD provide a value for the specified option if one is known, or provide the user an opportunity to specify one if one is Indicates that the instance host MUST pass a value for the specified option in order to instantiate the instance.

Instances

interface

Typelv2:ExtensionData

An interface (LV2_Options_Interface) for dynamically setting and getting options. Note this is intended for use by the host for configuring plugins only, and and is not a live plugin control mechanism.

The plugin data file should describe this like so:

@prefix opts: <http://lv2plug.in/ns/ext/options#> .

<plugin>
    a lv2:Plugin ;
    lv2:extensionData opts:interface .

options

Typelv2:Feature
options

The feature used to provide options to an instance.

To implement this feature, hosts MUST pass an LV2_Feature to the appropriate instantiate method with this URI and data pointed to an array of LV2_Options_Option terminated by an element with both key and value set to zero. The instance should cast this data pointer to const LV2_Options_Option* and scan the array for any options of interest. The instance MUST NOT modify the options array in any way.

Note that requiring this feature may reduce the number of compatible hosts. Unless some options are strictly required by the instance, this feature SHOULD be listed as a lv2:optionalFeature.

This vocabulary defines messages which can be used to access and manipulate properties. It is designed to provide a dynamic control interface for LV2 plugins, but is useful in many contexts.

The main feature of this design is that the messages themselves are described in the same format as the data they work with. In particular, messages can be serialised as a binary Object or in Turtle (or any other RDF serialisation).

The idea behind using a property-based interface for control is to prevent an an explosion of message types. Instead of a custom message for each action, control is achieved via manipulating properties (which are likely already defined for other reasons). Note, however, that this is purely conceptual; there is no requirement that the receiver actually implement a store of resources with properties.

For example, consider an object that can blink. Rather than define a specific interface to control this (e.g. obj.start_blinking(); obj.stop_blinking()), set a blinking property to true or false (e.g. obj.set(blinking, true)) to achieve the desired behaviour. One benefit of this approach is that a persistent state model is available for free: simply serialise the blinking property.

This specification is strictly metadata and does not define any binary mechanism, though it can be completely expressed by standard types in the LV2 Atom extension. Thus, hosts can be expected to be capable of transmitting it between plugins, or between a plugin and its UI, making it a good choice for advanced plugin control.

Reference

ClassesPropertiesInstances

Classes

Ack

Subclass ofResponse
Ack

An acknowledgement that a request has been successfully processed. This is returned as a reply when a specific reply type is not necessary or appropriate.

Copy

Subclass ofRequest
Copy

Copy the patch:subject to patch:destination. After this, patch:destination has the description patch:subject had prior to this request's execution, and patch:subject is unchanged. It is an error if the subject does not exist or the destination already exists. Multiple patch:subject properties may be given if the patch:destination is a container, the semantics of this use case are application defined.

Restriction on subject
owl:minCardinality 1
Restriction on destination
owl:cardinality 1

Delete

Subclass ofRequest
Delete

Request the subject(s) be deleted.

Error

Subclass ofResponse
Error

A response indicating an error processing a request.

Get

Subclass ofRequest
Get

Request a description of the subject.

The detail of the response is not specified, it may be a flat description of all the properties of the subject, or a more expressive description with several subjects. A good choice is a concise bounded description, i.e. a description which recursively includes all properties with blank node values.

The response should have the same patch:subject property as the request, and a patch:body that is a description of that subject. For example:

<get-request>
    a patch:Get ;
    patch:subject <something> .

Could result in:

[]
    a patch:Response ;
    patch:request <get-request> ;
    patch:subject <something> ;
    patch:body [
        eg:name "Something" ;
        eg:ratio 1.6180339887 ;
    ] .

Note the use of blank nodes is not required; the value of patch:body may be the actual resource node. Depending on the transport and syntax used this may be preferable. For example, the same response could be written:

<something>
    eg:name "Something" ;
    eg:ratio 1.6180339887 .

[]
    a patch:Response ;
    patch:request <get-request> ;
    patch:subject <something> ;
    patch:body <something> .

If the patch:subject property is absent, then the Get implicitly applies to the receiver.

Insert

Subclass ofRequest
Insert

Insert the patch:body at patch:subject. If the subject does not exist, it is created. If the subject does already exist, it is added to. This request only adds properties, it never removes them. The user must take care that multiple values are not set for properties which should only have one value.

Restriction on subject
owl:cardinality 1

Move

Subclass ofRequest
Move

Move the patch:subject to patch:destination. After this, patch:destination has the description patch:subject had prior to this request's execution, and patch:subject no longer exists. It is an error if the subject does not exist or the destination already exists.

Restriction on subject
owl:cardinality 1
Restriction on destination
owl:cardinality 1

Patch

Subclass ofRequest
Patch

Add and/or remove properties of the subject.

This method always has at least one patch:subject, and exactly one patch:add and patch:remove property. The value of patch:add and patch:remove are nodes which have the properties to add or remove from the subject(s), respectively. The special value patch:wildcard may be used as the value of a remove property to remove all properties with the given predicate. For example:

[]
    a patch:Patch ;
    patch:subject <something> ;
    patch:add [
        eg:name "New name" ;
        eg:age 42 ;
    ] ;
    patch:remove [
        eg:name "Old name" ;
        eg:age patch:wildcard ;  # Remove all old eg:age properties
    ] .
Restriction on subject
owl:minCardinality 1

Put

Subclass ofRequest
Put

Put the patch:body as the patch:subject. If the subject does not already exist, it is created. If the subject does already exist, the patch:body is considered an updated version of it, and the previous version is replaced.

[]
    a patch:Put ;
    patch:subject <something> ;
    patch:body [
        eg:name "New name" ;
        eg:age 42 ;
    ] .
Restriction on subject
owl:cardinality 1

Request

Subclass ofMessage
In domain ofaccept
In range ofrequest
Request

A request. A request may have a patch:subject property, which indicates which resource the request applies to. The subject may be omitted in contexts where it is implicit (e.g. the recipient is the subject).

Response

Subclass ofMessage
In domain ofrequest
Response

A response to a message.

Set

Subclass ofRequest
In domain ofproperty
value
Set

A compact message for setting one property to a specific value.

This is equivalent to a patch:Patch which removes all pre-existing values for the property before setting the new value. For example:

[]
    a patch:Set ;
    patch:subject <something> ;
    patch:property eg:name ;
    patch:value "New name" .

Which is equivalent to:

[]
    a patch:Patch ;
    patch:subject <something> ;
    patch:add [
        eg:name "New name" ;
    ] ;
    patch:remove [
        eg:name patch:wildcard ;
    ] .
Restriction on property
owl:cardinality 1
Restriction on value
owl:cardinality 1

Properties

accept

DomainRequest
Rangerdfs:Class
accept

An accepted type for a response.

add

TypeObject Property
DomainMessage

body

TypeObject Property
DomainMessage

The body of a message. The details of this property's value depend on the type of message it is a part of.

context

TypeObject Property
DomainMessage

The context of properties in this message. For example, a plugin may have a special context for ephemeral properties which are only relevant during the lifetime of the instance and should not be saved in state. The specific uses for contexts are application specific. However, the context MUST be a URI, and can be interpreted as the ID of a data model where properties should be stored. Implementations MAY have special support for contexts, for example by storing in a quad store or serializing to a format that supports multiple RDF graphs such as TriG.

destination

TypeObject Property
DomainMessage

property

DomainSet
Rangerdf:Property
property

The property for a Set message.

readable

Rangerdf:Property
readable

Indicates that the subject may have a property that can be read via a patch:Get message. See the similar property patch:writable for details.

remove

TypeObject Property
DomainMessage
remove

request

TypeObject Property
DomainResponse
RangeRequest
request

The request this is a response to. This can be used if referring directly to the URI or blank node ID of the request is possible. Otherwise, use patch:sequenceNumber.

sequenceNumber

TypeObject Property
DomainMessage
Rangexsd:int
sequence number

The sequence number of a request or response. This property is used to associate replies with requests when it is not feasible to refer to request URIs with patch:request. A patch:Response with a given sequence number is the reply to the previously send patch:Request with the same sequence number. The special sequence number 0 means no reply is desired.

subject

TypeObject Property
DomainMessage

The subject this message applies to.

value

DomainSet
Rangerdf:Property
value

The value of a property in a patch:Set message.

writable

Rangerdf:Property
writable

Indicates that subject may have a property that can be written via a patch message. This is used to list supported properties, e.g. so user interfaces can present appropriate controls. For example:

@prefix eg:   <http://example.org/> .
@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

eg:title
    a rdf:Property ;
    rdfs:label "title" ;
    rdfs:range xsd:string .

eg:plugin
    patch:writable eg:title .

Instances

wildcard

Typerdfs:Resource

A wildcard which matches any resource. This makes it possible to describe the removal of all values for a given property.

This vocabulary describes a format for presets (i.e. named sets of control values and possibly other state) for LV2 plugins. The structure of a pset:Preset is deliberately identical to that of an lv2:Plugin, and can be thought of as a plugin template or overlay.

Presets may be defined in any bundle, including the plugin's bundle, separate third party preset bundles, or user preset bundles saved by hosts. Since preset data tends to be large, it is recommended that plugins describe presets in a separate file(s) to avoid slowing down hosts. The manifest.ttl of a bundle containing presets should list the presets like so:

eg:mypreset
    a             pset:Preset ;
    lv2:appliesTo eg:myplugin ;
    rdfs:seeAlso  <mypreset.ttl> .

Reference

ClassesProperties

Classes

Bank

In range ofbank
Bank

A bank of presets.

Restriction on rdfs:label
owl:someValuesFrom xsd:string
A Bank MUST have at least one string rdfs:label.

Preset

Subclass oflv2:PluginBase
In domain ofbank
In range ofpreset
Preset

A Preset for an LV2 Plugin. The structure of a Preset deliberately mirrors that of a plugin, so existing predicates can be used to describe any data associated with the preset. For example:

@prefix eg: <http://example.org/> .

eg:mypreset
    a pset:Preset ;
    rdfs:label "One louder" ;
    lv2:appliesTo eg:myplugin ;
    lv2:port [
        lv2:symbol "volume1" ;
        pset:value 11.0
    ] , [
        lv2:symbol "volume2" ;
        pset:value 11.0
    ] .

A Preset SHOULD have at least one lv2:appliesTo property. Each Port on a Preset MUST have at least a lv2:symbol property and a pset:value property.

Hosts SHOULD save user presets to a bundle in the user-local LV2 directory (e.g. ~/.lv2) with a name like <Plugin_Name>_<Preset_Name>.preset.lv2 (e.g. LV2_Amp_At_Eleven.preset.lv2), where names are transformed to be valid LV2 symbols for maximum compatibility.

Restriction on rdfs:label
owl:someValuesFrom xsd:string
A Preset MUST have at least one string rdfs:label.

Properties

bank

DomainPreset
RangeBank
bank

The bank this preset belongs to.

preset

Domainlv2:PluginBase
RangePreset
preset

Specifies the preset currently applied to a plugin instance. This property may be useful for saving state, or notifying a plugin instance at run-time about a preset change.

value

Domainlv2:PortBase
value

Specifies the value of a Port on some Preset. This property is used in a similar way to e.g. lv2:default.

This extension defines a simple mechanism which allows hosts to save and restore a plugin instance's state. The goal is for an instance's state to be completely described by port values (as with all LV2 plugins) and a simple dictionary.

The state defined here is conceptually a key:value dictionary, with URI keys and values of any type. For performance reasons the key and value type are actually a URID, a URI mapped to an integer. A single key:value pair is called a property.

This state model is simple yet has many benefits:

  • Both fast and extensible thanks to URID keys.
  • No limitations on possible value types.
  • Easy to serialise in almost any format.
  • Easy to store in a typical map or dictionary data structure.
  • Elegantly described in Turtle, so state can be described in LV2 data files (including presets).
  • Does not impose any file formats, data structures, or file system requirements.
  • Suitable for portable persistent state as well as fast in-memory snapshots.
  • Keys may be well-defined and used meaningfully across several implementations.
  • State may be dynamic, but plugins are not required to have a dynamic dictionary data structure available.

To implement state, the plugin provides a state:interface to the host. To save or restore, the host calls LV2_State_Interface::save() or LV2_State_Interface::restore(), passing a callback to be used for handling a single property. The host is free to implement property storage and retrieval in any way.

Since value types are defined by URI, any type is possible. However, a set of standard types is defined by the LV2 Atom extension. Use of these types is recommended. Hosts MUST implement at least atom:String, which is simply a C string.

Referring to Files

Plugins may need to refer to existing files (e.g. loaded samples) in their state. This is done by storing the file's path as a property just like any other value. However, there are some rules which MUST be followed when storing paths, see state:mapPath for details. Plugins MUST use the type atom:Path for all paths in their state.

Plugins are strongly encouraged to avoid creating files, instead storing all state as properties. However, occasionally the ability to create files is necessary. To make this possible, the host can provide the feature state:makePath which allocates paths for plugin-created files. Plugins MUST NOT create files in any other locations.

Plugin Code Example

/* Namespace for this plugin's keys.  This SHOULD be something that could be
   published as a document, even if that document does not exist right now.
*/
#define NS_MY "http://example.org/myplugin/schema#"

#define DEFAULT_GREETING "Hello"

LV2_Handle
my_instantiate(...)
{
    MyPlugin* plugin = ...;
    plugin->uris.atom_String = map_uri(LV2_ATOM__String);
    plugin->uris.my_greeting = map_uri(NS_MY "greeting");
    plugin->state.greeting   = strdup(DEFAULT_GREETING);
    return plugin;
}

LV2_State_Status
my_save(LV2_Handle                 instance,
        LV2_State_Store_Function   store,
        LV2_State_Handle           handle,
        uint32_t                   flags,
        const LV2_Feature *const * features)
{
    MyPlugin*   plugin   = (MyPlugin*)instance;
    const char* greeting = plugin->state.greeting;

    store(handle,
          plugin->uris.my_greeting,
          greeting,
          strlen(greeting) + 1,  // Careful!  Need space for terminator
          plugin->uris.atom_String,
          LV2_STATE_IS_POD | LV2_STATE_IS_PORTABLE);

    return LV2_STATE_SUCCESS;
}

LV2_State_Status
my_restore(LV2_Handle                  instance,
           LV2_State_Retrieve_Function retrieve,
           LV2_State_Handle            handle,
           uint32_t                    flags,
           const LV2_Feature *const *  features)
{
    MyPlugin* plugin = (MyPlugin*)instance;

    size_t      size;
    uint32_t    type;
    uint32_t    flags;
    const char* greeting = retrieve(
        handle, plugin->uris.my_greeting, &size, &type, &flags);

    if (greeting) {
        free(plugin->state->greeting);
        plugin->state->greeting = strdup(greeting);
    } else {
        plugin->state->greeting = strdup(DEFAULT_GREETING);
    }

    return LV2_STATE_SUCCESS;
}

const void*
my_extension_data(const char* uri)
{
    static const LV2_State_Interface state_iface = { my_save, my_restore };
    if (!strcmp(uri, LV2_STATE__interface)) {
        return &state_iface;
    }
}

Host Code Example

LV2_State_Status
store_callback(LV2_State_Handle handle,
               uint32_t         key,
               const void*      value,
               size_t           size,
               uint32_t         type,
               uint32_t         flags)
{
    if ((flags & LV2_STATE_IS_POD)) {
        /* We only care about POD since we're keeping state in memory only.
           For disk or network use, LV2_STATE_IS_PORTABLE must also be checked.
        */
        Map* state_map = (Map*)handle;
        state_map->insert(key, Value(copy(value), size, type));
        return 0;
    } else {
        return 1; /* Non-POD events are unsupported. */
    }
}

Map
get_plugin_state(LV2_Handle instance)
{
    LV2_State* state = instance.extension_data(LV2_STATE__interface);
    Map state_map;
    /** Request a fast/native/POD save, since we're just copying in memory */
    state.save(instance, store_callback, &state_map,
               LV2_STATE_IS_POD|LV2_STATE_IS_NATIVE);
    return state_map;
}

Extensions to this Specification

It is likely that other interfaces for working with plugin state will be developed as needed. This is encouraged, however everything SHOULD work within the state model defined here. That is, do not complicate the state model. Implementations can assume the following:

  • The current port values and state dictionary completely describe a plugin instance, at least well enough that saving and restoring will yield an identical instance from the user's perspective.
  • Hosts are not expected to save and/or restore any other attributes of a plugin instance.

The Property Principle

The main benefit of this meaningful state model is that it can double as a plugin control/query mechanism. For plugins that require more advanced control than simple control ports, instead of defining a set of commands, define properties whose values can be set appropriately. This provides both a way to control and save that state for free, since there is no need to define commands and a set of properties for storing their effects. In particular, this is a good way for UIs to achieve more advanced control of plugins.

This property principle is summed up in the phrase: Don't stop; set playing to false.

This extension does not define a dynamic mechanism for state access and manipulation. The LV2 Patch extension defines a generic set of messages which can be used to access or manipulate properties, and the LV2 Atom extension defines a port type and data container capable of transmitting those messages.

Reference

ClassesPropertiesInstances

Classes

Changed

State changed

A notification that the internal state of the plugin has been changed in a way that the host can not otherwise know about.

This is a one-way notification, intended to be used as the type of an Object sent from plugins when necessary.

Plugins SHOULD emit such an event whenever a change has occurred that would result in a different state being saved, but not when the host explicity makes a change which it knows is likely to have that effect, such as changing a parameter.

State

In range ofstate
State

A state dictionary. This type should be used wherever instance state is described. The properties of a resource with this type correspond directly to the properties of the state dictionary (except the property that states it has this type).

Properties

state

RangeState
state

The state of this instance. This property may be used anywhere a state needs to be described, for example:

@prefix eg: <http://example.org/> .

<plugin-instance>
    state:state [
        eg:somekey "some value" ;
        eg:someotherkey "some other value" ;
        eg:favourite-number 2
    ] .

Instances

interface

Typelv2:ExtensionData

A structure (LV2_State_Interface) which contains functions to be called by the host to save and restore state. In order to support this extension, the plugin must return a valid LV2_State_Interface from LV2_Descriptor::extension_data() when it is called with URI LV2_STATE__interface.

The plugin data file should describe this like so:

@prefix state: <http://lv2plug.in/ns/ext/state#> .

<plugin>
    a lv2:Plugin ;
    lv2:extensionData state:interface .

loadDefaultState

Typelv2:Feature

This feature indicates that the plugin has default state listed with the state:state property which should be loaded by the host before running the plugin. Requiring this feature allows plugins to implement a single state loading mechanism which works for initialisation as well as restoration, without having to hard-code default state.

To support this feature, the host MUST restore the default state after instantiating the plugin but before calling run().

makePath

Typelv2:Feature
create new file paths

This feature allows plugins to create new files and/or directories. To support this feature the host passes an LV2_Feature with URI LV2_STATE__makePath and data pointed to an LV2_State_Make_Path to the plugin. The host may make this feature available only during save by passing it to LV2_State_Interface::save(), or available any time by passing it to LV2_Descriptor::instantiate(). If passed to LV2_State_Interface::save(), the feature MUST NOT be used beyond the scope of that call.

The plugin is guaranteed a hierarchical namespace unique to that plugin instance, and may expect the returned path to have the requested path as a suffix. There is one such namespace, even if the feature is passed to both LV2_Descriptor::instantiate() and LV2_State_Interface::save(). Beyond this, the plugin MUST NOT make any assumptions about the returned paths.

Like any other paths, the plugin MUST map these paths using state:mapPath before storing them in state. The plugin MUST NOT assume these paths will be available across a save/restore otherwise, i.e. only mapped paths saved to state are persistent, any other created paths are temporary.

For example, a plugin may create a file in a subdirectory like so:

char* save_myfile(LV2_State_Make_Path* make_path)
{
    char* path   = make_path->path(make_path->handle, "foo/bar/myfile.txt");
    FILE* myfile = fopen(path, 'w');
    fprintf(myfile, "I am some data");
    fclose(myfile);
    return path;
}

mapPath

Typelv2:Feature
map file paths

This feature maps absolute paths to/from abstract paths which are stored in state. To support this feature a host must pass an LV2_Feature with URI LV2_STATE__mapPath and data pointed to an LV2_State_Map_Path to the plugin's LV2_State_Interface methods.

The plugin MUST map all paths stored in its state (including those inside any files in its state). This is necessary to enable host to handle file system references correctly, e.g. for distribution or archival.

For example, a plugin may write a path to a state file like so:

void write_path(LV2_State_Map_Path* map_path, FILE* myfile, const char* path)
{
    char* abstract_path = map_path->abstract_path(map_path->handle, path);
    fprintf(myfile, "%s", abstract_path);
    free(abstract_path);
}

Then, later reload the path like so:

char* read_path(LV2_State_Map_Path* map_path, FILE* myfile)
{
    /* Obviously this is not production quality code! */
    char abstract_path[1024];
    fscanf(myfile, "%s", abstract_path);
    return map_path->absolute_path(map_path->handle, abstract_path);
}

threadSafeRestore

Typelv2:Feature
thread-safe restore

If a plugin supports this feature, its LV2_State_Interface::restore method is thread-safe and may be called concurrently with audio class functions.

To support this feature, the host MUST pass a work:schedule feature to the restore method, which will be used to complete the state restoration. The usual mechanics of the worker apply: the host will call the plugin's work method, which emits a response which is later applied in the audio thread.

The host is not required to block run() while restore() and work() load the state, so this feature allows state to be restored without dropouts.

The LV2 API, on its own, cannot be used to write plugin libraries where data is dynamically generated at runtime (e.g. API wrappers), since LV2 requires needed information to be provided in one or more static data (RDF) files. This API addresses this limitation by extending the LV2 API.

To detect that a plugin library implements a dynamic manifest generator, the host checks its static manifest for a description like:

<http://example.org/my-dynamic-manifest>
    a dman:DynManifest ;
    lv2:binary <mydynmanifest.so> .

To load the data, the host loads the library (e.g. mydynmanifest.so) as usual and fetches the dynamic Turtle data from it using this API.

The host is allowed to request regeneration of the dynamic manifest multiple times, and the plugin library is expected to provide updated data if/when possible. All data and references provided via this API before the last regeneration of the dynamic manifest is to be considered invalid by the host, including plugin descriptors whose URIs were discovered using this API.

Accessing Data

Whenever a host wants to access data using this API, it could:

  1. Call lv2_dyn_manifest_open().
  2. Create a FILE for functions to write data to (e.g. using tmpfile()).
  3. Get a list of exposed subject URIs using lv2_dyn_manifest_get_subjects().
  4. Call lv2_dyn_manifest_get_data() for each URI of interest to get the data related to that URI (which can be written to any FILE).
  5. Call lv2_dyn_manifest_close().
  6. Parse the content of the FILE(s).
  7. Free/delete/unlink the FILE(s).

Each call to the above mentioned dynamic manifest functions MUST write a complete, valid Turtle document (including all needed prefix definitions) to the output FILE.

Each call to lv2_dyn_manifest_open() causes the (re)generation of the dynamic manifest data, and invalidates all data fetched before the call.

In case the plugin library uses this same API to access other dynamic manifests, it MUST implement some mechanism to avoid potentially endless loops (such as A loads B, B loads A, etc.) and, in case such a loop is detected, the operation MUST fail. For this purpose, use of a static boolean flag is suggested.

Threading Rules

All of the functions defined by this specification belong to the Discovery class.

Reference

Classes

Classes

DynManifest

Dynamic Manifest

The class which represents a dynamic manifest generator. There MUST NOT be any instances of dman:DynManifest in the generated manifest. All relative URIs in the generated data MUST be relative to the base path that would be used to parse a normal LV2 manifest (the bundle path).

Restriction on lv2:binary
owl:minCardinality 1
A DynManifest MUST have at least 1 lv2:binary, which MUST implement all the functions defined in dynmanifest.h.

This vocabulary describes parameters common in audio processing software. A parameter is purely a metadata concept, unrelated to any particular code mechanism. Parameters are used to assign meaning to controls (e.g. using lv2:designation for ports) so they can be used more intelligently or presented to the user more efficiently.

Reference

ClassesInstances

Classes

ControlGroup

Subclass ofpg:Group

A group representing a set of associated controls.

Instances

amplitude

Typelv2:Parameter
amplitude

attack

Typelv2:Parameter
attack

The duration of an envelope's attack stage.

bypass

Typelv2:Parameter
bypass

A boolean parameter that disabled processing if true.

cutoffFrequency

Typelv2:Parameter
cutoff frequency

decay

Typelv2:Parameter
decay

The duration of an envelope's decay stage.

delay

Typelv2:Parameter
delay

The duration of an envelope's delay stage.

dryLevel

Typelv2:Parameter
dry level

The level of the unprocessed component of a signal.

frequency

Typelv2:Parameter
frequency

gain

Typelv2:Parameter
units:unit units:db
lv2:default 0.0
lv2:maximum 20.0
lv2:minimum -20.0
gain

Gain in decibels.

hold

Typelv2:Parameter
hold

The duration of an envelope's hold stage.

pulseWidth

Typelv2:Parameter
pulse width

The width of a pulse of a rectangular waveform.

ratio

Typelv2:Parameter
ratio

Compression ratio.

release

Typelv2:Parameter
release

The duration of an envelope's release stage.

resonance

Typelv2:Parameter
resonance

The resonance of a filter.

sampleRate

Typelv2:Parameter
sample rate

A sample rate in Hz.

sustain

Typelv2:Parameter
sustain

The level (not duration) of an envelope's sustain stage.

threshold

Typelv2:Parameter
threshold

Compression threshold.

waveform

Typelv2:Parameter
waveform

wetDryRatio

Typelv2:Parameter
wet/dry ratio

The ratio between processed and bypass components in output signal. The dry and wet percentages can be calculated from the following equations:

    dry = (wetDryRatio.maximum - wetDryRatio.value) / wetDryRatio.maximum
    wet = wetDryRatio.value / wetDryRatio.maximum

Typically, maximum value of 1 or 100 and minimum value of 0 should be used.

wetLevel

Typelv2:Parameter
wet level

The level of the processed component of a signal.

This extension is used to create User Interfaces (UIs) for LV2 plugins.

UIs are implemented as an LV2UI_Descriptor loaded via lv2ui_descriptor() in a shared library, and are distributed in bundles just like plugins. See the API reference for details on the C API.

UIs are associated with plugins in data:

@prefix ui: <http://lv2plug.in/ns/extensions/ui#> .

<http://my.plugin>   ui:ui     <http://my.pluginui> .
<http://my.pluginui> a         ui:GtkUI ;
                     ui:binary <myui.so> .

where <http://my.plugin> is the URI of the plugin, <http://my.pluginui> is the URI of the plugin UI and <myui.so> is the relative URI to the shared object file.

While it is possible to have the plugin UI and the plugin in the same shared object file it is probably a good idea to keep them separate so that hosts that don't want UIs don't have to load the UI code. A UI MUST specify its class in the RDF data (ui:GtkUI in the above example). The class defines what type the UI is, e.g. what graphics toolkit it uses. Any type of UI class can be defined separately from this extension.

It is possible to have multiple UIs for the same plugin, or to have the UI for a plugin in a different bundle from the actual plugin - this way people other than the plugin author can write plugin UIs independently without editing the original plugin bundle.

Note that the process that loads the shared object file containing the UI code and the process that loads the shared object file containing the actual plugin implementation are not necessarily the same process (and not even necessarily on the same machine). This means that plugin and UI code MUST NOT use singletons and global variables and expect them to refer to the same objects in the UI and the actual plugin. The function callback interface defined in this header is the only method of communication between UIs and plugin instances (extensions may define more, though this is discouraged unless absolutely necessary since the significant benefits of network transparency and serialisability are lost).

UI functionality may be extended via features, much like plugins:

<http://my.pluginui> lv2:requiredFeature <http://my.feature> .
<http://my.pluginui> lv2:optionalFeature <http://my.feature> .

The rules for a UI with a required or optional feature are identical to those of lv2:Plugin instances: if a UI declares a feature as required, the host is NOT allowed to load it unless it supports that feature; and if it does support a feature, it MUST pass an appropriate LV2_Feature struct to the UI's instantiate() method. This extension defines several standard features for common functionality.

UIs written to this specification do not need to be thread-safe. All functions may only be called in the UI thread. There is only one UI thread (for toolkits, the one the UI main loop runs in). There is no requirement that a UI actually be a graphical widget.

Note that UIs are completely separate from plugins. From the plugin's perspective, control from a UI is indistinguishable from any other control, as it all occcurs via ports.

Reference

ClassesPropertiesInstances

Classes

CocoaUI

Subclass ofUI
Cocoa UI

A UI where the LV2_Widget is a pointer to a NSView, the basic view type for the Cocoa API (formerly OpenStep). This is the native UI type on Mac OS X.

Gtk3UI

Subclass ofUI
GTK3 UI

A UI where the LV2_Widget is a pointer to a Gtk+ 3.0 compatible GtkWidget, and the host guarantees that the Gtk+ library has been initialised and the Glib main loop is running before a UI of this type is instantiated.

GtkUI

Subclass ofUI
GTK2 UI

A UI where the LV2_Widget is a pointer to a Gtk+ 2.0 compatible GtkWidget, and the host guarantees that the Gtk+ library has been initialised and the Glib main loop is running before a UI of this type is instantiated.

PortNotification

In domain ofnotifyType
plugin
portIndex
protocol
In range ofportNotification

A port notification. This describes which ports the host must send notifications to the UI about. The port can be specific by index, using the ui:portIndex property, or symbol, using the lv2:symbol property. Since port indices are not guaranteed to be stable between different revisions (or even instantiations) of a plugin, symbol is recommended, and index may only be used by UIs shipped in the same bundle as the plugin.

A ui:PortNotification MUST have either a ui:portIndex or a lv2:symbol to indicate which port it refers to.

Restriction on plugin
owl:cardinality 1
A PortNotification MUST have exactly one ui:plugin.

PortProtocol

Subclass oflv2:Feature
In range ofprotocol
Port Protocol

A PortProtocol defines a method to communicate port data between a UI and plugin.

Any PortProtocol MUST define:

Port Type Which plugin port types the buffer type is valid for.
Feature Data What data (if any) should be passed in the LV2_Feature.

Any PortProtocol for an output port MUST define:

Update Frequency When the host should call port_event().
Update Format The format of the data in the buffer passed to port_event().
Options The format of the options passed to subscribe() and unsubscribe().

Any PortProtocol for an input port MUST define:

Write Format The format of the data in the buffer passed to write_port().
Write Effect What happens when the UI calls write_port().

For an example, see ui:floatProtocol or ui:peakProtocol.

PortProtocol is a subclass of lv2:Feature, so UIs use lv2:optionalFeature and lv2:requiredFeature to specify which PortProtocols they want to use.

Qt4UI

Subclass ofUI
Qt4 UI

A UI where the LV2_Widget is a pointer to a Qt4 compatible QWidget, and the host guarantees that the Qt4 library has been initialised and the Qt4 main loop is running before a UI of this type is instantiated.

Qt5UI

Subclass ofUI
Qt5 UI

A UI where the LV2_Widget is a pointer to a Qt5 compatible QWidget, and the host guarantees that the Qt5 library has been initialised and the Qt5 main loop is running before a UI of this type is instantiated.

UI

In domain ofportNotification
In range ofui
User Interface

A UI for an LV2 plugin

WindowsUI

Subclass ofUI
Windows UI

A UI where the LV2_Widget is a Windows HWND window ID. Note this is actually an unsigned 32-bit integer, i.e. the LV2_Widget is not a pointer to a HWND but should be interpreted as an HWND itself. This is the native UI type on Microsoft Windows.

X11UI

Subclass ofUI
X11 UI

A UI where the LV2_Widget is an X11 window ID. Note this is actually an integer, i.e. the LV2_Widget is not a pointer to an X11 window ID, but should be itself taken as an integer value. This is the native UI type on most POSIX systems.

Properties

binary

owl:deprecated true
owl:sameAs lv2:binary
binary
Deprecated

The shared library a UI resides in. This property is redundant, new UIs SHOULD use lv2:binary, however hosts MUST still support ui:binary at this time.

notifyType

DomainPortNotification
notify type

Indicates a particular type that the UI should be notified of. In the case of ports where several types of data can be present (e.g. event ports), this can be used to indicate that only a particular type of data should cause notification. This is useful where port traffic is very dense, but only a certain small number of events are actually of interest to the UI.

plugin

TypeObject Property
DomainPortNotification
Rangelv2:Plugin
plugin

The plugin a portNotification applies to.

portIndex

TypeDatatype Property
DomainPortNotification
Rangexsd:decimal
port index

The index of the port a portNotification applies to.

portNotification

TypeObject Property
DomainUI
RangePortNotification
port notification

Indicates that a UI should receive notification (via LV2UI_Descriptor::port_event()) when a particular port's value changes.

For example:

protocol

DomainPortNotification
RangePortProtocol
protocol

The protocol to be used for this notification.

ui

Domainlv2:Plugin
RangeUI
user interface

Relates a plugin to a UI that applies to it.

updateRate

Rangexsd:float
update rate

The target rate, in Hz, to send updates to the UI.

windowTitle

Rangexsd:string
window title

The title for the window shown by LV2UI_Show_Interface.

Instances

fixedSize

Typelv2:Feature

If a UI requires this feature it indicates the same thing as ui:noUserResize, and additionally it means that the UI will not resize the main widget on its own - it will always remain the same size (e.g. a pixmap based GUI). This feature may not make sense for all UI types. The data pointer for the LV2_Feature for this feature should always be set to NULL.

floatProtocol

TypePortProtocol
floating point value

A protocol for transferring single floating point values. The rules for this protocol are:

Port Type lv2:ControlPort
Feature Data None.
Update Frequency The host SHOULD call port_event() as soon as possible when the port value has changed, but there are no timing guarantees.
Update Format A single float.
Options None.
Write Format A single float.
Write Effect The host SHOULD set the port to the received value as soon as possible, but there is no guarantee that run() actually sees this value.

idleInterface

Typelv2:ExtensionData
lv2:Feature

A feature that provides a callback for the host to call rapidly to drive the UI. To support this feature, the UI should list it as a lv2:optionalFeature or lv2:requiredFeature in its data, and also as lv2:extensionData. When the UI's extension_data() is called with this URI (LV2_UI__idleInterface), it should return a pointer to an LV2UI_Idle_Interface.

To indicate support, the host should pass a feature to instantiate() with this URI, with NULL for data.

makeSONameResident

Typelv2:Feature
owl:deprecated true
Deprecated

DEPRECATED

This feature was intended to support UIs that link against toolkit libraries which may not be unloaded during the lifetime of the host. This is better achieved by using the appropriate flags when linking the UI, e.g. gcc -Wl,-z,nodelete.

noUserResize

Typelv2:Feature

If a UI requires this feature it indicates that it does not make sense to let the user resize the main widget, and the host should prevent that. This feature may not make sense for all UI types. The data pointer for the LV2_Feature for this feature should always be set to NULL.

parent

Typelv2:Feature

The parent for the UI.

This feature can be used to pass a parent (e.g. a widget, container, canvas, etc.) the UI should be a child of. The format of data pointer of this feature is determined by the UI type, and is generally the same type as the LV2_Widget the UI would return (e.g. for a GtkUI the data would be a pointer to a GtkWidget which is a GtkContainer). This is particularly useful for cross-toolkit embedding, where the parent often must be known at construction time for embedding to work correctly. UIs should not require this feature unless it is absolutely necessary for them to work at all.

peakProtocol

TypePortProtocol
peak measurement for a period of audio

This port protocol defines a way for the host to send continuous peak measurements of the audio signal at a certain port to the UI. The intended use is visualisation, e.g. an animated meter widget that shows the level of the audio input or output.

A contiguous sequence of audio samples for which a peak value has been computed is called a measurement period.

The rules for this protocol are:

Port Type lv2:AudioPort
Feature Data None.
Update Frequency The host SHOULD call port_event() at regular intervals. The measurement periods used for calls to port_event() for the same port SHOULD be contiguous (i.e. the measurement period for one call should begin right after the end of the measurement period for the previous call ends) unless the UI has removed and re-added the port subscription between those calls. However, UIs MUST NOT depend on either the regularity of the calls or the contiguity of the measurement periods; hosts may change the call rate or skip calls for performance or other reasons. Measurement periods for different calls to port_event() for the same port MUST NOT overlap.
Update Format A single LV2UI_Peak_Data object.
Options None.
Write Format None.
Write Effect None.

portMap

Typelv2:Feature

A feature for accessing the index of a port by symbol. This makes it possible to implement and distribute UIs separately from the plugin binaries they control. This feature corresponds to the LV2UI_Port_Index struct, which should be passed with the URI LV2_UI__portIndex.

portSubscribe

Typelv2:Feature

A feature for dynamically subscribing to updates from a port. This makes it possible for a UI to explicitly request a particular style of update from a port at run-time, in a more flexible and powerful way than listing subscriptions statically allows. This feature corresponds to the LV2UI_Port_Subscribe struct, which should be passed with the URI LV2_UI__portSubscribe.

resize

Typelv2:ExtensionData
lv2:Feature

A feature that allows the UI to notify the host about its current size, or request a size change. This feature corresponds to the LV2UI_Resize struct, which should be passed with the URI LV2_UI__resize. This struct may also be provided by the UI as extension data using the same URI, in which case it is used by the host to request that the UI change its size.

showInterface

Typelv2:ExtensionData

An interface for showing and hiding a window for a UI. This allows UIs to gracefully degrade to separate windows when the host is unable to embed the UI widget for whatever reason. When the UI's extension_data() is called with this URI (LV2_UI__showInterface), it should return a pointer to an LV2UI_Show_Interface.

touch

Typelv2:Feature

A feature to notify the host that the user has grabbed a particular port control. This is useful for automation, so the host can allow the user to take control of a port, even if that port would otherwise be automated (much like grabbing a physical morotised fader). It can also be used for MIDI learn or in any other situation where the host needs to do something with a particular control and it would be convenient for the user to select it directly from the plugin UI. This feature corresponds to the LV2UI_Touch struct, which should be passed with the URI LV2_UI__touch.

This extension defines a feature, log:log, which allows plugins to print log messages with an API much like the standard C printf functions. This allows, for example, plugin logs to be nicely presented to the user in a graphical user interface.

Different log levels (e.g. error or information) are defined by URI and passed as an LV2_URID. This document defines the typical levels which should be sufficient, but implementations may define and use additional levels to suit their needs.

Reference

ClassesInstances

Classes

Entry

Log Entry

A log entry. Subclasses of this class can be passed to LV2_Log_Log methods to describe the nature of the log message.

Error

Subclass ofEntry
Error

An error message.

Note

Subclass ofEntry
Note

An informative message.

Trace

Subclass ofEntry
Trace

A debugging trace. These entries should not be displayed during normal operation, but the host may implement an option to display them for debugging purposes.

This entry type is special in that it may be written to in a real-time thread. It is assumed that if debug tracing is enabled, real-time considerations are not a concern.

Warning

Subclass ofEntry
Warning

A warning message.

Instances

log

Typelv2:Feature

A feature which plugins may use to log messages. To support this feature, the host must pass an LV2_Feature to LV2_Descriptor::instantiate() with URI LV2_LOG__log and data pointed to an instance of LV2_Log_Log.

This extension allows plugins to schedule work that must be performed in another thread. Plugins can use this interface to safely perform work that is not real-time safe, and receive the result in the run context. The details of threading are managed by the host, allowing plugins to be simple and portable while using resources more efficiently.

This interface is designed to gracefully support single-threaded synchronous execution, which allows the same code to work with sample accuracy for offline rendering. For example, a sampler plugin may schedule a sample to be loaded from disk in another thread. During live execution, the host will call the plugin's work method from another thread, and deliver the result to the audio thread when it is finished. However, during offline export, the scheduled load would be executed immediately in the same thread. This enables reproducible offline rendering, where any changes affect the output immediately regardless of how long the work takes to execute.

Reference

Instances

Instances

interface

Typelv2:ExtensionData

The work interface provided by a plugin, LV2_Worker_Interface.

@prefix work: <http://lv2plug.in/ns/ext/worker#> .

<plugin>
    a lv2:Plugin ;
    lv2:extensionData work:interface .

schedule

Typelv2:Feature

The work scheduling feature provided by a host, LV2_Worker_Schedule.

If the host passes this feature to LV2_Descriptor::instantiate, the plugin MAY use it to schedule work in the audio thread, and MUST NOT call it in any other context. Hosts MAY pass this feature to other functions as well, in which case the plugin MAY use it to schedule work in the calling context. The plugin MUST NOT assume any relationship between different schedule features.