Pythonic management of LV2 audio plugins with mod-host.
Project description
Pythonic management of LV2 audio plugins with mod-host.
- Documentation:
- Code:
- Python Package Index:
https://github.com/PedalPi/PluginsManager/tarball/master#egg=PedalPi-PluginsManager
- License:
Open source license will be selected
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.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 JACK-Client.
from pluginsmanager.model.system.system_effect_builder import SystemEffectBuilder
sys_effect = SystemEffectBuilder()
For manual input and output sound card definition, use:
sys_effect = SystemEffect('system', ['capture_1', 'capture_2'], ['playback_1', 'playback_2'])
Connecting mode one:
sys_effect.outputs[0].connect(reverb.inputs[0])
reverb.outputs[0].connect(fuzz.inputs[0])
reverb.outputs[1].connect(fuzz.inputs[0])
fuzz.outputs[0].connect(reverb2.inputs[0])
reverb.outputs[0].connect(reverb2.inputs[0])
reverb2.outputs[0].connect(sys_effect.inputs[0])
reverb2.outputs[0].connect(sys_effect.inputs[1])
Connecting mode two:
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
fuzz.outputs[0].disconnect(reverb2.inputs[0])
# or
# pedalboard.connections.remove(Connection(fuzz.outputs[0], reverb2.inputs[0]))
# or
# index = pedalboard.connections.index(Connection(fuzz.outputs[0], reverb2.inputs[0]))
# del pedalboard.connections[index]
reverb.toggle()
Removing effects and connections:
pedalboard.effects.remove(fuzz)
for connection in list(pedalboard.connections):
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]
Maintenance
Test
It is not necessary for the mod_host process to be running
coverage3 run --source=pluginsmanager setup.py test
coverage3 report
coverage3 html
firefox htmlcov/index.html
Generate documentation
This project uses Sphinx + Read the Docs.
You can generate the documentation in your local machine:
pip3 install sphinx
cd docs
make html
firefox build/html/index.html
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for PedalPi-PluginsManager-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e17928fc8aee493181844d19b08fe1b7be2db8db0debb269323070e9e150a91 |
|
MD5 | 3b2651d33935aed4d853296224ef57f2 |
|
BLAKE2b-256 | 0b2c448f2de7e2c67fa0cf6d2facc050563662fc90bedd0189722e0a2435453d |