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 (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.

Index

ClassesPropertiesInstances

Classes

Conversion

Class
LabelConversion
In domain offactor
to
In range ofconversion
prefixConversion

A conversion from one unit to another.

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

Unit

Class
LabelUnit
In domain ofconversion
prefixConversion
render
symbol
In range ofto
unit

A unit for LV2 port data

Properties

conversion

Property
Labelconversion
DomainUnit
RangeConversion
TypeObject Property

A conversion from this unit to another.

factor

Property
Labelconversion factor
DomainConversion
TypeDatatype Property

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

prefixConversion

Property
Labelprefix conversion
Sub-property ofconversion
DomainUnit
RangeConversion
TypeObject Property

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

render

Property
Labelunit format string
DomainUnit
Rangexsd:string
TypeDatatype Property

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

symbol

Property
Labelunit symbol
DomainUnit
Rangexsd:string
TypeDatatype Property

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

to

Property
Labelconversion target
DomainConversion
RangeUnit
TypeObject Property

The target unit this conversion converts to.

unit

Property
Labelunit
RangeUnit
TypeObject Property

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

Instances

bar

Instance
TypeUnit
render %f bars
symbol bars

beat

Instance
TypeUnit
render %f beats
symbol beats

bpm

Instance
TypeUnit
prefixConversion
factor 0.0166666666
to hz
render %f BPM
symbol BPM

cent

Instance

coef

Instance

db

Instance
TypeUnit
render %f dB
symbol dB

degree

Instance
TypeUnit
render %f deg
symbol deg

frame

Instance
TypeUnit
render %f frames
symbol frames

hz

Instance

inch

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

mhz

Instance

midiNote

Instance
TypeUnit
render MIDI note %d
symbol note

mile

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

min

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

ms

Instance

oct

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

pc

Instance

s

Instance

semitone12TET

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

History

Version 5.12 (2019-02-03)
  • Fix outdated port description in documentation.
  • Remove overly restrictive domain from units:unit.
Version 5.10 (2015-04-07)
  • Fix non-existent port type in examples.
  • Add lv2:Parameter to domain of units:unit.
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 unit for audio frames.
  • Add header of URI defines.
  • Merge with unified LV2 package.
Version 5.4 (2011-11-21)
  • Make units.ttl a valid OWL 2 DL ontology.
  • Define used but undefined resources (units:name, units:render, units:symbol, units:Conversion, units:conversion, units:prefixConversion, units:to, and units:factor).
  • Update packaging.
  • 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.
  • Improve documentation.
  • Initial release.
  • Define used but undefined resources (units:name, units:render, units:symbol, units:Conversion, units:conversion, units:prefixConversion, units:to, and units:factor).