Possible to load fxb/fxp files from disk?

For a categorization tool i would like to load single preset (fxp) and soundbank (fxb) files into a Juce application.
For soundbank files the contained presets would have to be determined and made visible.
Is that possible and how would that be done?
Also i would like to apply a currently chosen (from a list) preset to a connected VST plugin (like Sylenth1) which can play that preset and offer various synthesizer effects.

Thank you for any help!

There’s some FXB functionality in the VSTPluginFormat class header. :slight_smile:

Ok, but this functionality is related to an AudioPluginInstance, i.e. not with data to be loaded directly from disk.
Therefore no direct help for being able to load .fxp files and play the contents over the MidiKeyboard or send it to a connected VST plugin?

What do you mean by “directly from disk”?

You can do something like this:

File f ("path/to/file.fxp");
MemoryBlock mb;
f.loadFileAsData (mb);
VSTPluginFormat::loadFromFXBFile (yourPluginInstanse, mb.getData(), mb.getSize());
2 Likes

That works fine, thank you, Tom!
I didn’t know that both .fxp and .fxb files can be passed with the same function call to another VST plugin.

With “directly from disk” i meant (and that part of the question is still open) using/playing the file content (now from an .fxp preset) inside my own Juce application (e.g. by using the MidiKeyboardComponent) and not having to pass it to another VST plugin (like Sylenth1).

I tried this approach but it does nothing. The loadFromFXBFile checks if the plugin argument is of type VSTPluginInstance*, if not it just returns.

I’m passing an AudioPluginInstance pointer as the plugin argument. I can see the VSTPluginInstance class is declared inside juce_VSTPluginFormat.cpp file but I can’t refer to it so I can’t pass an object of that type. What is the plugin instance that you use to make oadFromFXBFile work?