HISE Logo Forum
    • Categories
    • Register
    • Login

    Why isn't this set parameter for a DSPNetwork node working?

    Scheduled Pinned Locked Moved General Questions
    8 Posts 3 Posters 278 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.
    • OrvillainO
      Orvillain
      last edited by

      Here's the snippet:

      HiseSnippet 1703.3oc4XstaaaCEVxIps1qEncn.a8eDFCsN.YI1cscEHWZtX6Ui03XDkFz+EvJQGSDZRAQJG6Mzmr828.rGk8Frcnnt4X2rDis1MLEfXQdtvOd34FEYrhv8I9mJ4zf.hxxxdodgBOhTJBsrKe7j.hk8ccbmvUC1e.lxs5zzx9dNmQTRhJ.GhGZs2j.rTR7srsW5GzrXWdYq3me+U6gYXtGIeJKqSDTOxanCop7Y6syORYr1XexwzgE39Y6zwSv2WvDQ.bVxotU.16b7YjtXMakbrruUKepRD5pvJhD3YOg+D2AhK3F9OgJoumQzCZX4BJxLs09CnL+rspD13NE13KY13Oz4.pOMa9bCv8iIfxknnMvtzUAoF2.HYW.RKafzCbb8BoApbJZ77ENc3JRXeLXpKBECuVkdSIm8E.Gb0ZCwmSZGBCxjn1KpWeUD7uU1nREJmQ4DT+HtmhJ3HyA8oCm.tHjwmFehS.AqsRketRYlvCyPbh5BQ34nsPs3mARuFHTSYPWyzGQ5SBIfSPspF3vE9DTrGEQRkjvFUWsZN6UATffGipiWzXA1JcYzZu1SxH7jo3GL3JCHAAx3QKRuLj+jblREFLNRAirVPHkqpkSWK3IXVDo1JIblqSoFFET0pn5q87aj99PkJeby6FYGABdWghbH2XxAoPWlT+9ykl9HOTvXomVWhrNTK7pDrFOZ36IgqhFogbFifu3zN32554f6Y7.Kvnf2gSUGFPRF2Vv70Nt52mMbvJwEFd6scZhUXcDRxb.eAjPEUCG6ljQPJFS7RYmlD44JQ.jjYlfIHLV3Gwvpois0IwRH.1ioBnzAMbIUMoXRtaP.e8qLf+5BwG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UPjr1Jkxq1rqit2Fkfz3YqcIpOF4CuccVOrD0WmbZlEVal2e5UoslwZx.Ley9LAVsJvPwUZdKyAcZ1AQFAGiSYggDI9LxqgCiVZZ0xd6wHxLv9swGYTY9kBUBDXPiBhWBxXHypdunQRh9ApsRlVaSpAtRREp3T.vWEo2jTtOY7Lqoa5AaVp64Zg5kXgjE+dY9hHHl.MpfR+vFUrrlww+Qy0we7PVlqu8u3r4qfIPiLcjrUUnHSUDzGgvGb11p5aOt829xpuZ6JU1LuJy1UPn7gnz5daUstV3zxdI5JslVB07RZF5wedtrmNM2pZdAxpnB5c8sqr45Ewfk0eBPccflA
      

      Here's the code:

      Content.makeFrontInterface(600, 600);
      
      inline function getset_my_snex_parameter()
      {
          local network = Engine.getDspNetworkReference("Scriptnode Synthesiser1","DspNetwork");
          local snex_node = network.get('snex_node');
          local test_param = snex_node.getParameter('test_param');
          Console.print(test_param.getValue());
          snex_node.set('test_param', 0.5);
          Console.print(test_param.getValue());
      }
      
      getset_my_snex_parameter();
      

      According to the docs:
      DspNetwork.get(var id) returns a reference to a node with the same id.
      Node.set(var id, var value) sets the property of the node.

      I believe this is what I'm doing. But the test_param never gets set to 0.5, and indeed the console prints 0.0 twice.

      Is there an undocumented call I should be using?

      Musician - Instrument Designer - Sonic Architect - Creative Product Owner
      Crafting sound at every level. From strings to signal paths, samples to systems.

      OrvillainO 1 Reply Last reply Reply Quote 0
      • OrvillainO
        Orvillain @Orvillain
        last edited by

        @Christoph-Hart
        Hey dude, is this a bug or am I just doing it wrong?

        Musician - Instrument Designer - Sonic Architect - Creative Product Owner
        Crafting sound at every level. From strings to signal paths, samples to systems.

        OrvillainO 1 Reply Last reply Reply Quote 0
        • OrvillainO
          Orvillain @Orvillain
          last edited by

          Any thoughts folks? I'm either incredibly dumb and need it pointing out to me in the most brutal way (I can take it!) orrrrr there really does seem to be a bug here.

          I do notice in my data view, the network gets retrieved and produces a value. But the node and test_param doesn't:

          baf66129-c639-40fb-9425-be427ee1e8d1-image.png

          This is what I get when I take everything out of the function and set it to const rather than local.

          Musician - Instrument Designer - Sonic Architect - Creative Product Owner
          Crafting sound at every level. From strings to signal paths, samples to systems.

          1 Reply Last reply Reply Quote 0
          • OrvillainO
            Orvillain
            last edited by

            I figured this out, only a year and a half late 🤣 🖖🏻

            reg network = Engine.getDspNetworkReference(PROCESSOR_ID, "network_name");
            network.setParameterDataFromJSON({"PARAMETER_NAME_STR": new_value});
            

            Or for an example:

            reg network = Engine.getDspNetworkReference("Script FX1", "dspnetwork");
            network.setParameterDataFromJSON({"GainVolume": 0.9});
            

            I'm using it in the callback of a combo box in order to set a parameter value, and it is working here.

            Musician - Instrument Designer - Sonic Architect - Creative Product Owner
            Crafting sound at every level. From strings to signal paths, samples to systems.

            ustkU 1 Reply Last reply Reply Quote 0
            • ustkU
              ustk @Orvillain
              last edited by

              @Orvillain I reckon using this prevents to compile the network because then, anything node or network related can't be accessed from the interface script, I am right?

              Hise made me an F5 dude, browser just suffers...

              Christoph HartC OrvillainO 2 Replies Last reply Reply Quote 0
              • Christoph HartC
                Christoph Hart @ustk
                last edited by Christoph Hart

                This would also work:

                https://docs.hise.dev/scripting/scripting-api/parameter/index.html#setvalueasync

                In your original post you were mixing up Properties and Parameters. The set() function modifies properties.

                I reckon using this prevents to compile the network because then, anything node or network related can't be accessed from the interface script, I am right?

                Yup. Once you compile this, the scriptnode API goes out the window. You can of course use a high-level interpreted network where you load in your compiled networks if you want to keep dynamic access to properties / parameters.

                ustkU 1 Reply Last reply Reply Quote 1
                • ustkU
                  ustk @Christoph Hart
                  last edited by

                  @Christoph-Hart said in Why isn't this set parameter for a DSPNetwork node working?:

                  You can of course use a high-level interpreted network where you load in your compiled networks if you want to keep dynamic access to properties / parameters.

                  oh yeah, haven't though about that 👍

                  Hise made me an F5 dude, browser just suffers...

                  1 Reply Last reply Reply Quote 0
                  • OrvillainO
                    Orvillain @ustk
                    last edited by

                    @ustk Yeah you're right. That's fine for my purposes right now, as I'm just blasting out a quick prototype for my delay plugin to send to a mate.

                    Musician - Instrument Designer - Sonic Architect - Creative Product Owner
                    Crafting sound at every level. From strings to signal paths, samples to systems.

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

                    14

                    Online

                    2.0k

                    Users

                    12.7k

                    Topics

                    110.4k

                    Posts