units
type: Specification
created: 2007-02-06
release:
  revision: 5.2
  created: 2011-05-26
maintainer: Steve Harris
maintainer: David Robillard
name: LV2 Units extension
documentation: This extension defines a number of units for use in audio processing. For example, to say that the port use the gain unit defined as units:db (decibels): @prefix : <http://lv2plug.in/ns/extensions/units#> . lv2:port [ a lv2:ControlRateInputPort ; lv2:datatype lv2:Float ; lv2:index 0 ; lv2:symbol "gain" ; lv2:name "gain" ; :unit :db ] Using the same form, plugins may also specify one-off units inline, to give better display hints to hosts: lv2:port [ a lv2:ControlRateInputPort ; lv2:datatype lv2:Float ; lv2:index 0 ; lv2:symbol "frob" ; lv2:name "frob level" ; units:unit [ a units:NonSIUnit ; units:name "frobnication" ; units:symbol "fr" ; units:render "%f f" ] ] Units are defined by a number of properties: units:name A display name for the unit (eg. decibels) units:symbol The abbreviated symbol for the unit (eg. dB) units:render A printf(3) string to be used to render the numerical value (eg. "%f dB") units:conversion Defines a conversion into another unit, commonly the SI unit for the unit class (eg. units:conversion [ units:to units:m ; units:factor 1000 ]). conversions are expressed as either factors (multiplicand for the conversion) or offsets (addend for the conversion).

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

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

http://lv2plug.in/ns/extensions/units#s
type: Unit
conversion:
  factor: 0.0166666666
  to: min
name: second
prefix conversion:
  factor: 1000
  to: ms
render: %f s
symbol: s

ms
type: Unit
name: millisecond
prefix conversion:
  factor: 0.001
  to: http://lv2plug.in/ns/extensions/units#s
render: %f ms
symbol: ms

min
type: Unit
conversion:
  factor: 60.0
  to: http://lv2plug.in/ns/extensions/units#s
name: minute
render: %f mins
symbol: min

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

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

http://lv2plug.in/ns/extensions/units#m
type: Unit
conversion:
  factor: 39.37
  to: inch
name: metre
prefix conversion:
  factor: 100
  to: cm
prefix conversion:
  factor: 1000
  to: mm
prefix conversion:
  factor: 0.001
  to: km
render: %f m
symbol: m

cm
type: Unit
conversion:
  factor: 0.3937
  to: inch
name: centimetre
prefix conversion:
  factor: 0.01
  to: http://lv2plug.in/ns/extensions/units#m
prefix conversion:
  factor: 10
  to: mm
prefix conversion:
  factor: 0.00001
  to: km
render: %f cm
symbol: cm

mm
type: Unit
conversion:
  factor: 0.03937
  to: inch
name: millimetre
prefix conversion:
  factor: 0.001
  to: http://lv2plug.in/ns/extensions/units#m
prefix conversion:
  factor: 0.1
  to: cm
prefix conversion:
  factor: 0.000001
  to: km
render: %f mm
symbol: mm

km
type: Unit
conversion:
  factor: 0.62138818
  to: mile
name: kilometre
prefix conversion:
  factor: 1000
  to: http://lv2plug.in/ns/extensions/units#m
prefix conversion:
  factor: 100000
  to: cm
prefix conversion:
  factor: 1000000
  to: mm
render: %f km
symbol: km

inch
type: Unit
conversion:
  factor: 2.54
  to: cm
name: inch
render: %f"
symbol: in

mile
type: Unit
conversion:
  factor: 1.6093
  to: km
name: mile
render: %f mi
symbol: mi

db
type: Unit
name: decibel
render: %f dB
symbol: dB

pc
type: Unit
conversion:
  factor: 0.01
  to: coef
name: percent
render: %f%%
symbol: %

coef
type: Unit
conversion:
  factor: 100
  to: pc
name: coefficient
render: * %f

hz
type: Unit
name: hertz
prefix conversion:
  factor: 0.001
  to: khz
prefix conversion:
  factor: 0.000001
  to: mhz
render: %f Hz
symbol: Hz

khz
type: Unit
name: kilohertz
prefix conversion:
  factor: 1000
  to: hz
prefix conversion:
  factor: 0.001
  to: mhz
render: %f kHz
symbol: kHz

mhz
type: Unit
name: megahertz
prefix conversion:
  factor: 1000000
  to: hz
prefix conversion:
  factor: 0.001
  to: khz
render: %f MHz
symbol: MHz

bpm
type: Unit
name: beats per minute
prefix conversion:
  factor: 0.0166666666
  to: hz
render: %f BPM
symbol: BPM

oct
type: Unit
conversion:
  factor: 12.0
  to: semitone12TET
name: octaves
render: %f octaves
symbol: oct

cent
type: Unit
conversion:
  factor: 0.01
  to: semitone12TET
name: cent
render: %f ct
symbol: ct

semitone12TET
type: Unit
conversion:
  factor: 0.083333333
  to: oct
name: semitone
render: %f semi
symbol: semi

degree
type: Unit
name: degree
render: %f deg
symbol: deg

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