Sending DATA from a plugin to another plugin

Here’s the deal, I’m doing a multi-preset system and so far what I do is just host another copy of the plugin itself to load another preset. But for that to work I need to tell the just loaded instance that it is not a MASTER instance. What would be the easiest way to do this? I know I can use the state information, but I will need to create and read FXP files for that. (done that on Wusik Station V7 years ago with JUCE). Or use a NamedPipe, but it requires some thinking on threads…

Anyway, any tip would be much appreciated. Thanks! :slight_smile:

Cheers, WilliamK

My suggestion would be a juce::InterprocessConnection based mechanism.
On startup, the plug-in tries to host a juce::InterprocessConnectionServer (socket-based) on a fixed port. If that fails, it means that another instance of the plug-in is already hosting the server on the port. Then, you can connect to that server as the client (slave) and exchange data.

1 Like

Thanks, will check that one out. :slight_smile:

Cheers, WilliamK

If you need some concrete code, I can help you with that :slight_smile:

I just worry about the handshake using the same thread. Tomorrow I will try a few things out and place the code. TXS again.

Ok, this is driving me nuts, literally. :wink: With the NamedPipe I can talk to any VST instance 32/64 bits without problems. BUT, VST3 doesn’t find the NamedPipe, why? I guess I should try something else instead… :frowning:

Ok, my best bet is to use:

VSTPluginFormat::setChunkData

And only re-host the VST2 format, and not the VST3 format. It works great, at least gives me time to figure out how the VST3 format works in depth…

Cheers, WilliamK

Why are you doing something VST-specific? There’s nothing forcing you to use a NamedPipe, a Socket connection (e.g. with InterprocessConnectionServer) works just fine on any platform/plug-in format.

Indeed, but for some unknown reason the VST3 format gives me a hard time, maybe something I’m doing wrong. It works on VST, but not VST3. :frowning:

A possible explanation could be, since an NamedPipe is a 1:1 connection (other than an IPC via a socket), if your host is creating your plugin twice, the NamedPipe is already connected to the first instance of the plugin.
Some hosts create a plugin instance in the background, to make any kind of tests with it, before creating the actual plugin instance, that your user will see.