Skip to content

Commit

Permalink
Update #3 - Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
SrMouraSilva committed Nov 26, 2016
1 parent 0f33a04 commit 76e13f5
Show file tree
Hide file tree
Showing 13 changed files with 404 additions and 197 deletions.
87 changes: 0 additions & 87 deletions Readme.md

This file was deleted.

227 changes: 227 additions & 0 deletions Readme.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
PedalPi - PluginsManager
========================

.. image:: https://travis-ci.org/PedalPi/PluginsManager.svg?branch=master
:target: https://travis-ci.org/PedalPi/PluginsManager
:alt: Build Status

.. image:: https://readthedocs.org/projects/pedalpi-pluginsmanager/badge/?version=latest
:target: http://pedalpi-pluginsmanager.readthedocs.io/?badge=latest
:alt: Documentation Status

.. image:: https://codecov.io/gh/PedalPi/PluginsManager/branch/master/graph/badge.svg
:target: https://codecov.io/gh/PedalPi/PluginsManager
:alt: codecov

.. image:: https://landscape.io/github/PedalPi/PluginsManager/master/landscape.svg?style=flat
:target: https://landscape.io/github/PedalPi/PluginsManager/master
:alt: Code Health


Pythonic management of LV2 audio plugins with `mod-host`_.

.. _mod-host: https://github.com/moddevices/mod-host

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

**Code:**
https://github.com/PedalPi/PluginsManager

**Python Package Index:**
https://github.com/PedalPi/PluginsManager/tarball/master#egg=PedalPi-PluginsManager

**License:**
Open source license will be selected

Example
-------

Download and install `mod-host`_. For more information: :class:`Mod-host`

Start audio process

.. code-block:: bash
# 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!

.. code-block:: python
from pluginsmanager.banks_manager import BanksManager
from pluginsmanager.mod_host.mod_host import ModHost
from pluginsmanager.model.bank import Bank
from pluginsmanager.model.patch import Patch
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

.. code-block:: python
# 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

.. code-block:: python
mod_host = ModHost('localhost')
mod_host.connect()
manager.register(mod_host)
Creating patch

.. code-block:: python
patch = Patch('Rocksmith')
bank.append(patch)
# or
# bank.patches.append(patch)
Loads patch. All changes in patch are reproduced in mod_host

.. code-block:: python
mod_host.patch = patch
Add effects in the patch

.. code-block:: python
builder = Lv2EffectBuilder()
reverb = builder.build('http://calf.sourceforge.net/plugins/Reverb')
fuzz = builder.build('http://guitarix.sourceforge.net/plugins/gx_fuzzfacefm_#_fuzzfacefm_')
reverb2 = builder.build('http://calf.sourceforge.net/plugins/Reverb')
patch.append(reverb)
patch.append(fuzz)
patch.append(reverb2)
# or
# patch.effects.append(reverb2)
For obtains automatically the sound card inputs and outputs, use :class:`SystemEffectBuilder`. It requires `JACK-Client`_.

.. _JACK-Client: https://jackclient-python.readthedocs.io/

.. code-block:: python
sys_effect = SystemEffectBuilder()
For manual input and output sound card definition, use:

.. code-block:: python
sys_effect = SystemEffect('system', ('capture_1', 'capture_2'), ('playback_1', 'playback_2'))
.. note::

**NOT ADD sys_effect** in PATCH

Connecting *mode one*:

.. code-block:: python
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*:

.. code-block:: python
patch.connect(Connection(reverb.outputs[0], fuzz.inputs[0]))
patch.connect(Connection(reverb.outputs[1], fuzz.inputs[0]))
patch.connect(Connection(fuzz.outputs[0], reverb2.inputs[0]))
patch.connect(Connection(reverb.outputs[0], reverb2.inputs[0]))
patch.connect(reverb2.outputs[0].connect(sys_effect.inputs[0]))
patch.connect(reverb2.outputs[0].connect(sys_effect.inputs[1]))
Set effect status (enable/disable bypass) and param value

.. code-block:: python
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
# patch.connections.remove(Connection(fuzz.outputs[0], reverb2.inputs[0]))
# or
# index = patch.connections.index(Connection(fuzz.outputs[0], reverb2.inputs[0]))
# del patch.connections[index]
reverb.toggle()
Removing effects and connections:

.. code-block:: python
patch.effects.remove(fuzz)
for connection in list(patch.connections):
patch.connections.remove(connection)
for effect in list(patch.effects):
patch.effects.remove(effect)
# or
# for index in reversed(range(len(patch.effects))):
# del patch.effects[index]
Maintenance
-----------

Test
****

It is not necessary for the mod_host process to be running

.. code-block:: bash
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:

.. code-block:: bash
pip3 install sphinx
cd docs
make html
firefox build/html/index.html
.. _Sphinx: http://www.sphinx-doc.org/
.. _Read the Docs: http://readthedocs.org
Empty file added docs/source/_static/empty
Empty file.
4 changes: 3 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,4 +354,6 @@


# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
intersphinx_mapping = {
'https://docs.python.org/': None
}

0 comments on commit 76e13f5

Please sign in to comment.