HISE Logo Forum
    • Categories
    • Register
    • Login

    Modulator level broadcaster

    Scheduled Pinned Locked Moved Feature Requests
    broadcasterlistener
    33 Posts 4 Posters 1.9k 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.
    • d.healeyD
      d.healey @Christoph Hart
      last edited by

      @Christoph-Hart Yes

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

        @d-healey then you can attach a global cable to the modulator and a broadcaster to the global cable.

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

          @Christoph-Hart Which attach function do I use to attach the broadcaster to the cable?

          Also, any reason I shouldn't do it this way?

          const var gm = Engine.getGlobalRoutingManager();
          const var c = gm.getCable("Global LFO 1");
          
          c.connectToGlobalModulator("LFO Modulator1", true);
          
          const var Knob1 = Content.getComponent("Knob1");
          
          c.registerCallback(function(value) {Knob1.setValue(value);}, false);
          
          Christoph HartC 1 Reply Last reply Reply Quote 0
          • Christoph HartC
            Christoph Hart @d.healey
            last edited by

            You just pass in the broadcaster into the registerCallback() function and then it will distribute it to its listeners:

            const var rm = Engine.getGlobalRoutingManager();
            
            const var lfo_cable = rm.getCable("LFO");
            lfo_cable.connectToGlobalModulator("LFO Modulator1", true);
            
            const var bc = Engine.createBroadcaster({
            	"id": "Mod Output",
            	"args": ["value"]
            });
            
            // Use the broadcaster instead of a function
            lfo_cable.registerCallback(bc, AsyncNotification);
            
            
            bc.addListener("", "logger", function(value)
            {
            	//Console.print(value);
            });
            

            Whether you want a broadcaster or directly use a function is up to your project layout, but using a broadcaster will get you more flexibility.

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

              @Christoph-Hart And if you want to connect it to a knob, you even don't need to script that, but let the addComponentValueListener() function do its job:

              bc.addComponentValueListener("Knob1", "direct link", "");
              
              d.healeyD 1 Reply Last reply Reply Quote 1
              • d.healeyD
                d.healey @Christoph Hart
                last edited by

                @Christoph-Hart Thank you. Yes the broadcaster solution will be more suitable here because I have multiple controls being linked to the LFO.

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

                  This post is deleted!
                  1 Reply Last reply Reply Quote 0
                  • d.healeyD
                    d.healey
                    last edited by

                    Now I'm thinking this may just look annoying and not be very useful. What does the group think?

                    Peek 2023-04-23 15-02.gif

                    LindonL 1 Reply Last reply Reply Quote 0
                    • LindonL
                      Lindon @d.healey
                      last edited by

                      @d-healey well it might work better is your modulator wasnt running so fast...

                      HISE Development for hire.
                      www.channelrobot.com

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

                        @Lindon But the faster the better, no? :) In the end I won't be able to control what speed the user sets it to so I'm going for ugliest scenario here.

                        LindonL 1 Reply Last reply Reply Quote 0
                        • LindonL
                          Lindon @d.healey
                          last edited by

                          @d-healey well its really up to the user as you say - as a user if I set my modulator speed high then I would expect it to show me something like you have....

                          HISE Development for hire.
                          www.channelrobot.com

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

                            You can add a simple low pass filter on the scripting layer to the values if you want to smooth fast changes.

                            1 Reply Last reply Reply Quote 1
                            • orangeO orange referenced this topic on
                            • First post
                              Last post

                            26

                            Online

                            1.7k

                            Users

                            11.9k

                            Topics

                            103.6k

                            Posts