HISE Logo Forum
    • Categories
    • Register
    • Login

    Macro Control for ScriptNode

    Scheduled Pinned Locked Moved Feature Requests
    14 Posts 3 Posters 351 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 @toxonic
      last edited by

      @toxonic But then you will not be able to use macros too even if at some glorious day in the future it might be added (spoiler alert: it won't).

      You need to think of compiled networks as black boxes with no outside connections except for the parameters and external data slots.

      toxonicT 1 Reply Last reply Reply Quote 2
      • toxonicT
        toxonic @Christoph Hart
        last edited by

        @Christoph-Hart Ah, okay, i see! :-) Well, i think, I'll find another solution.
        I have several Faust effects, that depend on the Tempo from the DAW and which should be dynamically loaded into Hardcoded Master FX slots.
        But i guess, I can figure out, how to assign the "bpm" knobs of the FX dynamical to the Transport Handler tempoChange function....

        1 Reply Last reply Reply Quote 0
        • toxonicT
          toxonic
          last edited by

          As it seems, I don't get it working... 😞
          I can't figure out, why I am not able to pass a component (knob, ...) to an inline function.
          I seem to have a deep misunderstanding of what's going on there.
          Can someone help, please?

          const var Knob1 = Content.getComponent("Knob1");
          
          const TH = Engine.createTransportHandler();
          
          inline function tempoChange(newTempo) // <-- trying inline function tempoChange(component, newTempo) doesn't work...
          {
          	//component.setValue(newTempo);
          }
          
          TH.setOnTempoChange(SyncNotification, tempoChange);```
          d.healeyD 1 Reply Last reply Reply Quote 0
          • toxonicT
            toxonic
            last edited by toxonic

            EDIT: OOOOPS --- this is NOT WORKING!

            Okay, sorry... figured it out! :-)

            Content.makeFrontInterface(600, 500);
            const var Tempo = [Content.getComponent("Knob4"),
                               Content.getComponent("Knob3"),
                               Content.getComponent("Knob2"),
                               Content.getComponent("Knob1")];
            
            const var th = Engine.createTransportHandler();
            
            for (x in Tempo)
            {
            	th.setOnTempoChange(false, function(newTempo)
            	{
            	    x.set("text", newTempo + " BPM");
            	});
            }�
            
            d.healeyD 1 Reply Last reply Reply Quote 0
            • d.healeyD
              d.healey @toxonic
              last edited by

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

                @toxonic said in Macro Control for ScriptNode:

                 for (x in Tempo)
                 {
                 	th.setOnTempoChange(false, function(newTempo)
                 	{
                 	    x.set("text", newTempo + " BPM");
                 	});
                }
                

                You only have one th variable, so setting it's callback multiple times (as you are doing in your loop) does not make sense.

                I also don't think x will be available inside the callback function.

                toxonicT 1 Reply Last reply Reply Quote 0
                • toxonicT
                  toxonic @d.healey
                  last edited by toxonic

                  @d-healey Yeah, i don't know, what was wrong with me....
                  Maybe you have an idea?

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

                    @toxonic Your first idea looked correct, just use a function instead of an inline function.

                    toxonicT 1 Reply Last reply Reply Quote 0
                    • toxonicT
                      toxonic @d.healey
                      last edited by

                      @d-healey But won't I need to use an inline function for realtime?
                      What about using the loop inside the function? It seems to work, uh?

                      Content.makeFrontInterface(600, 500);
                      const var Tempo = [Content.getComponent("Knob4"),
                                         Content.getComponent("Knob3"),
                                         Content.getComponent("Knob2"),
                                         Content.getComponent("Knob1")];
                      
                      const var th = Engine.createTransportHandler();
                      
                      th.setOnTempoChange(false, function(newTempo)
                      {
                      	for (x in Tempo) x.setValue(newTempo);
                      });
                      
                      d.healeyD 1 Reply Last reply Reply Quote 0
                      • d.healeyD
                        d.healey @toxonic
                        last edited by

                        @toxonic

                        But won't I need to use an inline function for realtime?

                        No, and also your UI script should be deferred (non-realtime) anyway. I think all callback functions (except control callbacks) are non-inline.

                        Yeah a loop inside the function is fine. You might want to reverse the order of controls in your array, it seems strange that element 3 is knob 1, but it won't affect the functionality.

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

                        25

                        Online

                        1.7k

                        Users

                        11.8k

                        Topics

                        103.0k

                        Posts