From 725d4a404b838da6b67d9da66228a1125bddef57 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 20 Nov 2011 23:08:57 +0000 Subject: Lay out repository structure to match include and URI structure. Treat lv2core like all the other specifications in gendoc.py. --- ns/extensions/units/ext.pc.in | 1 + ns/extensions/units/manifest.ttl | 9 + ns/extensions/units/units.ttl | 346 +++++++++++++++++++++++++++++++++++++++ ns/extensions/units/waf | 1 + ns/extensions/units/wscript | 1 + 5 files changed, 358 insertions(+) create mode 120000 ns/extensions/units/ext.pc.in create mode 100644 ns/extensions/units/manifest.ttl create mode 100644 ns/extensions/units/units.ttl create mode 120000 ns/extensions/units/waf create mode 120000 ns/extensions/units/wscript (limited to 'ns/extensions/units') diff --git a/ns/extensions/units/ext.pc.in b/ns/extensions/units/ext.pc.in new file mode 120000 index 0000000..1cdad2a --- /dev/null +++ b/ns/extensions/units/ext.pc.in @@ -0,0 +1 @@ +../../../ext.pc.in \ No newline at end of file diff --git a/ns/extensions/units/manifest.ttl b/ns/extensions/units/manifest.ttl new file mode 100644 index 0000000..2c41838 --- /dev/null +++ b/ns/extensions/units/manifest.ttl @@ -0,0 +1,9 @@ +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Specification ; + lv2:minorVersion 5 ; + lv2:microVersion 2 ; + rdfs:seeAlso . + diff --git a/ns/extensions/units/units.ttl b/ns/extensions/units/units.ttl new file mode 100644 index 0000000..ccd5cf4 --- /dev/null +++ b/ns/extensions/units/units.ttl @@ -0,0 +1,346 @@ +# LV2 Units Extension +# Copyright 2009-2011 David Robillard +# Copyright 2007 Steve Harris +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +@prefix units: . +@prefix lv2: . +@prefix rdf: . +@prefix rdfs: . +@prefix doap: . +@prefix foaf: . + + + a lv2:Specification ; + doap:name "LV2 Units" ; + doap:shortdesc "Units for LV2 values." ; + doap:created "2007-02-06" ; + doap:homepage ; + doap:license ; + doap:release [ + doap:revision "5.2" ; + doap:created "2011-08-21" + ] ; + doap:maintainer [ + a foaf:Person ; + rdfs:seeAlso ; + foaf:homepage ; + foaf:mbox_sha1sum "44bc4fed584a2d1ac8fc55206db67656165d67fd" ; + foaf:name "Steve Harris" + ], [ + a foaf:Person ; + rdfs:seeAlso ; + foaf:homepage ; + foaf:name "David Robillard" + ] ; + lv2:documentation """ +

This extension 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 :   <http://lv2plug.in/ns/extensions/units#> .
+@prefix eg: <http://example.org/> .
+
+eg:plugin 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:

