[LV2] [PATCH] units:midiController

Hanspeter Portner ventosus at airpost.net
Tue Apr 5 00:38:19 PDT 2016

Hi list

Ports/parameters describing a MIDI controller number seem to be quite commonly used in MIDI filter plugins.
Hosts however cannot know better as to provide the user with integer sliders/knobs/whathever in automatic UIs.
This is quite suboptimal for users, at least I don't know the controllers by heart.

Here a tiny patch which adds units:midiController. The idea here is that hosts can actually show the
MIDI controller name (e.g. 'Volume MSB') instead of the plain number on automatic UIs, analogously to what
some hosts already do for units:midiNote (e.g. they show the note name, not it's number).
Hosts dealing with MIDI likely will have a lookup table for MIDI controller names already.

The only alternative for plugin authors to have their MIDI controller ports be shown with proper names
in a given host right now is with lv2:enumeration and a gazillion of lv2:scalePoints, quite tedious indeed.

The following changes since commit 4f597a80888eb6a448ee29c0777e99c87fa2eba4:

  Add missing property labels (2015-12-31 14:38:49 -0500)

are available in the git repository at:

  https://github.com/ventosus/lv2.git units_midiController

for you to fetch changes up to a3bdd7b4bd13b816f6c92183ca7715416f969b77:

  Add units:midiController (2016-04-05 09:01:51 +0200)

Hanspeter Portner (1):
      Add units:midiController

 lv2/lv2plug.in/ns/extensions/units/units.h   | 1 +
 lv2/lv2plug.in/ns/extensions/units/units.ttl | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/lv2/lv2plug.in/ns/extensions/units/units.h b/lv2/lv2plug.in/ns/extensions/units/units.h
index e61af2a..e5825bc 100644
--- a/lv2/lv2plug.in/ns/extensions/units/units.h
+++ b/lv2/lv2plug.in/ns/extensions/units/units.h
@@ -48,6 +48,7 @@
 #define LV2_UNITS__m                LV2_UNITS_PREFIX "m"
 #define LV2_UNITS__mhz              LV2_UNITS_PREFIX "mhz"
 #define LV2_UNITS__midiNote         LV2_UNITS_PREFIX "midiNote"
+#define LV2_UNITS__midiController   LV2_UNITS_PREFIX "midiController"
 #define LV2_UNITS__mile             LV2_UNITS_PREFIX "mile"
 #define LV2_UNITS__min              LV2_UNITS_PREFIX "min"
 #define LV2_UNITS__mm               LV2_UNITS_PREFIX "mm"
diff --git a/lv2/lv2plug.in/ns/extensions/units/units.ttl b/lv2/lv2plug.in/ns/extensions/units/units.ttl
index d023c56..3d67299 100644
--- a/lv2/lv2plug.in/ns/extensions/units/units.ttl
+++ b/lv2/lv2plug.in/ns/extensions/units/units.ttl
@@ -395,3 +395,9 @@ units:midiNote
 	rdfs:label "MIDI note" ;
 	units:render "MIDI note %d" ;
 	units:symbol "note" .
+	a units:Unit ;
+	rdfs:label "MIDI controller" ;
+	units:render "MIDI controller %d" ;
+	units:symbol "controller" .

More information about the Devel mailing list