Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悶 VSTPlugin.plugin_path setter fails #113

Closed
llamao opened this issue Jan 28, 2023 · 1 comment
Closed

馃悶 VSTPlugin.plugin_path setter fails #113

llamao opened this issue Jan 28, 2023 · 1 comment
Assignees
Labels
bug Something isn't working descriptors plugin-3rdparty VST 2/3, Waves, AU plugins and Fruity Wrapper
Milestone

Comments

@llamao
Copy link

llamao commented Jan 28, 2023

Describe the issue

Hey, I have some old projects with VST2s that I no longer have installed and I want to replace their absolute plugin path with the VST3 path.

I can't seem to set plugin_path.

I'm fairly sure I'm not doing this wrong, but it's a bit difficult to understand what PyFLP is doing at a low level without comments, so it could be that I'm not meant to do it like this - if that's the case I'd appreciate a point in the right direction.

What version of PyFLP are you using?

2.0.0a7.post0

What code caused this issue?

import pyflp
file = "fc.flp"
project = pyflp.parse(file)

# key: plugin name
# value: new plugin path
remap = {
    'Nectar 3':'C:\\Program Files\\Common Files\\VST3\\iZotope\\Nectar 3.vst3'}

for insert in project.mixer:
    for slot in insert:
        if slot.plugin is not None:

            if type(slot.plugin) == pyflp.plugin.VSTPlugin:
                
                if str(slot.plugin.name) in remap:
                    print("! " + str(slot.plugin.name))
                    print("! changing path " + str(slot.plugin.plugin_path) + " to " + remap[str(slot.plugin.name)])
                    slot.plugin.plugin_path = remap[slot.plugin.name]
                else:
                    print(slot.plugin.name)
                    
#pyflp.save(project, "remap_" + file)

Screenshots, Additional info

! Nectar 3
! changing path F:\Program Files\Steinberg\VSTPlugins\iZotope\Nectar 3.dll to C:\Program Files\Common Files\VST3\iZotope\Nectar 3.vst3
Traceback (most recent call last):
  File "C:\Users\gen5\Documents\flp2.py", line 21, in <module>
    slot.plugin.plugin_path = remap[slot.plugin.name]
    ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\gen5\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyflp\plugin.py", line 461, in __set__
    self._set(cast(VSTPluginEvent, ins.events.first(PluginID.Data)), value)
  File "C:\Users\gen5\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyflp\plugin.py", line 467, in _set
    event[self._id][self._prop] = value
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^
TypeError: 'str' object does not support item assignment
@llamao llamao added the bug Something isn't working label Jan 28, 2023
@demberto demberto self-assigned this Jan 28, 2023
@demberto demberto added this to the PyFLP 2.0.0 milestone Jan 28, 2023
@demberto demberto changed the title Setting plugin_path 馃悶 VSTPlugin.plugin_path setter fails Jan 28, 2023
@demberto demberto added plugin-3rdparty VST 2/3, Waves, AU plugins and Fruity Wrapper descriptors labels Jan 28, 2023
@demberto
Copy link
Owner

@llamao Checkout the latest commit, bug's been fixed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working descriptors plugin-3rdparty VST 2/3, Waves, AU plugins and Fruity Wrapper
Projects
None yet
Development

No branches or pull requests

2 participants