HISE Logo Forum
    • Categories
    • Register
    • Login

    Global Variables || Global Icon Paths in namespaces?

    Scheduled Pinned Locked Moved Scripting
    8 Posts 3 Posters 63 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.
    • ChazroxC
      Chazrox
      last edited by Chazrox

      I want to create a namespace with all my icon 'paths' saved as 'global' variables so I can just call on them from anywhere when LAFing. I dont want to keep them in onInit script if possible. Is this a good practice?

      If not can you recommend a good way to keep these long path strings in order somewhere?

      Thanks! 🙏

      Christoph HartC d.healeyD 2 Replies Last reply Reply Quote 0
      • Christoph HartC
        Christoph Hart @Chazrox
        last edited by

        @Chazrox Why are you "LAFing" anywhere else than in your main interface script?

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

          @Christoph-Hart is that a bad practice to have my LAF functions in an external script / namespace?

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

            @Chazrox said in Global Variables || Global Icon Paths in namespaces?:

            Is this a good practice?

            Using an external file is good practice. Don't use a global variable though. Just import the file into each script you want to use it in.

            Your question brings up something I was wanting to ask Christoph too. If we build a fancy GUI for non-interface midi processors, how does that affect performance? Will it all be stripped out at compile time?

            I was considering doing this because I thought it might make some of my scripted modules more approachable for other developers.

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

            ChazroxC 2 Replies Last reply Reply Quote 0
            • ChazroxC
              Chazrox @d.healey
              last edited by

              @d-healey

              @d-healey said in Global Variables || Global Icon Paths in namespaces?:

              Just import the file into each script you want to use it in.

              Thanks.

              1 Reply Last reply Reply Quote 0
              • ChazroxC
                Chazrox @d.healey
                last edited by

                @d-healey

                @d-healey said in Global Variables || Global Icon Paths in namespaces?:

                more approachable for other developers.

                I think this is always a great idea! 👌

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

                  . If we build a fancy GUI for non-interface midi processors, how does that affect performance? Will it all be stripped out at compile time?

                  No of course not, but the paint routines might not be called until the interface is visible. Timer callbacks might be executed though.

                  I was considering doing this because I thought it might make some of my scripted modules more approachable for other developers.

                  Can you make an example of what customization makes internal scripts "more approachable"?

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

                    @Christoph-Hart said in Global Variables || Global Icon Paths in namespaces?:

                    Can you make an example of what customization makes internal scripts "more approachable"?

                    Here's a script for handling guitar picking

                    fbb92c17-f5df-4c3f-b1df-74a5a150e782-image.png

                    Here's the front end view that the users see

                    4f8476f7-31b3-4bdf-84fe-5d60719ee565-image.png

                    Making the back-end look a bit more like the front end would make it easier for developers to understand how the two things relate, without having to look into the script so much.

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

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

                    36

                    Online

                    1.8k

                    Users

                    12.2k

                    Topics

                    106.1k

                    Posts