spotify / pedalboard

🎛 🔊 A Python library for audio.

Home Page:https://spotify.github.io/pedalboard

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[wish] Expose additional AU/VST plugin metadata, esp. manufacturer name

twardoch opened this issue · comments

[wish] Expose additional AU/VST plugin metadata, esp. manufacturer name

Pedalboard provides a great way to load, examine and use audio VST and AU plugins in Python workflows, thanks to the JUCE library. But Pedalboard doesn’t expose certain metadata that could be very useful for plugin management and organization. In particular, the manufacturer name is a key piece of information that is currently not accessible.

To improve the usability of Pedalboard, it would be great if additional metadata fields could be exposed through the Python bindings for both AU and VST3 plugins. The most important fields to add would be:

  • Manufacturer name
  • Plugin version
  • Plugin category or categories
  • Plugin unique ID

Exposing this additional metadata would allow programs to get better info (for example on the web) about a certain plugin. This is particularly important if a certain plugin has a very "simple" name.

Example use case

My Pedalboard-Pluginary package scans for plugins installed on a local machine, and saves basic info about them and their plugin params in a "cache" file.

For AudioUnit aufx plugins, my code additionally calls the auval CLI tool to get the manufacturer name (mostly), but this is of course inefficient. It would be much better if some basic plugin metadata were available in the Pedalboard plugin object.

Suggested implementation

I’m not a good coder, so I may have confused things a bit here. But I hope you get the gist!

In PatchedVST3PluginInstance::fillInPluginDescription(), additional fields are already being populated in the PluginDescription object, including version, category, manufacturerName, and uniqueId.

These fields could be exposed to Python by adding corresponding properties to the VST3Plugin class definition in python_bindings.cpp, with a basic getter that retrieves the value from the underlying PluginDescription. For example:

py::class_<VST3Plugin, ExternalPlugin>(m, "VST3Plugin")
    ...
    .def_property_readonly("manufacturer_name", &VST3Plugin::getManufacturerName)
    .def_property_readonly("version", &VST3Plugin::getVersion)
    .def_property_readonly("category", &VST3Plugin::getCategory)
    .def_property_readonly("unique_id", &VST3Plugin::getUniqueId)
    ...

The getters would be simple one-liners that forward to the wrapped plugin instance:

String VST3Plugin::getManufacturerName() const {
    return plugin->getManufacturerName();  
}

The AudioUnitPlugin class could be extended in a similar way by adding metadata properties that retrieve the corresponding values from the AudioUnit API.

With these properties in place, Python code could access them as plugin.manufacturer_name, plugin.version, etc.

❤️