HISE Logo Forum
    • Categories
    • Register
    • Login

    Unknown Functions 'set' & 'getRange'

    Scheduled Pinned Locked Moved Scripting
    15 Posts 3 Posters 747 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 Is it because the sample map is not loaded?

      Libre Wave - Freedom respecting instruments and effects
      My Patreon - HISE tutorials
      YouTube Channel - Public 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;
            

            Libre Wave - Freedom respecting instruments and effects
            My Patreon - HISE tutorials
            YouTube Channel - Public 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);

                  Libre Wave - Freedom respecting instruments and effects
                  My Patreon - HISE tutorials
                  YouTube Channel - Public 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?

                      Libre Wave - Freedom respecting instruments and effects
                      My Patreon - HISE tutorials
                      YouTube Channel - Public 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

                        14

                        Online

                        1.7k

                        Users

                        11.9k

                        Topics

                        103.3k

                        Posts