# Possible to load fxb/fxp files from disk?

**URL:** <https://forum.juce.com/t/possible-to-load-fxb-fxp-files-from-disk/20986>\
**Category:** Audio Plugins\
**Created:** [February 15, 2017, 7:46pm UTC](https://forum.juce.com/t/possible-to-load-fxb-fxp-files-from-disk/20986 "2017-02-15T19:46:23Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ricochet](https://avatars.discourse-cdn.com/v4/letter/r/3ec8ea/32.png) [@ricochet](https://forum.juce.com/u/ricochet)\
**Post date:** [February 15, 2017, 7:46pm UTC](https://forum.juce.com/t/possible-to-load-fxb-fxp-files-from-disk/20986/1 "2017-02-15T19:46:23Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![jrlanglois](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jrlanglois/32/21372_2.png) [@jrlanglois](https://forum.juce.com/u/jrlanglois)\
**Post date:** [February 15, 2017, 8:10pm UTC](https://forum.juce.com/t/possible-to-load-fxb-fxp-files-from-disk/20986/2 "2017-02-15T20:10:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ricochet](https://avatars.discourse-cdn.com/v4/letter/r/3ec8ea/32.png) [@ricochet](https://forum.juce.com/u/ricochet)\
**Post date:** [February 16, 2017, 10:10am UTC](https://forum.juce.com/t/possible-to-load-fxb-fxp-files-from-disk/20986/3 "2017-02-16T10:10:05Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![t0m](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/t0m/32/16413_2.png) [@t0m](https://forum.juce.com/u/t0m)\
**Post date:** [February 16, 2017, 5:20pm UTC](https://forum.juce.com/t/possible-to-load-fxb-fxp-files-from-disk/20986/4 "2017-02-16T17:20:49Z")

</div>

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());
```

---

<div class="post-metadata">

**Author:** ![ricochet](https://avatars.discourse-cdn.com/v4/letter/r/3ec8ea/32.png) [@ricochet](https://forum.juce.com/u/ricochet)\
**Post date:** [February 16, 2017, 8:25pm UTC](https://forum.juce.com/t/possible-to-load-fxb-fxp-files-from-disk/20986/5 "2017-02-16T20:25:06Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![gblaze](https://avatars.discourse-cdn.com/v4/letter/g/e95f7d/32.png) [@gblaze](https://forum.juce.com/u/gblaze)\
**Post date:** [July 31, 2017, 8:33pm UTC](https://forum.juce.com/t/possible-to-load-fxb-fxp-files-from-disk/20986/6 "2017-07-31T20:33:08Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![t0m](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/t0m/32/16413_2.png) [@t0m](https://forum.juce.com/u/t0m)\
**Post date:** [August 1, 2017, 1:23pm UTC](https://forum.juce.com/t/possible-to-load-fxb-fxp-files-from-disk/20986/7 "2017-08-01T13:23:33Z")

</div>

> [@Loading FXP](https://forum.juce.com/t/loading-fxp/23550/2):
>
> You can do that by using AudioPluginFormatManager: ScopedPointer\<AudioPluginFormatManager\> pluginFormatManager = new AudioPluginFormatManager(); pluginFormatManager-\>addDefaultFormats(); KnownPluginList plist; OwnedArray\<juce::PluginDescription\> pluginDescriptions; juce::VSTPluginFormat format; plist.scanAndAddFile(A\_PATH\_WITH\_YOUR\_PLUGINS, true, pluginDescriptions, format); // here you have to know which plugin should be used for creating your plugin instance AudioPluginInstance\* instance = pl…
