HISE Logo Forum
    • Categories
    • Register
    • Login

    Out of curiosity, why are external .js files not allowed inside a namespace?

    Scheduled Pinned Locked Moved Scripting
    6 Posts 4 Posters 323 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.
    • VirtualVirginV
      VirtualVirgin
      last edited by

      Screenshot 2025-06-10 at 2.50.16 PM.png

      I don't have any namespaces inside the .js file. Logically, why would I not be able to include it?
      If I can't, I'll just have to copy its contents into the namespace, which seems to counteract the tidiness of "include" files.

      You can listen to my orchestral mockups here:
      https://www.virtualvirgin.net/

      d.healeyD ChazroxC 2 Replies Last reply Reply Quote 1
      • d.healeyD
        d.healey @VirtualVirgin
        last edited by

        @VirtualVirgin I don't know actually.

        In this case I would put whatever content is inside your js file into a namespace called BeamGroupFormatsLut and include it on init (or within your Notation.js file but outside of the namespace).

        Then you can reference it easily and it maintains modularity and neatness.

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

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

          @VirtualVirgin Just doing some reading in the documentation and I found that it says that namespaces cant be nested. From my understanding, I think namespace and .js are synonymous in HISE so that would mean that you cant put a .js file inside of another .js file. Might just be built in security measure to avoid too deep of nesting.

          or I could be totally bonkers. lol.

          Screenshot 2025-06-10 at 2.36.54 PM.png

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

            @Chazrox said in Out of curiosity, why are external .js files not allowed inside a namespace?:

            I think namespace and .js are synonymous in HISE

            They're different. You can have several namespaces or no namespaces in a js file.

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

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

              @d-healey hmm 🤔

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

                I think the reason is just that the JS parser can‘t build namespaces across multiple files, but I don’t think there‘s a valid reason for touching that part of the codebase…

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

                20

                Online

                1.8k

                Users

                11.9k

                Topics

                104.0k

                Posts