units
type: Ontology
imports: lv2core
documentation: 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.

Unit
type: Class
comment: A unit for LV2 port data

unit
type: Property
type: ObjectProperty
domain: Port
domain: Parameter
range: Unit
comment: Relates a port to the unit of its data

render
type: Property
type: DatatypeProperty
domain: Unit
range: string
comment: A printf format string for rendering a value (eg. "%f dB").

symbol
type: Property
type: DatatypeProperty
domain: Unit
range: string
comment: The abbreviated symbol for the unit (e.g. dB).

Conversion
type: Class
subclass of: Restriction
  on property: conversion target
  cardinality: 1
  comment: A conversion MUST have exactly 1 units:to property.
comment: A conversion from one unit to another.

conversion
type: Property
type: ObjectProperty
domain: Unit
range: Conversion
comment: A conversion from this unit to another.

prefix conversion
type: Property
type: ObjectProperty
sub property of: conversion
domain: Unit
range: Conversion
comment: A conversion from this unit to the same unit but with a different SI prefix (e.g. Hz to kHz).

conversion target
type: Property
type: ObjectProperty
domain: Conversion
range: Unit
comment: The target unit this conversion converts to.

conversion factor
type: Property
type: DatatypeProperty
domain: Conversion
comment: The factor to multiple the source value by in order to convert to the target unit.

seconds
type: Unit
conversion:
  conversion factor: 0.0166666666
  conversion target: minutes
prefix conversion:
  conversion factor: 1000
  conversion target: milliseconds
render: %f s
symbol: s

milliseconds
type: Unit
prefix conversion:
  conversion factor: 0.001
  conversion target: seconds
render: %f ms
symbol: ms

minutes
type: Unit
conversion:
  conversion factor: 60.0
  conversion target: seconds
render: %f mins
symbol: min

bars
type: Unit
render: %f bars
symbol: bars

beats
type: Unit
render: %f beats
symbol: beats

audio frames
type: Unit
render: %f frames
symbol: frames

metres
type: Unit
conversion:
  conversion factor: 39.37
  conversion target: inches
prefix conversion:
  conversion factor: 100
  conversion target: centimetres
prefix conversion:
  conversion factor: 1000
  conversion target: millimetres
prefix conversion:
  conversion factor: 0.001
  conversion target: kilometres
render: %f m
symbol: m

centimetres
type: Unit
conversion:
  conversion factor: 0.3937
  conversion target: inches
prefix conversion:
  conversion factor: 0.01
  conversion target: metres
prefix conversion:
  conversion factor: 10
  conversion target: millimetres
prefix conversion:
  conversion factor: 0.00001
  conversion target: kilometres
render: %f cm
symbol: cm

millimetres
type: Unit
conversion:
  conversion factor: 0.03937
  conversion target: inches
prefix conversion:
  conversion factor: 0.001
  conversion target: metres
prefix conversion:
  conversion factor: 0.1
  conversion target: centimetres
prefix conversion:
  conversion factor: 0.000001
  conversion target: kilometres
render: %f mm
symbol: mm

kilometres
type: Unit
conversion:
  conversion factor: 0.62138818
  conversion target: miles
prefix conversion:
  conversion factor: 1000
  conversion target: metres
prefix conversion:
  conversion factor: 100000
  conversion target: centimetres
prefix conversion:
  conversion factor: 1000000
  conversion target: millimetres
render: %f km
symbol: km

inches
type: Unit
conversion:
  conversion factor: 2.54
  conversion target: centimetres
render: %f"
symbol: in

miles
type: Unit
conversion:
  conversion factor: 1.6093
  conversion target: kilometres
render: %f mi
symbol: mi

decibels
type: Unit
render: %f dB
symbol: dB

percent
type: Unit
conversion:
  conversion factor: 0.01
  conversion target: coefficient
render: %f%%
symbol: %

coefficient
type: Unit
conversion:
  conversion factor: 100
  conversion target: percent
render: * %f

hertz
type: Unit
prefix conversion:
  conversion factor: 0.001
  conversion target: kilohertz
prefix conversion:
  conversion factor: 0.000001
  conversion target: megahertz
render: %f Hz
symbol: Hz

kilohertz
type: Unit
prefix conversion:
  conversion factor: 1000
  conversion target: hertz
prefix conversion:
  conversion factor: 0.001
  conversion target: megahertz
render: %f kHz
symbol: kHz

megahertz
type: Unit
prefix conversion:
  conversion factor: 1000000
  conversion target: hertz
prefix conversion:
  conversion factor: 0.001
  conversion target: kilohertz
render: %f MHz
symbol: MHz

beats per minute
type: Unit
prefix conversion:
  conversion factor: 0.0166666666
  conversion target: hertz
render: %f BPM
symbol: BPM

octaves
type: Unit
conversion:
  conversion factor: 12.0
  conversion target: semitones
render: %f octaves
symbol: oct

cents
type: Unit
conversion:
  conversion factor: 0.01
  conversion target: semitones
render: %f ct
symbol: ct

semitones
type: Unit
conversion:
  conversion factor: 0.083333333
  conversion target: octaves
render: %f semi
symbol: semi

degrees
type: Unit
render: %f deg
symbol: deg

MIDI note
type: Unit
render: MIDI note %d
symbol: note