+
+eg:plugin lv2:port [
+    a            lv2:ControlRateInputPort ;
+    lv2:datatype lv2:Float ;
+    lv2:index    0 ;
+    lv2:symbol   "frob" ;
+    lv2:name     "frob level" ;
+    units:unit [
+        a            units:Unit ;
+        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).
+
+""" . + +units:Unit a rdfs:Class ; + rdfs:comment "A unit for LV2 port data" . + +units:unit + a rdf:Property ; + rdfs:domain lv2:Port ; + rdfs:range units:Unit ; + rdfs:comment "Relates a port to the unit of its data" . + +units:s a units:Unit ; + units:conversion [ + units:factor 0.0166666666 ; + units:to units:min + ] ; + units:name "second" ; + units:prefixConversion [ + units:factor 1000 ; + units:to units:ms + ] ; + units:render "%f s" ; + units:symbol "s" . + +units:ms a units:Unit ; + units:name "millisecond" ; + units:prefixConversion [ + units:factor 0.001 ; + units:to units:s + ] ; + units:render "%f ms" ; + units:symbol "ms" . + +units:min a units:Unit ; + units:conversion [ + units:factor 60.0 ; + units:to units:s + ] ; + units:name "minute" ; + units:render "%f mins" ; + units:symbol "min" . + +units:bar a units:Unit ; + units:name "bar" ; + units:render "%f bars" ; + units:symbol "bars" . + +units:beat a units:Unit ; + units:name "beat" ; + units:render "%f beats" ; + units:symbol "beats" . + +units:m a units:Unit ; + units:conversion [ + units:factor 39.37 ; + units:to units:inch + ] ; + units:name "metre" ; + units:prefixConversion [ + units:factor 100 ; + units:to units:cm + ], [ + units:factor 1000 ; + units:to units:mm + ], [ + units:factor 0.001 ; + units:to units:km + ] ; + units:render "%f m" ; + units:symbol "m" . + +units:cm a units:Unit ; + units:conversion [ + units:factor 0.3937 ; + units:to units:inch + ] ; + units:name "centimetre" ; + units:prefixConversion [ + units:factor 0.01 ; + units:to units:m + ], [ + units:factor 10 ; + units:to units:mm + ], [ + units:factor 0.00001 ; + units:to units:km + ] ; + units:render "%f cm" ; + units:symbol "cm" . + +units:mm a units:Unit ; + units:conversion [ + units:factor 0.03937 ; + units:to units:inch + ] ; + units:name "millimetre" ; + units:prefixConversion [ + units:factor 0.001 ; + units:to units:m + ], [ + units:factor 0.1 ; + units:to units:cm + ], [ + units:factor 0.000001 ; + units:to units:km + ] ; + units:render "%f mm" ; + units:symbol "mm" . + +units:km a units:Unit ; + units:conversion [ + units:factor 0.62138818 ; + units:to units:mile + ] ; + units:name "kilometre" ; + units:prefixConversion [ + units:factor 1000 ; + units:to units:m + ], [ + units:factor 100000 ; + units:to units:cm + ], [ + units:factor 1000000 ; + units:to units:mm + ] ; + units:render "%f km" ; + units:symbol "km" . + +units:inch a units:Unit ; + units:conversion [ + units:factor 2.54 ; + units:to units:cm + ] ; + units:name "inch" ; + units:render "%f\"" ; + units:symbol "in" . + +units:mile a units:Unit ; + units:conversion [ + units:factor 1.6093 ; + units:to units:km + ] ; + units:name "mile" ; + units:render "%f mi" ; + units:symbol "mi" . + +units:db a units:Unit ; + units:name "decibel" ; + units:render "%f dB" ; + units:symbol "dB" . + +units:pc a units:Unit ; + units:conversion [ + units:factor 0.01 ; + units:to units:coef + ] ; + units:name "percent" ; + units:render "%f%%" ; + units:symbol "%" . + +units:coef a units:Unit ; + units:conversion [ + units:factor 100 ; + units:to units:pc + ] ; + units:name "coefficient" ; + units:render "* %f" ; + units:symbol "" . + +units:hz a units:Unit ; + units:name "hertz" ; + units:prefixConversion [ + units:factor 0.001 ; + units:to units:khz + ], [ + units:factor 0.000001 ; + units:to units:mhz + ] ; + units:render "%f Hz" ; + units:symbol "Hz" . + +units:khz a units:Unit ; + units:name "kilohertz" ; + units:prefixConversion [ + units:factor 1000 ; + units:to units:hz + ], [ + units:factor 0.001 ; + units:to units:mhz + ] ; + units:render "%f kHz" ; + units:symbol "kHz" . + +units:mhz a units:Unit ; + units:name "megahertz" ; + units:prefixConversion [ + units:factor 1000000 ; + units:to units:hz + ], [ + units:factor 0.001 ; + units:to units:khz + ] ; + units:render "%f MHz" ; + units:symbol "MHz" . + +units:bpm a units:Unit ; + units:name "beats per minute" ; + units:prefixConversion [ + units:factor 0.0166666666 ; + units:to units:hz + ] ; + units:render "%f BPM" ; + units:symbol "BPM" . + +units:oct a units:Unit ; + units:conversion [ + units:factor 12.0 ; + units:to units:semitone12TET + ] ; + units:name "octaves" ; + units:render "%f octaves" ; + units:symbol "oct" . + +units:cent a units:Unit ; + units:conversion [ + units:factor 0.01 ; + units:to units:semitone12TET + ] ; + units:name "cent" ; + units:render "%f ct" ; + units:symbol "ct" . + +units:semitone12TET a units:Unit ; + units:conversion [ + units:factor 0.083333333 ; + units:to units:oct + ] ; + units:name "semitone" ; + units:render "%f semi" ; + units:symbol "semi" . + +units:degree a units:Unit ; + units:name "degree" ; + units:render "%f deg" ; + units:symbol "deg" . + +units:midiNote a units:Unit ; + units:name "MIDI note" ; + units:render "MIDI note %d" ; + units:symbol "note" . diff --git a/ns/extensions/units/waf b/ns/extensions/units/waf new file mode 120000 index 0000000..917d5c5 --- /dev/null +++ b/ns/extensions/units/waf @@ -0,0 +1 @@ +../../../waf \ No newline at end of file diff --git a/ns/extensions/units/wscript b/ns/extensions/units/wscript new file mode 120000 index 0000000..cf8cbae --- /dev/null +++ b/ns/extensions/units/wscript @@ -0,0 +1 @@ +../../../ext.wscript \ No newline at end of file -- cgit v1.2.1