HISE Logo Forum
    • Categories
    • Register
    • Login

    Unknown Functions 'set' & 'getRange'

    Scheduled Pinned Locked Moved Scripting
    15 Posts 3 Posters 799 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.
    • d.healeyD
      d.healey @trillbilly
      last edited by

      @trillbilly An unknown function error means the thing on the left side of the . does not have the function you are trying to call.

      This could be because you've used the wrong variable type or because it's undefined.

      Free HISE Bootcamp Full Course for beginners.
      YouTube Channel - Public HISE tutorials
      My Patreon - HISE tutorials

      trillbillyT 1 Reply Last reply Reply Quote 0
      • trillbillyT
        trillbilly @d.healey
        last edited by

        @d-healey Ahhh ok. So now I need to figure out what was changed, and how, because those functions were working just hours earlier.

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

          @trillbilly Is it because the sample map is not loaded?

          Free HISE Bootcamp Full Course for beginners.
          YouTube Channel - Public HISE tutorials
          My Patreon - HISE tutorials

          trillbillyT 1 Reply Last reply Reply Quote 0
          • trillbillyT
            trillbilly @d.healey
            last edited by

            @d-healey You're right, when I load an internal sample map, it works. But it wont work anymore with Drag-And-Drop samples.

            I would rather use the sample maps from internal samples, but, you cant edit the loop range. I've made a post about it HERE.

            Also, obiviously Im using custom sample import so users can use their own samples. Im confused why it doesnt recognize them as sample maps anymore?

            trillbillyT 1 Reply Last reply Reply Quote 0
            • trillbillyT
              trillbilly @trillbilly
              last edited by

              @d-healey Ok, scratch that. its working ONLY if there is a sample loaded. If the sampler is cleared, it throws the error.

              If you save a preset without a sample/samplemap loaded, it will save but crash upon opening it again.

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

                @trillbilly So before you try to call a function on the sound object you need to check if the object is populated.

                if (!isDefined(sound))
                    return;
                

                Free HISE Bootcamp Full Course for beginners.
                YouTube Channel - Public HISE tutorials
                My Patreon - HISE tutorials

                trillbillyT 2 Replies Last reply Reply Quote 0
                • trillbillyT
                  trillbilly @d.healey
                  last edited by

                  @d-healey That will work better than my idea of populating an empty samplemap when a sampler is not in use. Thank you.

                  1 Reply Last reply Reply Quote 0
                  • trillbillyT
                    trillbilly @d.healey
                    last edited by

                    @d-healey It solved the sound.set issue but not the sound.getRange issue.

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

                      @trillbilly This line?

                      local newValue = parseInt(sound.getRange(Sampler1.LoopXFade)[1] * value);

                      Free HISE Bootcamp Full Course for beginners.
                      YouTube Channel - Public HISE tutorials
                      My Patreon - HISE tutorials

                      trillbillyT 1 Reply Last reply Reply Quote 0
                      • trillbillyT
                        trillbilly @d.healey
                        last edited by

                        @d-healey Yes, that is correct

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

                          @trillbilly And you tried placing the check before it?

                          Free HISE Bootcamp Full Course for beginners.
                          YouTube Channel - Public HISE tutorials
                          My Patreon - HISE tutorials

                          trillbillyT 1 Reply Last reply Reply Quote 0
                          • trillbillyT
                            trillbilly @d.healey
                            last edited by trillbilly

                            @d-healey No, Im an idiot, I only put it in 1 callback.
                            Worked like a charm. Much appreciated.

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

                            19

                            Online

                            2.0k

                            Users

                            12.7k

                            Topics

                            110.1k

                            Posts