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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .aupreset support #171

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion pedalboard/ExternalPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,23 @@ template <typename ExternalPluginType> class ExternalPlugin : public Plugin {
presetFilePath);
}
}

void visitAudioUnitClient(
const juce::ExtensionsVisitor::AudioUnitClient &client) override {
juce::File presetFile(presetFilePath);
juce::MemoryBlock presetData;

if (!presetFile.loadFileAsData(presetData)) {
throw std::runtime_error("Failed to read preset file: " +
presetFilePath);
}

if (!client.setPreset(presetData)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know that this will work - the JUCE code doesn't seem to have a setPreset method on AudioUnitClient:

    struct AudioUnitClient
    {
        virtual ~AudioUnitClient() = default;
        virtual AudioUnit getAudioUnitHandle() const noexcept = 0;
    };

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Older thread:

And more specific feature request thread that I just opened for this:

Copy link

@0xdevalias 0xdevalias May 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related technical docs:

  • https://developer.apple.com/documentation/audiotoolbox/auaudiounitpreset
    • AUAudioUnitPreset

    • The AUAudioUnitPreset class describes an interface for custom parameter settings provided by the audio unit developer. These presets often produce a useful sound or starting point.

    • For more details on working with Audio Unit presets, see Audio Units - How to correctly save and restore Audio Unit presets. Note that the version 3 fullState property is bridged to the version 2 kAudioUnitProperty_ClassInfo API. Similarly, the version 3 fullStateForDocument property is bridged to the version 2 kAudioUnitProperty_ClassInfoFromDocument API.

  • https://developer.apple.com/library/archive/technotes/tn2157/_index.html
    • Technical Note TN2157
      Audio Units - How to correctly save and restore Audio Unit presets.

throw std::runtime_error(
"Plugin returned an error when loading data from preset file: " +
presetFilePath);
}
}
};

void loadPresetData(std::string presetFilePath) {
Expand Down Expand Up @@ -1067,6 +1084,10 @@ inline void init_external_plugins(py::module &m) {
ss << ">";
return ss.str();
})
.def("load_preset",
&ExternalPlugin<juce::AudioUnitPluginFormat>::loadPresetData,
"Load a Audio Unit preset file in .aupreset format.",
py::arg("preset_file_path"))
.def_static(
"get_plugin_names_for_file",
[](std::string filename) {
Expand Down Expand Up @@ -1110,4 +1131,4 @@ inline void init_external_plugins(py::module &m) {
#endif
}

} // namespace Pedalboard
} // namespace Pedalboard
175 changes: 175 additions & 0 deletions tests/presets/DEX.aupreset
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>data</key>
<data>
AAAAAAAAAAAAAACbAAAAMD+AAAAAAAAxAAAAAAAAADI/gAAAAAAAMz8AAAAAAAA0P4AA
AAAAADU/gAAAAAAANj+AAAAAAAA3PrUClgAAADgAAAAAAAAAOQAAAAAAAAYfAAAAAAAA
BiA/gAAAAAAGIQAAAAAAAAYiPwAAAAAABiM+2223AAAGJD+AAAAAAAYlP4AAAAAABiY/
gAAAAAAGJz+AAAAAAAYoPwFK/QAABj4/AUr9AAAGPz8BSv0AAAZAPwFK/QAABkE/NQKW
AAAGQj7O3mIAAAZDPv1qBQAABkQ/gAAAAAAGRT+AAAAAAAZGP23mJAAABkcAAAAAAAAG
XQAAAAAAAAZeP4AAAAAABl8AAAAAAAAGYD0EIQgAAAZhAAAAAAAABmI/AAAAAAAGYwAA
AAAAAAZkAAAAAAAABmUAAAAAAAAGZgAAAAAAAAZ8AAAAAA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uLi4uLi4uLi5MRi5DLlBCaU0xWGlJaUx4
SFNBREQuQ0xULi4uUGYuTExUUFNNVFBEVURIeER5Ty5YMU8uSUgiLz48bWlkaUNDLz48
L2RleGVkU3RhdGU+AA==
</data>
<key>manufacturer</key>
<integer>1145525058</integer>
<key>name</key>
<string>Default-1</string>
<key>subtype</key>
<integer>1147500644</integer>
<key>type</key>
<integer>1635085685</integer>
<key>version</key>
<integer>0</integer>
</dict>
</plist>
25 changes: 25 additions & 0 deletions tests/test_external_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,31 @@ def test_preset_parameters(plugin_filename: str, plugin_preset: str):
actual != default
), f"Expected attribute {name} to be different from default ({default}), but was {actual}"

@pytest.mark.parametrize(
"plugin_filename,plugin_preset",
[
(plugin, os.path.join(TEST_PRESET_BASE_PATH, plugin + ".aupreset"))
for plugin in AVAILABLE_PLUGINS_IN_TEST_ENVIRONMENT
if os.path.isfile(os.path.join(TEST_PRESET_BASE_PATH, plugin + ".aupreset"))
],
)
def test_preset_parameters(plugin_filename: str, plugin_preset: str):
# plugin with default params.
plugin = load_test_plugin(plugin_filename)

default_params = {k: v.raw_value for k, v in plugin.parameters.items() if v.type == float}

# load preset file
plugin.load_preset(plugin_preset)

for name, default in default_params.items():
actual = getattr(plugin, name)
if math.isnan(actual):
continue
assert (
actual != default
), f"Expected attribute {name} to be different from default ({default}), but was {actual}"


@pytest.mark.parametrize("plugin_filename", AVAILABLE_PLUGINS_IN_TEST_ENVIRONMENT)
def test_initial_parameters(plugin_filename: str):
Expand Down