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:datatype lv2:Float ;
    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:datatype lv2:Float ;
    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.

Index

ClassesPropertiesInstancesFiles

Reference

Class units:Conversion

Conversion

A conversion from one unit to another.

Restriction on units:to
owl:cardinality 1
A conversion MUST have exactly 1 units:to property.
In domain ofunits:to
units:factor
In range ofunits:conversion
units:prefixConversion

Class units:Unit

Unit

A unit for LV2 port data

In domain ofunits:conversion
units:render
units:prefixConversion
units:symbol
In range ofunits:unit
units:to

Property units:conversion

conversion

A conversion from this unit to another.

OWL TypeObject Property
Domainunits:Unit
Rangeunits:Conversion

Property units:factor

conversion factor

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

OWL TypeDatatype Property
Domainunits:Conversion

Property units:prefixConversion

prefix conversion

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

OWL TypeObject Property
Sub-property ofunits:conversion
Domainunits:Unit
Rangeunits:Conversion

Property units:render

unit format string

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

OWL TypeDatatype Property
Domainunits:Unit
Rangexsd:string

Property units:symbol

unit symbol

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

OWL TypeDatatype Property
Domainunits:Unit
Rangexsd:string

Property units:to

conversion target

The target unit this conversion converts to.

OWL TypeObject Property
Domainunits:Conversion
Rangeunits:Unit

Property units:unit

unit

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

OWL TypeObject Property
Domainlv2:Port
lv2:Parameter
Rangeunits:Unit

Instance units:bar

bars
Typeunits:Unit
units:render %f bars
units:symbol bars

Instance units:beat

beats
Typeunits:Unit
units:symbol beats
units:render %f beats

Instance units:bpm

Instance units:cent

Instance units:cm

Instance units:coef

Instance units:db

decibels
Typeunits:Unit
units:symbol dB
units:render %f dB

Instance units:degree

degrees
Typeunits:Unit
units:symbol deg
units:render %f deg

Instance units:frame

audio frames
Typeunits:Unit
units:symbol frames
units:render %f frames

Instance units:hz

Instance units:inch

Instance units:khz

Instance units:km

Instance units:m

Instance units:mhz

Instance units:midiNote

MIDI note
Typeunits:Unit
units:render MIDI note %d
units:symbol note

Instance units:mile

Instance units:min

Instance units:mm

Instance units:ms

Instance units:oct

Instance units:pc

Instance units:s

Instance units:semitone12TET

History

Version 5.10 (2015-04-07)
  • Add lv2:Parameter to domain of units:unit.
  • Fix non-existent port type in examples.
Version 5.8 (2012-10-14)
  • Remove units:name in favour of rdfs:label.
  • Use consistent label style.
Version 5.6 (2012-04-17)
  • Add header of URI defines.
  • Merge with unified LV2 package.
  • Add unit for audio frames.
Version 5.4 (2011-11-21)
  • Make units.ttl a valid OWL 2 DL ontology.
  • Update packaging.
  • Define used but undefined resources (units:name, units:render, units:symbol, units:Conversion, units:conversion, units:prefixConversion, units:to, and units:factor).
  • Improve documentation.
Version 5.2 (2010-10-05)
  • Add build system (for installation).
  • Convert documentation to HTML and use lv2:documentation.
Version 5.0 (2010-10-05)
  • Update packaging.
  • Define used but undefined resources (units:name, units:render, units:symbol, units:Conversion, units:conversion, units:prefixConversion, units:to, and units:factor).
  • Improve documentation.
  • Initial release.