[LV2] lv2:relation
David Robillard
d at drobilla.net
Mon Feb 27 14:12:00 PST 2012
Hi all,
Someone has a need to make special-purpose ports along the lines of the
special latency port. I think there is a problem with using
PortProperty for this, though: it requires you to define a specific
lv2:PortProperty for any such thing. This is a problem if you also need
a normal property. The best example is BPM. To describe BPM in general
(e.g. in the Turtle file, in an Atom, wherever) you would need an e.g.
time:beatsPerMinute property. You can't re-use this as an
lv2:PortProperty though, so you'd have to define *two* things for every
such property.
This sucks. Better is to be able to relate ports to a property which
their value represents. In addition to solving the above problem, this
provides a graceful migration to "parameters" (i.e. dynamic control not
via control ports), and better integration with messages.
Since we've unfortunately overloaded "property", I'm calling this the
port's "relation". I propose adding the following to lv2core:
## Begin lv2core.ttl snippet ##
lv2:relation a rdf:Property , owl:ObjectProperty ;
rdfs:domain lv2:Port ;
rdfs:label "relation" ;
lv2:documentation """
<p>Indicates the relation the value of a port represents. The value of
this property must the URI of some relation (i.e. a predicate).</p>
<p>For example, if a port has lv2:relation foo:volume, then the value
of that port represents the foo:volume of the plugin instance. This is
used to make control ports meaningful and compatible with other methods
of control and/or state representation.</p>
<p>Plugins SHOULD NOT have several ports with the same lv2:relation.</p>
""" .
####################################
## Generic Properties (Relations) ##
####################################
lv2:latency a rdf:Property ,
rdfs:label "latency" ;
lv2:documentation """
<p>The latency introduced by the plugin (or similar), in frames.</p>
""".
lv2:freeWheeling a rdf:Property ,
rdfs:label "free-wheeling" ;
rdfs:range xsd:boolean ;
lv2:documentation """
<p>Whether or not processing is currently free-wheeling. If true, this
means that all processing is happening as quickly as possible, not in
real-time. When free-wheeling there is no relationship between the
passage of real wall-clock time and the passage of time in the data
being processed (e.g. audio frames).</p>
""" .
## End lv2core.ttl snippet ##
This way, when any extension (e.g. the time extension) or an existing
non-LV2-specific vocabulary, defines a property, a plugin can directly
say that a control port represents that property.
I have added lv2:latency to allow this mechanism to be used
consistently, even though we have another mechanism for this.
Eventually I will probably suggest deprecating lv2:reportsLatency.
-dr
More information about the Devel
mailing list