HISE Logo Forum
    • Categories
    • Register
    • Login

    Get level from a scriptnode module?

    Scheduled Pinned Locked Moved General Questions
    7 Posts 3 Posters 371 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.
    • T
      tomekslesicki
      last edited by

      Is there a way to get level off a specific scriptnode module? I’m thinking about something like .getCurrentLevel but measured on a node level, if that makes sense?

      Matt_SFM 1 Reply Last reply Reply Quote 0
      • Matt_SFM
        Matt_SF @tomekslesicki
        last edited by

        @tomekslesicki following, it would be nice to have this

        Develop branch
        Win10 & VS17 / Ventura & Xcode 14. 3

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

          @Matt_SF use a peak node and connect it to a global_cable node, then register a script callback to it in your interface script.

          T Matt_SFM 2 Replies Last reply Reply Quote 1
          • T
            tomekslesicki @Christoph Hart
            last edited by

            @Christoph-Hart sounds great! How can I register the script, though?

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

              @Christoph-Hart oh nice! thanks
              @tomekslesicki I'll try it tonight

              Develop branch
              Win10 & VS17 / Ventura & Xcode 14. 3

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

                // Create an instance of the global routing manager
                const var gm = Engine.getGlobalRoutingManager();
                
                // Get the cable that you want to listen to
                const var cable = gm.getCable("MyCable");
                
                inline function onCableChange(value)
                {
                	Console.print(value);
                }
                
                // Attach a callback to changes
                // false => asynchronous execution on UI thread
                cable.registerCallback(onCableChange, false);
                

                Be aware that this breaks compileability of the node so you can't use this with a HardcodedFX module.

                T 1 Reply Last reply Reply Quote 2
                • T
                  tomekslesicki @Christoph Hart
                  last edited by

                  @Christoph-Hart epic, thank you!

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

                  23

                  Online

                  1.7k

                  Users

                  11.8k

                  Topics

                  103.1k

                  Posts