HISE Logo Forum
    • Categories
    • Register
    • Login

    Getting an Array of ScriptNode Parameter IDs?

    Scheduled Pinned Locked Moved Unsolved ScriptNode
    5 Posts 2 Posters 97 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.
    • clevername27C
      clevername27
      last edited by

      Does anyone know how to get an array of parameter IDs for a ScriptNode Network (e.g. ScriptNode Synth)?

      Instead of keeping track of all the parameter names, I want search by string for a parameter, and if it exists, change the parameter value.

      Thanks!

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

        @clevername27 Assuming it works like a regular effect you can use Effect.getNumAttributes() to loop over all the parameters, and use Effect.getAttribute() or Effect.getAttributeId() as needed.

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

        clevername27C 1 Reply Last reply Reply Quote 1
        • clevername27C
          clevername27 @d.healey
          last edited by clevername27

          @d-healey It does, thank you!

          The only part I can't seem to get is using getAttributeIndex() to search by string for the corresponding parameter ID. When I pass in a parameter name, the returned index is always -1. This implies that there's some way to format the parameter name that I'm not doing?

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

            @clevername27 It's case sensitive if that makes a difference. You could also do a comparison with Effect.getAttributeId(i) == mySearchString

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

            clevername27C 1 Reply Last reply Reply Quote 1
            • clevername27C
              clevername27 @d.healey
              last edited by

              @d-healey Thank you, yes the comparison will work. For some reason, getAttribute() works with the string I pass, but not getAttributeIndex(). In any case, I've got all my answers, and thank you as always.

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

              11

              Online

              1.7k

              Users

              11.9k

              Topics

              103.4k

              Posts