HISE Logo Forum
    • Categories
    • Register
    • Login

    Can't access to functions in external files anymore?

    Scheduled Pinned Locked Moved Solved General Questions
    9 Posts 2 Posters 186 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.
    • ustkU
      ustk
      last edited by ustk

      Another weird thing:

      I cannot access functions in an included helper file anymore (like the remap function below) although I can access to constants within the same helper namespace...

      Interface: The product is successfully unlocked.
      Interface:! SpectrumAnalyser.js (100): Unknown function 'remap' {SW50ZXJmYWNlfFNwZWN0cnVtQW5hbHlzZXIuanN8MzE4MXwxMDB8MjM=}
      Align-IT:! SpectrumAnalyser.js (100): Unknown function 'remap' {SW50ZXJmYWNlfFNwZWN0cnVtQW5hbHlzZXIuanN8MzE4MXwxMDB8MjM=}
      Interface: CustomLAF.js (113): Unknown function 'remap' {SW50ZXJmYWNlfEN1c3RvbUxBRi5qc3wyNDI0fDExM3wyMw==}
      

      Simplified code looks like this:

      include("../../_SCRIPTS/helper.js");
      
      var x = helper.remap(0, 1, 0, 50,  value);
      

      Simplified helper file:

      namespace helper
      {
          const var constantExample = 20;
          
          // Remap
          inline function remap(inMin, inMax, outMin, outMax, value)
          {
              local t = invLerp(inMin, inMax, value);
              return lerp(outMin, outMax, t);
          }
      }
      

      Can't help pressing F5 in the forum...

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

        @ustk Did you include helper.js before the other scripts?

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

        ustkU 2 Replies Last reply Reply Quote 0
        • ustkU
          ustk @d.healey
          last edited by

          @d-healey Yep it's top in my onInit script

          Can't help pressing F5 in the forum...

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

            @ustk Oh don't use relative paths. Use the {PROJECT_FOLDER} wildcard (or the global scripts one).

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

            ustkU 1 Reply Last reply Reply Quote 1
            • ustkU
              ustk @d.healey
              last edited by

              @d-healey And it always worked before, as I'm coming back on my projects, nothing has changed since then.
              So my guess is that Hise has more security maybe that prevents a few older things to work...?

              Can't help pressing F5 in the forum...

              1 Reply Last reply Reply Quote 0
              • ustkU
                ustk @d.healey
                last edited by

                @d-healey You mean duplicating my helper in the project's folder? Because I like having only one I can reference from all projects...

                Can't help pressing F5 in the forum...

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

                  @ustk

                  Because I like having only one I can reference from all projects...

                  That's what the global scripts folder is for. https://docs.hise.audio/working-with-hise/settings/development.html#global-script-path

                  I made a video about it, currently on Patreon.

                  Just a moment...

                  favicon

                  (www.patreon.com)

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

                  ustkU 2 Replies Last reply Reply Quote 1
                  • ustkU
                    ustk @d.healey
                    last edited by

                    @d-healey Oh yes of course I'll use that then. I never did because I reckon it was broken at the beginning so I totally forgot it... Cheking this solution ;)

                    Can't help pressing F5 in the forum...

                    1 Reply Last reply Reply Quote 0
                    • ustkU
                      ustk @d.healey
                      last edited by

                      @d-healey That did it! 😎
                      So Hise certainly was more permissive before...

                      Can't help pressing F5 in the forum...

                      1 Reply Last reply Reply Quote 1
                      • ustkU ustk marked this topic as a question on
                      • ustkU ustk has marked this topic as solved on
                      • First post
                        Last post

                      33

                      Online

                      1.7k

                      Users

                      11.7k

                      Topics

                      102.0k

                      Posts