SynthVST Class¶
SynthVST
is a class for interacting with VST synthesizer plugins.
This class relies on the librenderman package developed by Leon Feddon for interacting with VSTs. A VST can be loaded, parameters displayed and modified, random patches generated, and audio rendered for further processing.
-
class
spiegel.synth.synth_vst.
SynthVST
(pluginPath=None, **kwargs)¶ Bases:
spiegel.synth.synth_base.SynthBase
- Parameters
pluginPath (str, optional) – path to vst plugin binary, defaults to None
arguments (keyword) – see
spiegel.synth.synth_base.SynthBase
for details
-
getAudio
()¶ Return monophonic audio from rendered patch
- Returns
An audio signal of the rendered patch
- Return type
1D np.array
-
getParameters
()¶ Returns parameters for the synth
- Returns
A dictionary of parameters with the parameter index (int) as the key and the parameter name short description as the value
- Return type
Dictionary
-
getPatch
(skipOverridden=True)¶ Get current patch
- Parameters
skipOverridden (bool, optional) – Indicates whether to remove overridden parameters from results, defaults to True
-
getRandomExample
()¶ Returns audio from a new random patch
- Returns
An audio buffer
- Return type
np.array
-
isValidParameterSetting
(parameter)¶ Checks to see if a parameter is valid for the currently loaded synth.
- Parameters
parameter (tuple) – A parameter tuple with form (parameter_index, parameter_value)
-
loadPlugin
(pluginPath)¶ Loads a synth VST plugin
- Parameters
pluginPath (str) – path to vst plugin binary
-
randomizePatch
()¶ Randomize the current patch. Overridden parameteres will be unaffected.
-
renderPatch
()¶ Render the current patch. Uses the values of midiNote, midiVelocity, noteLengthSecs, and renderLengthSecs to render audio. Plugin must be loaded first.
-
setOverriddenParameters
(parameters)¶ Override parameters with specific values
- Parameters
parameters – List of parameter tuples with parameter index and parameter value that will be patched and then the parameter frozen.
-
setPatch
(parameters)¶ Update patch parameter. Overridden parameters will not be effected.
- Parameters
parameters (list) – A list of tuples. Tuples within the list must have the form (parameter_index, parameter_value) where parameter_index is an int with the parameter to modify and the parameter value is a float between 0-1. Can be a partial list of parameters for the synthesizer. See
getParameters()
to get parameter indices for the loaded synth.
-
spiegel.synth.synth_vst.
parseParameters
(paramStr)¶ Parse parameter string return by librenderman into a dictionary keyed on parameter index with values being the name / short descriptions for the parameter at that index.
- Parameters
paramStr (str) – A parameter decription string returned by librenderman
- Returns
A dictionary with parameter index as keys and parameter name / description for values
- Return type
dict