PedalPi - PluginsManager - Models¶
This page contains the model classes.
BanksManager¶
-
class
pluginsmanager.banks_manager.
BanksManager
(banks=None)[source]¶ BanksManager manager the banks. In these is possible add banks, obtains the banks and register observers for will be notified when occurs changes (like added new pedalboard, rename bank, set effect param value or state)
For use details, view Readme.rst example documentation.
Parameters: banks (list[Bank]) – Banks that will be added in this. Useful for loads banks previously loaded, like banks persisted and recovered. -
__iter__
()[source]¶ Iterates banks of the banksmanager:
>>> banks_manager = BanksManager() >>> for index, bank in enumerate(banks_manager): ... print(index, '-', bank)
Returns: Iterator for banks list
-
append
(bank)[source]¶ Append the bank in banks manager. It will be monitored, changes in this will be notified for the notifiers.
Parameters: bank (Bank) – Bank that will be added in this
-
enter_scope
(observer)[source]¶ Informs that changes occurs by the
observer
and isn’t necessary informs the changes for observerParameters: observer (UpdatesObserver) – Observer that causes changes
-
observers
¶ Returns: Observers registered in BanksManager instance
-
register
(observer)[source]¶ Register an observer for it be notified when occurs changes.
For more details, see
UpdatesObserver
Parameters: observer (UpdatesObserver) – Observer that will be notified then occurs changes
-
unregister
(observer)[source]¶ Remove the observers of the observers list. It will not receive any more notifications when occurs changes.
Parameters: observer (UpdatesObserver) – Observer you will not receive any more notifications then occurs changes.
-
Bank¶
-
class
pluginsmanager.model.bank.
Bank
(name)[source]¶ Bank is a data structure that contains
Pedalboard
. It’s useful for group common pedalboards, like “Pedalboards will be used in the Sunday show”A fast bank overview:
>>> bank = Bank('RHCP') >>> californication = Pedalboard('Californication')
>>> # Add pedalboard in bank - mode A >>> bank.append(californication) >>> californication.bank == bank True
>>> bank.pedalboards[0] == californication True
>>> # Add pedalboard in bank - mode B >>> bank.pedalboards.append(Pedalboard('Dark Necessities')) >>> bank.pedalboards[1].bank == bank True
>>> # If you needs change pedalboards order (swap), use pythonic mode >>> bank.pedalboards[1], bank.pedalboards[0] = bank.pedalboards[0], bank.pedalboards[1] >>> bank.pedalboards[1] == californication True
>>> # Set pedalboard >>> bank.pedalboards[0] = Pedalboard("Can't Stop") >>> bank.pedalboards[0].bank == bank True
>>> del bank.pedalboards[0] >>> bank.pedalboards[0] == californication # Pedalboard Can't stop rermoved, first is now the californication True
You can also toggle pedalboards into different banks:
>>> bank1.pedalboards[0], bank2.pedalboards[2] = bank2.pedalboards[0], bank1.pedalboards[2]
Parameters: name (string) – Bank name -
append
(pedalboard)[source]¶ Add a
Pedalboard
in this bankThis works same as:
>>> bank.pedalboards.append(pedalboard)
or:
>>> bank.pedalboards.insert(len(bank.pedalboards), pedalboard)
Parameters: pedalboard (Pedalboard) – Pedalboard that will be added
-
index
¶ Returns the first occurrence of the bank in your
PluginsManager
-
json
¶ Get a json decodable representation of this bank
Return dict: json representation
-
name
¶ Bank name
Getter: Bank name Setter: Set the Bank name Type: string
-
simple_identifier
¶ Simple identifier for index file human comprehension and reordering :return string:
-
Pedalboard¶
-
class
pluginsmanager.model.pedalboard.
Pedalboard
(name)[source]¶ Pedalboard is a patch representation: your structure contains
Effect
andConnection
:>>> pedalboard = Pedalboard('Rocksmith') >>> bank.append(pedalboard) >>> builder = Lv2EffectBuilder() >>> pedalboard.effects [] >>> reverb = builder.build('http://calf.sourceforge.net/plugins/Reverb') >>> pedalboard.append(reverb) >>> pedalboard.effects [<Lv2Effect object as 'Calf Reverb' active at 0x7f60effb09e8>] >>> fuzz = builder.build('http://guitarix.sourceforge.net/plugins/gx_fuzzfacefm_#_fuzzfacefm_') >>> pedalboard.effects.append(fuzz) >>> pedalboard.connections [] >>> pedalboard.connections.append(Connection(sys_effect.outputs[0], fuzz.inputs[0])) # View SystemEffect for more details >>> pedalboard.connections.append(Connection(fuzz.outputs[0], reverb.inputs[0])) >>> # It works too >>> pedalboard.connect(reverb.outputs[1], sys_effect.inputs[0]) >>> pedalboard.connections [<Connection object as 'system.capture_1 -> GxFuzzFaceFullerMod.In' at 0x7f60f45f3f60>, <Connection object as 'GxFuzzFaceFullerMod.Out -> Calf Reverb.In L' at 0x7f60f45f57f0>, <Connection object as 'Calf Reverb.Out R -> system.playback_1' at 0x7f60f45dacc0>] >>> pedalboard.data {} >>> pedalboard.data = {'my-awesome-component': True} >>> pedalboard.data {'my-awesome-component': True}
For load the pedalboard for play the songs with it:
>>> mod_host.pedalboard = pedalboard
All changes¹ in the pedalboard will be reproduced in mod-host. ¹ Except in data attribute, changes in this does not interfere with anything.
Parameters: name (string) – Pedalboard name -
append
(effect)[source]¶ Add a
Effect
in this pedalboardThis works same as:
>>> pedalboard.effects.append(effect)
or:
>>> pedalboard.effects.insert(len(pedalboard.effects), effect)
Parameters: effect (Effect) – Effect that will be added
-
connect
(output_port, input_port)[source]¶ Connect two
Effect
instances in this pedalboard. For this, is necessary informs the output port origin and the input port destination:>>> pedalboard.append(driver) >>> pedalboard.append(reverb) >>> driver_output = driver.outputs[0] >>> reverb_input = reverb.inputs[0] >>> Connection(driver_output, reverb_input) in driver.connections False >>> pedalboard.connect(driver_output, reverb_input) >>> Connection(driver_output, reverb_input) in driver.connections True
Parameters:
-
connections
¶ Return the pedalboard connections list
Note
Because the connections is an
ObservableList
, it isn’t settable. For replace, del the connections unnecessary and add the necessary connections
-
data
¶ Custom information about pedalboard that is necessary to be persisted. Example is effects disposition in a visual modelling pedalboard.
Note
This operation only will notifies changes if the setter is called:
>>> data = {'level': 50} >>> # This call the observer on_custom_change(CustomChange.PEDALBOARD_DATA, UpdateType.UPDATED, pedalboard=pedalboard) >>> pedalboard.data = data >>> # This doesn't call the observer on_custom_change(...) >>> data['level'] = 80 >>> # But this call, even though the object is the same. >>> pedalboard.data = data
Getter: Data Setter: Set the data Type: dict
-
disconnect
(output_port, input_port)[source]¶ Remove a connection between (two ports of)
Effect
instances. For this, is necessary informs the output port origin and the input port destination:>>> pedalboard.append(driver) >>> pedalboard.append(reverb) >>> driver_output = driver.outputs[0] >>> reverb_input = reverb.inputs[0] >>> pedalboard.connect(driver_output, reverb_input) >>> Connection(driver_output, reverb_input) in driver.connections True >>> pedalboard.disconnect(driver_output, reverb_input) >>> Connection(driver_output, reverb_input) in driver.connections False
Parameters:
-
effects
¶ Return the effects presents in the pedalboard
Note
Because the effects is an
ObservableList
, it isn’t settable. For replace, del the effects unnecessary and add the necessary effects
-
index
¶ Returns the first occurrence of the pedalboard in your bank
-
json
¶ Get a json decodable representation of this pedalboard
Return dict: json representation
-
name
¶ Pedalboard name
Getter: Pedalboard name Setter: Set the pedalboard name Type: string
-
Connection¶
-
class
pluginsmanager.model.connection.
Connection
(output_port, input_port)[source]¶ Connection
represents a connection between two distinct effects by yourAudioPort
(effectOutput
with effectInput
):>>> from pluginsmanager.model.pedalboard import Pedalboard >>> californication = Pedalboard('Californication') >>> californication.append(driver) >>> californication.append(reverb)
>>> guitar_output = sys_effect.outputs[0] >>> driver_input = driver.inputs[0] >>> driver_output = driver.outputs[0] >>> reverb_input = reverb.inputs[0] >>> reverb_output = reverb.outputs[0] >>> amp_input = sys_effect.inputs[0]
>>> # Guitar -> driver -> reverb -> amp >>> californication.connections.append(Connection(guitar_output, driver_input)) >>> californication.connections.append(Connection(driver_output, reverb_input)) >>> californication.connections.append(Connection(reverb_output, amp_input))
Another way to use implicitly connections:
>>> californication.connect(guitar_output, driver_input) >>> californication.connect(driver_output, reverb_input) >>> californication.connect(reverb_output, amp_input)
Parameters: -
__init__
(output_port, input_port)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
input
¶ Return Output: Input connection port
-
json
¶ Get a json decodable representation of this effect
Return dict: json representation
-
output
¶ Return Output: Output connection port
-
ports_class
¶ Return class: Port class that this connection only accepts
-
MidiConnection¶
-
class
pluginsmanager.model.midi_connection.
MidiConnection
(output_port, input_port)[source]¶ MidiConnection
represents a connection between two distinct effects by yourMidiPort
(effectMidiOutput
with effectMidiInput
):>>> californication = Pedalboard('Californication') >>> californication.append(driver) >>> californication.append(reverb)
>>> output_port = cctonode1.midi_outputs[0] >>> input_port = cctonode2.midi_inputs[0]
>>> californication.connections.append(MidiConnection(output_port, input_port))
Another way to use implicitly connections:
>>> californication.connect(output_port, input_port)
Parameters: - output_port (MidiOutput) – MidiOutput port that will be connected with midi input port
- input_port (MidiInput) – MidiInput port that will be connected with midi output port
-
ports_class
¶ Return class: Port class that this connection only accepts
ConnectionsList¶
-
class
pluginsmanager.model.connections_list.
ConnectionsList
(pedalboard)[source]¶ ConnectionsList contains a
ObservableList
and checks the effect instance unity restrictions
Effect¶
-
class
pluginsmanager.model.effect.
Effect
[source]¶ Representation of a audio plugin instance - LV2 plugin encapsulated as a jack client.
Effect contains a active status (off=bypass), a list of
Param
, a list ofInput
and a list ofConnection
:>>> reverb = builder.build('http://calf.sourceforge.net/plugins/Reverb') >>> pedalboard.append(reverb) >>> reverb <Lv2Effect object as 'Calf Reverb' active at 0x7fd58d874ba8> >>> reverb.active True >>> reverb.toggle() >>> reverb.active False >>> reverb.active = True >>> reverb.active True >>> reverb.inputs (<Lv2Input object as In L at 0x7fd58c583208>, <Lv2Input object as In R at 0x7fd58c587320>) >>> reverb.outputs (<Lv2Output object as Out L at 0x7fd58c58a438>, <Lv2Output object as Out R at 0x7fd58c58d550>) >>> reverb.params (<Lv2Param object as value=1.5 [0.4000000059604645 - 15.0] at 0x7fd587f77908>, <Lv2Param object as value=5000.0 [2000.0 - 20000.0] at 0x7fd587f7a9e8>, <Lv2Param object as value=2 [0 - 5] at 0x7fd587f7cac8>, <Lv2Param object as value=0.5 [0.0 - 1.0] at 0x7fd587f7eba8>, <Lv2Param object as value=0.25 [0.0 - 2.0] at 0x7fd58c576c88>, <Lv2Param object as value=1.0 [0.0 - 2.0] at 0x7fd58c578d68>, <Lv2Param object as value=0.0 [0.0 - 500.0] at 0x7fd58c57ae80>, <Lv2Param object as value=300.0 [20.0 - 20000.0] at 0x7fd58c57df98>, <Lv2Param object as value=5000.0 [20.0 - 20000.0] at 0x7fd58c5810f0>)
Parameters: pedalboard (Pedalboard) – Pedalboard where the effect lies. -
active
¶ Effect status: active or bypass
Getter: Current effect status Setter: Set the effect Status Type: bool
-
connections
¶ Return list[Connection]: Connections that this effects is present (with input or output port)
-
index
¶ Returns the first occurrence of the effect in your pedalboard
-
inputs
¶ Return list[Input]: Inputs of effect
-
is_possible_connect_itself
¶ return bool: Is possible connect the with it self?
-
is_unique_for_all_pedalboards
¶ - return bool: Is unique for all pedalboards?
- Example:
SystemEffect
is unique for all pedalboards
-
json
¶ Get a json decodable representation of this effect
Return dict: json representation
-
midi_inputs
¶ Return list[MidiInput]: MidiInputs of effect
-
midi_outputs
¶ Return list[MidiOutput]: MidiOutputs of effect
-
outputs
¶ Return list[Output]: Outputs of effect
-
params
¶ Return list[Param]: Params of effect
-
use_real_identifier
¶ Instances of audio plugins are dynamically created, so the effect identifier for the jack can be set.
However, SystemEffect correspond (mostly) to the audio interfaces already present in the computational system. The identifier for their jack has already been set.
- return bool: For this audio plugin, is necessary use the real effect identifier?
- Example:
Lv2Effect
is False Example:SystemEffect
is True
-
version
¶ Return string: Effect version
-
EffectsList¶
-
class
pluginsmanager.model.effects_list.
EffectsList
[source]¶ EffectsList contains a
ObservableList
and checks the effect instance unity restrictions
Port¶
-
class
pluginsmanager.model.port.
Port
(effect)[source]¶ Port is a parent abstraction for inputs and outputs
Parameters: effect (Effect) – Effect that contains port -
connection_class
¶ Returns: Class used for connections in this port
-
effect
¶ Returns: Effect that this port is related
-
index
¶ Returns: Index in the effect related based in your category. As example, if this port is a input
, the index returns your position in the inputs ports.
-
json
¶ Get a json decodable representation
Return dict: json representation
-
symbol
¶ Returns: Identifier for this port
-
AudioPort¶
Input¶
-
class
pluginsmanager.model.input.
Input
(effect)[source]¶ Input is the medium in which the audio will go into effect to be processed.
Effects usually have a one (mono) or two inputs (stereo L + stereo R). But this isn’t a rule: Some have only
Output
, like audio frequency generators, others have more than two.For obtains the inputs:
>>> my_awesome_effect <Lv2Effect object as 'Calf Reverb' active at 0x7fd58d874ba8> >>> my_awesome_effect.inputs (<Lv2Input object as In L at 0x7fd58c583208>, <Lv2Input object as In R at 0x7fd58c587320>) >>> effect_input = my_awesome_effect.inputs[0] >>> effect_input <Lv2Input object as In L at 0x7fd58c583208> >>> symbol = effect_input.symbol >>> symbol 'in_l' >>> my_awesome_effect.inputs[symbol] == effect_input True
For connections between effects, see
connect()
anddisconnect()
Pedalboard
class methods.Parameters: effect (Effect) – Effect of input -
index
¶ Returns: Input index in the your effect
-
Output¶
-
class
pluginsmanager.model.output.
Output
(effect)[source]¶ Output is the medium in which the audio processed by the effect is returned.
Effects usually have a one (mono) or two outputs (stereo L + stereo R). .
For obtains the outputs:
>>> my_awesome_effect <Lv2Effect object as 'Calf Reverb' active at 0x7fd58d874ba8> >>> my_awesome_effect.outputs (<Lv2Output object as Out L at 0x7fd58c58a438>, <Lv2Output object as Out R at 0x7fd58c58d550>) >>> output = my_awesome_effect.outputs[0] >>> output <Lv2Output object as Out L at 0x7fd58c58a438> >>> symbol = my_awesome_effect.outputs[0].symbol >>> symbol 'output_l' >>> my_awesome_effect.outputs[symbol] == output True
For connections between effects, see
connect()
anddisconnect()
Pedalboard
class methods.Parameters: effect (Effect) – Effect that contains the output -
index
¶ Returns: Output index in the your effect
-
MidiPort¶
MidiInput¶
-
class
pluginsmanager.model.midi_input.
MidiInput
(effect)[source]¶ MidiInput is the medium in which the midi input port will go into effect to be processed.
For obtains the inputs:
>>> cctonode <Lv2Effect object as 'CC2Note' active at 0x7efe5480af28> >>> cctonode.midi_inputs (<Lv2MidiInput object as MIDI In at 0x7efe54535dd8>,) >>> midi_input = cctonode.midi_inputs[0] >>> midi_input <Lv2MidiInput object as MIDI In at 0x7efe54535dd8> >>> symbol = midi_input.symbol >>> symbol 'midiin' >>> cctonode.midi_inputs[symbol] == midi_input True
For connections between effects, see
connect()
anddisconnect()
Pedalboard
class methods.Parameters: effect (Effect) – Effect of midi input -
index
¶ Returns: MidiInput index in the your effect
-
MidiOutput¶
-
class
pluginsmanager.model.midi_output.
MidiOutput
(effect)[source]¶ MidiOutput is the medium in which the midi output processed by the effect is returned.
For obtains the outputs:
>>> cctonode <Lv2Effect object as 'CC2Note' active at 0x7efe5480af28> >>> cctonode.outputs (<Lv2MidiOutput object as MIDI Out at 0x7efe5420eeb8>,) >>> midi_output = cctonode.midi_outputs[0] >>> midi_output <Lv2Output object as Out L at 0x7fd58c58a438> >>> symbol = midi_output.symbol >>> symbol 'midiout' >>> cctonode.midi_outputs[symbol] == midi_output True
For connections between effects, see
connect()
anddisconnect()
Pedalboard
class methods.Parameters: effect (Effect) – Effect that contains the output -
index
¶ Returns: Output index in the your effect
-
Param¶
-
class
pluginsmanager.model.param.
Param
(effect, default)[source]¶ Param
represents an Audio Plugin Parameter:>>> my_awesome_effect <Lv2Effect object as 'Calf Reverb' active at 0x7fd58d874ba8> >>> my_awesome_effect.params (<Lv2Param object as value=1.5 [0.4000000059604645 - 15.0] at 0x7fd587f77908>, <Lv2Param object as value=5000.0 [2000.0 - 20000.0] at 0x7fd587f7a9e8>, <Lv2Param object as value=2 [0 - 5] at 0x7fd587f7cac8>, <Lv2Param object as value=0.5 [0.0 - 1.0] at 0x7fd587f7eba8>, <Lv2Param object as value=0.25 [0.0 - 2.0] at 0x7fd58c576c88>, <Lv2Param object as value=1.0 [0.0 - 2.0] at 0x7fd58c578d68>, <Lv2Param object as value=0.0 [0.0 - 500.0] at 0x7fd58c57ae80>, <Lv2Param object as value=300.0 [20.0 - 20000.0] at 0x7fd58c57df98>, <Lv2Param object as value=5000.0 [20.0 - 20000.0] at 0x7fd58c5810f0>) >>> param = my_awesome_effect.params[0] >>> param <Lv2Param object as value=1.5 [0.4000000059604645 - 15.0] at 0x7fd587f77908> >>> param.default 1.5 >>> param.value = 14 >>> symbol = param.symbol >>> symbol 'decay_time' >>> param == my_awesome_effect.params[symbol] True
Parameters: - effect (Effect) – Effect in which this parameter belongs
- default – Default value (initial value parameter)
-
default
¶ Default parameter value. Then a effect is instanced, the value initial for a parameter is your default value.
Getter: Default parameter value.
-
effect
¶ Returns: Effect in which this parameter belongs
-
json
¶ Get a json decodable representation of this param
Return dict: json representation
-
maximum
¶ Returns: Greater value that the parameter can assume
-
minimum
¶ Returns: Smaller value that the parameter can assume
-
symbol
¶ Returns: Param identifier
-
value
¶ Parameter value
Getter: Current value Setter: Set the current value