How to send flag between two independent plugins?


How to check what is:





Hey :slight_smile: don’t laugh at me. Please :slight_smile:

OK so I tried to make:
NamedPipe* nameOfPipe = getPipe();

But it returns the name of the pipe which I created. But I call it in connectionMade() So I expect the name of connected plugin or pipe. Hot to see it?


I made that:
in first plugin I used myFirstPluginConnection.createPipe("myUnique PluginName", -1, false);

And in another plugin I made:
mySecondPluginConnection.connectToPipe("myUnique PluginName", -1);

And then:
MemoryBlock someBlck;

So I expect the last line should call in the first plugin method messageReceived. But It doesn’t work. Why?


When you create the pipe in the constructor and the other plugin connects to it also in its constructor, the order of instanciating the plugins is important. The second one could use a timer to try connecting if it fails to.

But first of all: have you ,ade sure opening the pipe works? If you can‘t open one, everything else is not important at the moment.

if (createPipe("Pipe's name", -1))
        DBG ("Pipe created!");
        auto pipe = getPipe();
        DBG (pipe->getName());
        DBG ("Creating pipe failed");

With that code you can test it. It should write to the console:

Pipe opened!
Pipe's name


Maybe pipes are not even supposed to work within the same process? Might be worth trying out the sockets based thing instead.


Hello, yes, createPipe(„uniqueName”, -1); gives me true. But createPipe(„uniqueName”, -1, true); gives me false. I have no idea why. There is no other pipe named „uniqueName”. So why it gives me false.

In the other hand you say to use timer to be sure it always try to connect. But according to documentation „-1” provide neverending try to connect. So for what to use timer?


OK, it has just started work for me. But still I am even not sure how I made that. :slight_smile:
I need to study that


Just tested it with a standalone plugin opening the pipe and also connecting to it. So same process works :slight_smile:

That’s not retrying to connect, just the receiveMessage timeout value.


Ok. Understand. But there is one more question. What happen (I can’t test it now) if I have myFirstPlugin opened once, and mySecondPlugin opened 2 (or more)? All 3 (or more) will be connected?
How to ensure each instance of plugin has separate connection with each instance of other plugin?
I could imagine that each instanse of plugin could has some static integer, like newConnect++;
And in receivedMessage(), just set some switch.
But maybe there is better solution?


It’s just a peer-to-peer connection, so only two will be connected. Even with a static integer, you have to make sure your instances will be created in the right order (however, I guess DAWs will do this bus-by-bus, so you should be fine after reloading the project).
Alternatively, you could simply create a parameter which selects the channel you want to connect to.

However: for your project (measuring the impulse response of another plugin), @Xenakios’s suggestion is probably a very good idea:

This way you only need one plug-in (or just use it as a standalone), no communication needed. And you do not have to set the desired IR length twice. You can also fire your measurement impulse by clicking a button. So many possibilities :slight_smile:

If you decide so: take a look at JUCE’s plug-in host code, I think there are a lot of useful code snippets for instantiating other plug-ins, open up their GUIs, …


Hello, thanks.
Your talking about host sounds quite nice. But does it allow me to host plugin which is in other insert slot in Logic Pro?
My aim is to be able in the midle of recording (or mixing or other) session check what do with freq and phase all plugins in the track, with all of their settings. So the best solution seem to be if I can just throw my impulse generator plugin before all plugins in the track, and my analyser after all those plugins. Does juce host code allows me to provide such functionality?


I‘d say this depends a bit on the desired workflow.
If you have set up a certain plugin chain while mixing, I think you would need to save all plugin settings and rebuild the plugin chain in your own host to then measure the chain. The plugins hosted inside your plugin could still be put into the signal chain of your DAW project, so the user could also start with putting an instance of each plugin at each track and then would build up his own plugin chain into your plugin. Besides that this would make automating the plugins quite impossible I wouldn’t like this workflow as an end user. So maybe you’re in fact better of with your approach. In the end, for me this seems to be a clever feature that would best be part of a DAW itself instead of being put into plugins :confused: