PedalPi - PluginsManager - Model - Lv2

Lv2EffectBuilder

class pluginsmanager.model.lv2.lv2_effect_builder.Lv2EffectBuilder(plugins_json=None, ignore_unsupported_plugins=True)[source]

Generates lv2 audio plugins instance (as Lv2Effect object).

Note

In the current implementation, the data plugins are persisted in plugins.json.

Parameters:
  • plugins_json (Path) – Plugins json path file
  • ignore_unsupported_plugins (bool) – Not allows instantiation of uninstalled or unrecognized audio plugins?
__init__(plugins_json=None, ignore_unsupported_plugins=True)[source]

Initialize self. See help(type(self)) for accurate signature.

build(lv2_uri)[source]

Returns a new Lv2Effect by the valid lv2_uri

Parameters:lv2_uri (string) –
Return Lv2Effect:
 Effect created
lv2_plugins_data()[source]

Generates a file with all plugins data info. It uses the lilvlib library.

PluginsManager can manage lv2 audio plugins through previously obtained metadata from the lv2 audio plugins descriptor files.

To speed up usage, data has been pre-generated and loaded into this piped packet. This avoids a dependency installation in order to obtain the metadata.

However, this measure makes it not possible to manage audio plugins that were not included in the list.

To work around this problem, this method - using the lilvlib library - can get the information from the audio plugins. You can use this data to generate a file containing the settings:

>>> builder = Lv2EffectBuilder()
>>> plugins_data = builder.lv2_plugins_data()

>>> import json
>>> with open('plugins.json', 'w') as outfile:
>>>     json.dump(plugins_data, outfile)

The next time you instantiate this class, you can pass the configuration file:

>>> builder = Lv2EffectBuilder(os.path.abspath('plugins.json'))

Or, if you want to load the data without having to create a new instance of this class:

>>> builder.reload(builder.lv2_plugins_data())

Warning

To use this method, it is necessary that the system has the lilv in a version equal to or greater than 0.22.0. Many linux systems currently have previous versions on their package lists, so you need to compile them manually.

In order to ease the work, Pedal Pi has compiled lilv for some versions of linux. You can get the list of .deb packages in https://github.com/PedalPi/lilvlib/releases.

# Example
wget https://github.com/PedalPi/lilvlib/releases/download/v1.0.0/python3-lilv_0.22.1.git20160613_amd64.deb
sudo dpkg -i python3-lilv_0.22.1+git20160613_amd64.deb

If the architecture of your computer is not contemplated, moddevices provided a script to generate the package. Go to https://github.com/moddevices/lilvlib to get the script in its most up-to-date version.

Return list:lv2 audio plugins metadata
plugins_json_file = '/home/docs/checkouts/readthedocs.org/user_builds/pedalpi-pluginsmanager/checkouts/latest/pluginsmanager/model/lv2/plugins.json'

Informs the path of the plugins.json file. This file contains the lv2 plugins metadata info

reload(metadata, ignore_unsupported_plugins=True)[source]

Loads the metadata. They will be used so that it is possible to generate lv2 audio plugins.

Parameters:
  • metadata (list) – lv2 audio plugins metadata
  • ignore_unsupported_plugins (bool) – Not allows instantiation of uninstalled or unrecognized audio plugins?

Lv2Effect

class pluginsmanager.model.lv2.lv2_effect.Lv2Effect(plugin)[source]

Representation of a Lv2 audio plugin instance.

For general effect use, see Effect class documentation.

It’s possible obtains the Lv2Plugin information:

>>> reverb
<Lv2Effect object as 'Calf Reverb'  active at 0x7f60effb09e8>
>>> reverb.plugin
<Lv2Plugin object as Calf Reverb at 0x7f60effb9940>
Parameters:plugin (Lv2Plugin) –
__init__(plugin)[source]

Initialize self. See help(type(self)) for accurate signature.

__repr__()[source]

Return repr(self).

__str__()[source]

Return str(self).

version
Return string:Version of plugin of effect

Lv2Input

class pluginsmanager.model.lv2.lv2_input.Lv2Input(effect, data)[source]

Representation of a Lv2 input audio port instance.

For general input use, see Input class documentation.

Parameters:
  • effect (Lv2Effect) – Effect that contains the input
  • data (dict) – input audio port json representation
__init__(effect, data)[source]

Initialize self. See help(type(self)) for accurate signature.

data
Return dict:Metadata used for provide the required information

in this object

Lv2Output

class pluginsmanager.model.lv2.lv2_output.Lv2Output(effect, data)[source]

Representation of a Lv2 output audio port instance.

For general input use, see Output class documentation.

Parameters:
  • effect (Lv2Effect) – Effect that contains the output
  • data (dict) – output audio port json representation
__init__(effect, data)[source]

Initialize self. See help(type(self)) for accurate signature.

data
Return dict:Metadata used for provide the required information

in this object

Lv2Param

class pluginsmanager.model.lv2.lv2_param.Lv2Param(effect, data)[source]

Representation of a Lv2 input control port instance.

For general input use, see Param class documentation.

Parameters:
  • effect (Lv2Effect) – Effect that contains the param
  • data (dict) – input control port json representation
__init__(effect, data)[source]

Initialize self. See help(type(self)) for accurate signature.

maximum
Returns:Greater value that the parameter can assume
minimum
Returns:Smaller value that the parameter can assume
symbol
Returns:Param identifier

Lv2Plugin

class pluginsmanager.model.lv2.lv2_plugin.Lv2Plugin(json)[source]
__getitem__(key)[source]
Parameters:key (string) – Property key
Returns:Returns a Plugin property
__init__(json)[source]

Initialize self. See help(type(self)) for accurate signature.

__repr__()[source]

Return repr(self).

__str__()[source]

Return str(self).

data
Returns:Json decodable representation of this plugin based in moddevices lilvlib.
json
Returns:Json decodable representation of this plugin based in moddevices lilvlib.