HISE Logo Forum
    • Categories
    • Register
    • Login

    Possible to communicate between plugins?

    Scheduled Pinned Locked Moved General Questions
    32 Posts 7 Posters 2.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Christoph HartC
      Christoph Hart @ulrik
      last edited by

      The most sane approach would be OSC messages.

      ulrikU 1 Reply Last reply Reply Quote 1
      • ulrikU
        ulrik @Christoph Hart
        last edited by

        @Christoph-Hart sounds exiting, thanks :)

        Hise Develop branch
        MacOs 15.3.1, Xcode 16.2
        http://musikboden.se

        Christoph HartC 1 Reply Last reply Reply Quote 0
        • Christoph HartC
          Christoph Hart @ulrik
          last edited by

          @ulrik I think @d-healey played around with OSC and cross-plugin communication for auto-dividi scripts so he might jump in with some experiences.

          1 Reply Last reply Reply Quote 0
          • d.healeyD
            d.healey
            last edited by

            I haven't got around to trying it myself yet but Christoph posted an example for me

            Link Preview Image
            OSC has arrived.

            So you can send OSC messages between two HISE instances, so I guess it should work between plugins too. HISE 1: const var rm = Engine.getGlobalRoutingManager...

            favicon

            Forum (forum.hise.audio)

            Libre Wave - Freedom respecting instruments and effects
            My Patreon - HISE tutorials
            YouTube Channel - Public HISE tutorials

            Christoph HartC 1 Reply Last reply Reply Quote 1
            • Christoph HartC
              Christoph Hart @d.healey
              last edited by

              @d-healey Ah yes, now I remember that was me :)

              ulrikU 3 Replies Last reply Reply Quote 2
              • ulrikU
                ulrik @Christoph Hart
                last edited by

                @Christoph-Hart I've got it working, from one vst3 plugin to another vst3 plugin in the same daw :)

                I've set it up so I have one main plugin, sending information via OSC and a "receiver" plugin and it works nicely but if I use more than 1 instance of the receiver plugin, only 1 of them is receiving the data, why is that?
                Is it possible to make all of them receive the data?

                Hise Develop branch
                MacOs 15.3.1, Xcode 16.2
                http://musikboden.se

                1 Reply Last reply Reply Quote 3
                • ulrikU
                  ulrik @Christoph Hart
                  last edited by ulrik

                  @Christoph-Hart Do I need a "SourcePort" per instance maybe?
                  And set the port when it's already loaded..hmm... I'll try some things

                  Hise Develop branch
                  MacOs 15.3.1, Xcode 16.2
                  http://musikboden.se

                  1 Reply Last reply Reply Quote 0
                  • ulrikU
                    ulrik @Christoph Hart
                    last edited by ulrik

                    @Christoph-Hart I'm not able to have more than 1 instance of the receiver plugin, this is my setup

                    This is the "main" plugin that sends information to the receiver plugins
                    The "subdomains" array is working great, I'm able to switch between the sub domains while running.

                    Also the callback works, it will receive data from the all the instances of the receiver plugin, and I can clearly see from which instance it comes.

                    But only 1 of the receivers get the send data, even though the "dead" instances can send back to the "main" plugin.

                    //	Testing communiction between plugins
                    const subdomains = ["/ch1", "/ch2", "/ch3", "/ch4"];
                    
                    const var rm = Engine.getGlobalRoutingManager();
                    rm.connectToOSC({
                    	"SourcePort": 6666,
                    	"TargetPort": 6667,
                    	"Domain": "/ostinarp"
                    }, 0);
                    
                    
                    inline function OSCCallback(id, value)
                    {
                    	LogLbl1.set("text", value);
                    };
                    
                    for (i = 0; i < 4; i++)
                    	rm.addOSCCallback(subdomains[i], OSCCallback);
                    

                    This is how I set up the receiver plugins

                    const var rm = Engine.getGlobalRoutingManager();
                    rm.connectToOSC({
                    	"SourcePort": 6667, // Note how the source port and target port are
                    	"TargetPort": 6666, // reversed here to allow bidirectional communication
                    	"Domain": "/ostinarp"
                    }, 0);
                    
                    
                    inline function OSCCallback(id, value)
                    {
                    	local ch = ChannelKnob.getValue();
                    	
                    	if (value[0] == ch)
                    	{
                    		local ev = Synth.addNoteOn(value[0], value[1], value[2], 0);
                    		Synth.noteOffDelayedByEventId(ev, value[3]);
                    		
                    		LogPanel.setValue(value);
                    		LogPanel.repaint();
                    		
                    		rm.sendOSCMessage(subdomains[ch-1], "Hi there from "+subdomains[ch-1]);
                    	}
                    };
                    
                    

                    What have done wrong?

                    Hise Develop branch
                    MacOs 15.3.1, Xcode 16.2
                    http://musikboden.se

                    ulrikU 1 Reply Last reply Reply Quote 1
                    • ulrikU
                      ulrik @ulrik
                      last edited by

                      @ulrik and the data sent is an array, and that works great

                      Hise Develop branch
                      MacOs 15.3.1, Xcode 16.2
                      http://musikboden.se

                      ulrikU 1 Reply Last reply Reply Quote 0
                      • ulrikU
                        ulrik @ulrik
                        last edited by

                        @Christoph-Hart is it possible to send to more than 1 "TargetPort"

                        const var rm = Engine.getGlobalRoutingManager();
                        rm.connectToOSC({
                        	"SourcePort": 6666,
                        	"TargetPort": several ports,
                        	"Domain": "/ostinarp"
                        }, 0);
                        

                        Hise Develop branch
                        MacOs 15.3.1, Xcode 16.2
                        http://musikboden.se

                        ? lalalandsynthL 2 Replies Last reply Reply Quote 0
                        • ?
                          A Former User @ulrik
                          last edited by

                          @ulrik Does

                          rm.connectToOSC({
                          	"SourcePort": 6666,
                          	"TargetPort":  [1234, 5678],
                          	"Domain": "/ostinarp"
                          }, 0);
                          

                          Work?

                          1 Reply Last reply Reply Quote 0
                          • lalalandsynthL
                            lalalandsynth @ulrik
                            last edited by

                            @ulrik I am not very familiar with OSC but I am assuming this would need a user to install OSC specifically to use this ?

                            https://lalalandaudio.com/

                            https://lalalandsynth.com/

                            https://www.facebook.com/lalalandsynth

                            https://www.facebook.com/lalalandsynth

                            Christoph HartC 1 Reply Last reply Reply Quote 0
                            • Christoph HartC
                              Christoph Hart @lalalandsynth
                              last edited by

                              @lalalandsynth Nope, OSC is a network protocol and doesn't need any 3rd party software.

                              However I don't have too much knowledge about OSC, I just implemented a wrapper around the JUCE classes so I can imagine that port numbers need to be exclusive in order to receive messages.

                              "TargetPort":  [1234, 5678],
                              

                              pretty sure this will not work, because I implemented this and the TargetPort property gets parsed as a single integer value, but I can try to take a look at this and create multiple OSC senders which send the same message to multiple target ports here. Not sure when I find the time for that though...

                              ulrikU 2 Replies Last reply Reply Quote 3
                              • ulrikU
                                ulrik @Christoph Hart
                                last edited by

                                @Christoph-Hart @lalalandsynth I've tried using an array but it will not work, at least not the way I've set it up

                                Hise Develop branch
                                MacOs 15.3.1, Xcode 16.2
                                http://musikboden.se

                                1 Reply Last reply Reply Quote 0
                                • ulrikU
                                  ulrik @Christoph Hart
                                  last edited by

                                  @Christoph-Hart Using only 1 sender and 1 receiver works great, also using using different sub domain.

                                  When the first receiver instance has successfully connected and is receiving data, it is like this instance is blocking the senders port so the second instance is not able to connect.
                                  If that is the case, it would be great if the sender could send on several ports.

                                  And as I understand it, you can't use

                                  Engine.getGlobalRoutingManager();
                                  

                                  for more than one time right?

                                  Hise Develop branch
                                  MacOs 15.3.1, Xcode 16.2
                                  http://musikboden.se

                                  1 Reply Last reply Reply Quote 0
                                  • ?
                                    A Former User
                                    last edited by A Former User

                                    Guys sorry about my ignorance.

                                    What are the use cases of the communication between the plugins?
                                    What does this feature stand for?

                                    ulrikU 1 Reply Last reply Reply Quote 0
                                    • ulrikU
                                      ulrik @A Former User
                                      last edited by

                                      @harris-rosendahl in my case I wan't to send midi information from a multichannel arpeggiator (which will not work in some daws), to several "receiver! plugins to control multi instruments

                                      Hise Develop branch
                                      MacOs 15.3.1, Xcode 16.2
                                      http://musikboden.se

                                      lalalandsynthL 1 Reply Last reply Reply Quote 0
                                      • lalalandsynthL
                                        lalalandsynth @ulrik
                                        last edited by

                                        @ulrik Could I for example control a gain module on track 2, and having my main control module on track 1?

                                        https://lalalandaudio.com/

                                        https://lalalandsynth.com/

                                        https://www.facebook.com/lalalandsynth

                                        https://www.facebook.com/lalalandsynth

                                        Christoph HartC ulrikU 2 Replies Last reply Reply Quote 0
                                        • Christoph HartC
                                          Christoph Hart @lalalandsynth
                                          last edited by

                                          @lalalandsynth Be careful about "persistent" states in conjunction with OSC, this is one of the main drawbacks I found in this protocol because restoring these settings from a DAW project will not restore the values (especially because you can't guarantee that the gain module 2 exists already when the gain module 1 is created and restored).

                                          1 Reply Last reply Reply Quote 1
                                          • ulrikU
                                            ulrik @lalalandsynth
                                            last edited by ulrik

                                            @lalalandsynth
                                            If I understand you right, yes

                                            In you main plugin

                                            const var rm = Engine.getGlobalRoutingManager();
                                            
                                            rm.connectToOSC({
                                            	"SourcePort": 6666,
                                            	"TargetPort": 6667,
                                            	"Domain": "/receiver"
                                            }, function(printError)
                                            {
                                            	Console.print(printError);
                                            });
                                            //     In you gain callback
                                            inline function onGainControl(component, value)
                                            {
                                                  rm.sendOSCMessage("/gain", value);
                                            }
                                            
                                            Content.getComponent("Gain").setControlCallback(onGainControl);
                                            

                                            In you receiver plugin

                                            const var rm = Engine.getGlobalRoutingManager();
                                            
                                            rm.connectToOSC({
                                            	"SourcePort": 6667, 
                                            	"TargetPort": 6666, 
                                            	"Domain": "/receiver"
                                            }, function(printError)
                                            {
                                            	Console.print(printError);
                                            });
                                            
                                            
                                            inline function OSCCallback(id, value)
                                            {
                                            	Track2Gain.setValue(value);
                                                    Track2Gain.changed();
                                            };
                                            
                                            rm.addOSCCallback("/gain", OSCCallback);
                                            

                                            Hise Develop branch
                                            MacOs 15.3.1, Xcode 16.2
                                            http://musikboden.se

                                            ulrikU 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            42

                                            Online

                                            1.7k

                                            Users

                                            11.7k

                                            Topics

                                            101.8k

                                            Posts