I shelved this idea for some time, but I’m coming back to it.
I want my plugin to be able to open a set of other plugins, all identical, and to pass info to and from them in order to achieve microtonal tuning abilities in plugins that weren’t designed for this. It should be mostly invisible to the user.
There should be one main plugin instance with which the user interacts and which never goes away. The others would receive all the same messages that the main one receives except pitch bend, note on and note off messages, which will be sent selectively.
So I’m working with some wrapper code I’ve been modifying, and the problem I’m running into is that both of the createPluginInstance methods of AudioPluginFormatManager work with unique_ptr . One returns the unique_ptr and the other passes it to the callback function.
If my intention from the beginning is to copy this instance and always have several of them, what’s the safest way to do it? What I have thought of:
- release the ptr? I haven’t looked into how this is done…
- deep copy?
- request as many plugin instances as I need from the same AudioPluginFormatManager, and keep that object and the plugin description in memory the whole time. Instead of copying the plugin instance, I request as many as I need.
My intuition tells me this last one will be the most efficient and safe. Any suggestions?