Skip to main content
Build Status Documentation Status Code coverage

Pythonic management of LV2 audio plugins with mod-host.

Documentation:

http://pedalpi-pluginsmanager.readthedocs.io/

Code:

https://github.com/PedalPi/PluginsManager

Python Package Index:

https://pypi.org/project/PedalPi-PluginsManager

License:

Apache License 2.0

Install

Plugin Manager has dependencies that must be installed before installing the library. Among the dependencies are lv2ls to check the installed audio plugins and PortAudio for information on the audio interfaces through PyAudio.

On Debian-based systems, run:

sudo apt-get install -y portaudio19-dev python-all-dev lilv-utils --no-install-recommends

Of course, for PluginsManager to manage Lv2 audio plugins, it is necessary that they have installed audio plugins to be managed. The Guitarix and Calf Studio projects provide some audio plugins. To install them:

pip install PedalPi-PluginsManager

Example

This examples uses Calf and Guitarix audio plugins.

Download and install mod-host. For more information, check the ModHost section.

Start audio process

# In this example, is starting a Zoom g3 series audio interface
jackd -R -P70 -t2000 -dalsa -dhw:Series -p256 -n3 -r44100 -s &
mod-host

Play!

from pluginsmanager.banks_manager import BanksManager
from pluginsmanager.observer.mod_host.mod_host import ModHost

from pluginsmanager.model.bank import Bank
from pluginsmanager.model.pedalboard import Pedalboard
from pluginsmanager.model.connection import Connection

from pluginsmanager.model.lv2.lv2_effect_builder import Lv2EffectBuilder

from pluginsmanager.model.system.system_effect import SystemEffect

Creating a bank

# BanksManager manager the banks
manager = BanksManager()

bank = Bank('Bank 1')
manager.append(bank)

Connecting with mod_host. Is necessary that the mod_host process already running

mod_host = ModHost('localhost')
mod_host.connect()
manager.register(mod_host)

Creating pedalboard

pedalboard = Pedalboard('Rocksmith')
bank.append(pedalboard)
# or
# bank.pedalboards.append(pedalboard)

Loads pedalboard. All changes in pedalboard are reproduced in mod_host

mod_host.pedalboard = pedalboard

Add effects in the pedalboard

builder = Lv2EffectBuilder()

reverb = builder.build('http://calf.sourceforge.net/plugins/Reverb')
fuzz = builder.build('http://guitarix.sourceforge.net/plugins/gx_fuzz_#fuzz_')
reverb2 = builder.build('http://calf.sourceforge.net/plugins/Reverb')

pedalboard.append(reverb)
pedalboard.append(fuzz)
pedalboard.append(reverb2)
# or
# pedalboard.effects.append(reverb2)

For obtains automatically the sound card inputs and outputs, use SystemEffectBuilder. It requires a JackClient instance, that uses JACK-Client.

from pluginsmanager.jack.jack_client import JackClient
client = JackClient()

from pluginsmanager.model.system.system_effect_builder import SystemEffectBuilder
sys_effect = SystemEffectBuilder(client).build()

For manual input and output sound card definition, use:

sys_effect = SystemEffect('system', ['capture_1', 'capture_2'], ['playback_1', 'playback_2'])

Connecting:

pedalboard.connect(sys_effect.outputs[0], reverb.inputs[0])

pedalboard.connect(reverb.outputs[0], fuzz.inputs[0])
pedalboard.connect(reverb.outputs[1], fuzz.inputs[0])
pedalboard.connect(fuzz.outputs[0], reverb2.inputs[0])
pedalboard.connect(reverb.outputs[0], reverb2.inputs[0])

pedalboard.connect(reverb2.outputs[0], sys_effect.inputs[0])
pedalboard.connect(reverb2.outputs[0], sys_effect.inputs[1])

Connecting using ConnectionList:

pedalboard.connections.append(Connection(sys_effect.outputs[0], reverb.inputs[0]))

pedalboard.connections.append(Connection(reverb.outputs[0], fuzz.inputs[0]))
pedalboard.connections.append(Connection(reverb.outputs[1], fuzz.inputs[0]))
pedalboard.connections.append(Connection(fuzz.outputs[0], reverb2.inputs[0]))
pedalboard.connections.append(Connection(reverb.outputs[0], reverb2.inputs[0]))

pedalboard.connections.append(Connection(reverb2.outputs[0], sys_effect.inputs[0]))
pedalboard.connections.append(Connection(reverb2.outputs[0], sys_effect.inputs[1]))

Set effect status (enable/disable bypass) and param value

fuzz.toggle()
# or
# fuzz.active = not fuzz.active

fuzz.params[0].value = fuzz.params[0].minimum / fuzz.params[0].maximum

Removing effects and connections:

pedalboard.effects.remove(fuzz)

for connection in list(pedalboard.connections):
    pedalboard.disconnect(connection)
    # or
    #pedalboard.connections.remove(connection)

for effect in list(pedalboard.effects):
    pedalboard.effects.remove(effect)
# or
# for index in reversed(range(len(pedalboard.effects))):
    # del pedalboard.effects[index]

Observer

ModHost is an observer (see UpdatesObserver). It is informed about all changes that occur in some model instance (BanksManager, Bank, Pedalboard, Effect, Param, …), allowing it to communicate with the mod-host process transparently.

It is possible to create observers! Some ideas are:

  • Allow the use of other hosts (such as Carla);

  • Automatically persist changes;

  • Automatically update a human-machine interface (such as LEDs and displays that inform the state of the effects).

How to implement and the list of Observers implemented by this library can be accessed in the Observer section.

Maintenance

Makefile

Execute make help for see the options

Generate documentation

This project uses Sphinx + Read the Docs.

Release files for PedalPi-PluginsManager 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PedalPi-PluginsManager 0.8.0
File Size Uploaded
PedalPi-PluginsManager-0.8.0.tar.gz 269.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for PedalPi-PluginsManager 0.8.0
File Interpreter ABI Platform
PedalPi_PluginsManager-0.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 594.0 kB

Release files / PedalPi-PluginsManager-0.8.0.tar.gz

Download URL PedalPi-PluginsManager-0.8.0.tar.gz
Size 269.3 kB
Tags Source
SHA-256 checksum
How to use checksums
70f1ac4d2d1b0d0a255ab8fa9948784124e13a459e2dfe30b2c3f3caa33a5fbf
BLAKE2b-256 checksum
How to use checksums
d86669aff601ccc6449067faaf4072c75bc386c487e5ad8d1336ec72b23dfe1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.6.8

Release files / PedalPi_PluginsManager-0.8.0-py3-none-any.whl

Download URL PedalPi_PluginsManager-0.8.0-py3-none-any.whl
Size 324.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c42597833672d75ff6f51b6e009273dc6dad3791fc10e7892e3f4c191acf0f0
BLAKE2b-256 checksum
How to use checksums
3765680de669cfc2cf2133c875dcc29ab69efff6983c5795044b657ebca488a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.6.8

Release history Release notifications | RSS feed

This release

0.8.0 This release

2 release files

0.7.2

2 release files

0.7.1

1 release file

0.7.0

1 release file

0.6.0

1 release file

0.5.1

1 release file

0.5.0

1 release file

0.4.0

1 release file

0.3.2

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.1

1 release file

0.2.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page