How to Load .vstpreset Files Exported from Reaper into a JUCE App

Hi everyone,

I’m working on a JUCE-based app and I need to load .vstpreset files that I exported from Reaper into a VST3 plugin instance. The goal is to apply the preset and have the plugin reflect the saved state exactly as it was in Reaper.

What I’ve Tried:

  1. I attempted to load the .vstpreset file as raw binary data using juce::File::loadFileAsData() and pass it to setStateInformation.
    Unfortunately, this didn’t work — the plugin doesn’t update, suggesting the .vstpreset format may need to be processed differently.
  2. I examined the .vstpreset file in a text editor. It contains:
  • A mix of binary data.
  • Some readable text metadata (parameter names, values, and JSON-like information).

I need to programmatically load and apply .vstpreset files to a VST3 plugin instance using JUCE.

How can I properly load and apply .vstpreset files to a VST3 plugin in JUCE?
Is there a specific way to extract the binary chunk/state from the .vstpreset file and pass it to setStateInformation?

Any guidance or suggestions would be greatly appreciated!