JUCE vst3 Audio Plugin + Libtorch/Pytorch


I’m wondering if anyone has had success building Libtorch with JUCE and running it as a VST. Could you provide a code example of this, or a quick guide on how you got everything set up?

I am using cmake to build JUCE and libtorch (following these examples: Installing C++ Distributions of PyTorch — PyTorch master documentation, JUCE/CMake API.md at master · juce-framework/JUCE · GitHub) which works fine for a standalone application, but when I try to run the vst it fails. I believe this is because the vst cannot find the required torch .dll files.

My understanding is that I may need to load libtorch as a dynamic library using JUCE::DynamicLibrary (JUCE: DynamicLibrary Class Reference), however I can’t find examples of how to do this online and I am fairly new to c++ so I am having a hard time figuring it out on my own.

Any help is appreciated. Thank you!