midi2control – LV2-Plugin to map MIDI-Controller to ControlPort

Important Note: This code is outdated. It does not compile against recent versions of LV2. Do not use it.

Purpose: an LV2 „ConverterPlugin“ to map MIDI controller events to LV2 plugin control parameter values.

WARNING: DO NOT let this plugin operate on physical parameters such as amplitude without prior verifying a SANE VALUE RANGE for „out“ using „min“ and „max“. For example, it is unwise to let a 0..300 out operate on the „gain“ (dB) input of an amplifier. This can cause SERIOUS DAMAGE to your equipment.

The plugin has one MIDI event input port „midi“ that can be connected to an event output or an event input port of the LV2 host.

It has a control input „ctl“ defining the number of the MIDI controller controlling the plugin. It can assume an integer value between 0 and 127.

It has two control inputs, „min“ and „max“ defining the actual  minimum and maximum value of the single control output „out“ (as opposed to its initial range stated in its manifest).

If the plugin receives a 7-Bit controller value on „midi“ by the controller with number „ctl“ it linearly sets „out“ to a value between „min“ and „max“ according to the controller value.

Restrictions: Generally interpreting Byte 3 of the MIDI controller change message as unsigned 7-Bit value is not correct in terms of MIDI 1.0, since not all controllers operate that way. Special behavior like „Effect Control 1/2“ or „Bank Select LSB“ are not supported.

 

Checkout sources:

git clone https://gitlab.tk-sls.de/old/midi2control.git

Browse sources: https://gitlab.tk-sls.de/old/midi2control/tree/master