An LV2 Resource (e.g. plugin, specification, or any other LV2 related thing)
An LV2 specification (i.e. this specification, or an LV2 extension). Specification data, like plugin data, is distributed in standardized bundles so hosts may discover all present LV2 data. See http://lv2plug.in/docs for more details.
Overview LV2 gives programmers the ability to write audio processors (or plugins) in C/C++ which can be dynamically loaded into a range of applications (or hosts). This specification is deliberately as short and simple as possible, but is designed so that extensions can be defined to add more advanced features. The shared library portion of the API includes only what must necessarily be written in code. The information required to use a plugin is in a companion data file, written in Turtle. Plugin libraries do not contain enough information to make use of the plugin possible; the data file is mandatory. This makes using, adding, and manipulating plugin data flexible and avoids binary compatibility issues. Plugins can operate on any type of data, which is input/output via ports. Data is processed by first connecting each port to a buffer, then repeatedly calling a plugin's run() method to process a block of data of some host-specified length (measured in audio frames). This core specification defines two types of port, equivalent to those in LADSPA: control and audio. Audio data is communicated using arrays with one float element per sample, allowing a block of audio to be processed by the plugin in a single call to run(). Control data is communicated using 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). Plugins reside in shared object files suitable for dynamic linking (e.g. via dlopen()). This library provides one or more plugin descriptors via the lv2_descriptor() function. These plugins can be instantiated to create plugin instances, which can be run directly on data or connected together to perform advanced signal processing tasks. Threading Rules Certain hosts may need to call the functions provided by a plugin from multiple threads. For this to be safe, the plugin must be written so that those functions can be executed simultaneously without problems. To facilitate this, the functions provided by a plugin are divided into classes: Discovery Class lv2_descriptor(), LV2_Descriptor::extension_data() Instantiation Class LV2_Descriptor::instantiate(), LV2_Descriptor::cleanup(), LV2_Descriptor::activate(), LV2_Descriptor::deactivate() Audio Class LV2_Descriptor::run(), LV2_Descriptor::connect_port() 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 plugin functions MUST declare in which of these classes the functions belong, or define new classes for them. Extensions which add new host-provided functions MUST declare from which of these classes the functions may be called, or otherwise precisely describe their threading rules. 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.
An abstract plugin-like resource that may not actually be an LV2 plugin (e.g. may not actually have a plugin binary). A Template is a Resource that may have ports, and otherwise mimic the structure of a plugin. This should be subclassed by extensions that define such things.
A Plugin MUST have at least one rdf:type that is lv2:Plugin.
A Plugin MUST have at least one doap:name that is a string with no language tag.
The class which represents an 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.
A Port MUST have at least one rdf:type property that is one of lv2:Port, lv2:InputPort, or lv2:OutputPort.
A Port MUST have at least two rdf:type properties that are some subclass of lv2:Port (one for lv2:Port, lv2:InputPort, or lv2:OutputPort, and another to describe the specific data type, e.g. lv2:AudioPort).
A port MUST have a single lv2:index which is of type xsd:nonNegativeInteger (e.g. a non-negative integer literal in Turtle). The actual RDF datatype of the index MAY be xsd:integer (which is what a generic Turtle parser will do), but the value itself MUST be non-negative.
A port MUST have a single lv2:symbol which is of type xsd:string with no language tag.
A port MUST have at least one lv2:name which is of type xsd:string.
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).
Ports of this type will be connected to a pointer to some value, which will be read by the plugin during their run method.
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.
Ports of this type will be connected to a pointer to a single value of C type float.
Ports of this type will be connected to an array of length sample_count with elements of C type float.
Relates a Template or Plugin to the Ports it contains
The minor version of an LV2 Resource. This property is used (along with lv2:microVersion) by hosts to distinguish different versions of a compatible resource, e.g. to load only the bundle with the most recent version. The version of an LV2 resource is composed of two fields: minor version, and micro version. These have 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 concept of a major version: all versions of an LV2 resource with a given URI are by definition backwards compatible. More precisely: replacing a resource with a newer version of that resource MUST NOT break anything. If a change is made which breaks this rule, the URI of the resource MUST be changed. In contexts where a full (e.g. SemVer conformant) version number is required, the major version of all released LV2 resources is 1. Plugins and extensions MUST adhere to 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 specific version of a plugin has a lv2:symbol and a set of rdf:types; all future versions of that plugin are guaranteed to have a port with the same lv2:symbol and at least those rdf:types. New types may be added only if doing so does not break compatibility, i.e. if old hosts will continue to work correctly with the new plugin. 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 an extension MUST be compatible in the sense that an implementation of the new version can interoperate with an implementation of any previous version. (Note these rules are not necessarily exhaustive) 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 indicates that the resource is a possibly unstable development version. Hosts and tools SHOULD clearly indicate this wherever appropriate. Several versions of a resource with an odd version may exist; i.e. it is acceptable to work on a development version of a resource (e.g. in source control) without worrying about version numbers as long as either the minor or micro version is odd. This property describes half of a resource version. See also lv2:minorVersion, the property which describes the other half.
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.
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() 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.
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.
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 a 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.
Specifies the index of the port, passed as an argument to the connect port function. The index uniqely identifies the port on an instance of the plugin.
A short name used as a machine and human readable identifier. The first character must be one of _, a-z or A-Z and subsequenct characters can be from _, a-z, A-Z and 0-9. A language tag MUST NOT be used on this property. The symbol uniquely identifies the port on a plugin with a given URI (i.e. the plugin author MUST change the plugin URI if a port symbol is changed or removed).
A display name for labeling the Port in a user interface. 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.
Used to describe interesting values in a Port's range. To be valid it requires two properties: rdfs:label and rdf:value. There are 3 specially defined Points in the LV2 specification (default, minimum, and maximum), though future extensions may define more.
A single float Point (for control inputs).
The default value that the host SHOULD set this port to when there is no other information available.
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.
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.
An additional feature which a plugin or other resource may use or require.
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.
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).
A port property - a useful piece of information that allows a host to make more sensible decisions (e.g. to provide a better interface).
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.
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).
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.
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: The plugin MUST NOT use malloc(), free() or other heap memory management functions within its Audio class functions. 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. 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. 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().
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.
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).
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.
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.
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.
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).
Any plugin that generates sound internally, rather than processing its input.
Any plugin that is intended to be played as a musical instrument.
Includes things like mathematical functions and non-musical delays.
Any plugin that converts some form of input into a different form of output.
Any plugin that analyses input to output some useful information.
A plugin which mixes some number of inputs into some number of outputs.
Plugins that aim to duplicate the effect of some environmental effect or musical equipment.
Plugins that intentionally delay their input signal as an effect.
Plugins that manipulate the position of audio in space (e.g. panning, stereo width, surround encoding, etc.).
Plugins that alter the spectral properties (e.g. frequency) of audio.
Plugins that alter the envelope or dynamic range of audio.