HISE Logo Forum
    • Categories
    • Register
    • Login

    getAttribute(LoopEnd & LoopStart)

    Scheduled Pinned Locked Moved Scripting
    8 Posts 2 Posters 437 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.
    • ulrikU
      ulrik
      last edited by

      If I make a reference to my sampler with

      const var CrossFadePiccoloSampler = Synth.getSampler("CrossFade Piccolo");
      

      I'm supposed to reach the parameters LoopEnd & LoopStart and subtracting the loopStart from the LoopEnd should give me the LoopLength, however both attributes give -1, am I doing something wrong, or is it broken?

      var LoopL = CrossFadePiccoloSampler.getAttribute(CrossFadePiccoloSampler.LoopEnd) - CrossFadePiccolo.getAttribute(CrossFadePiccolo.LoopStart);
      

      Hise Develop branch
      MacOs 15.3.1, Xcode 16.2
      http://musikboden.se

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

        Won't loop start and end be different for every sample in the sampler?

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

        ulrikU 1 Reply Last reply Reply Quote 0
        • ulrikU
          ulrik @d.healey
          last edited by

          @d-healey yes they would, so how do I get a reference to played sample?

          Hise Develop branch
          MacOs 15.3.1, Xcode 16.2
          http://musikboden.se

          ulrikU 1 Reply Last reply Reply Quote 0
          • ulrikU
            ulrik @ulrik
            last edited by

            @ulrik Ok, I found it, I have to use

            Console.print(parseInt(CrossFadePiccoloSampler.getSoundProperty(CrossFadePiccoloSampler.SampleEnd, 0)) - parseInt(CrossFadePiccoloSampler.getSoundProperty(CrossFadePiccoloSampler.SampleStart, 0)));
            

            so the "0" is the index of this particular sample (I have only 1 sample in the sampler located at C3, so I guess the index number is not related to at what pitch the sample is located but it's the first (and last :) )
            So if I have several samples how is the samples indexed?
            Ok, they get an ID, I see it here
            Skärmavbild 2020-03-20 kl. 11.36.10.png
            Great!!

            Hise Develop branch
            MacOs 15.3.1, Xcode 16.2
            http://musikboden.se

            ulrikU 1 Reply Last reply Reply Quote 1
            • ulrikU
              ulrik @ulrik
              last edited by

              @ulrik Why does this not work?
              With this I get the SoundProperty 15 = LoopStart, for Sound with index 0, works fine!

              Console.print(CrossFadePiccoloSampler.getSoundProperty(15, 0));
              

              but if I use this for the same sample

              CrossFadePiccoloSampler.setSoundProperty(0, 15, 2020);
              

              I will get an error saying

              Line 12, column 49: no sound with index 0 
              

              Hise Develop branch
              MacOs 15.3.1, Xcode 16.2
              http://musikboden.se

              ulrikU 1 Reply Last reply Reply Quote 0
              • ulrikU
                ulrik @ulrik
                last edited by

                @ulrik Ok, I had to select the sample first, then it works, Heureka!! :)

                CrossFadePiccoloSampler.selectSounds("swell_c");
                

                Hise Develop branch
                MacOs 15.3.1, Xcode 16.2
                http://musikboden.se

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

                  Looks like you have to make a selection before you can use that function.

                  b8681a88-3a3d-443d-a93a-7558240f5035-image.png

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

                  ulrikU 1 Reply Last reply Reply Quote 1
                  • ulrikU
                    ulrik @d.healey
                    last edited by

                    @d-healey Yes that's what I figured out, after spending some interesting hours...hehe :)

                    Hise Develop branch
                    MacOs 15.3.1, Xcode 16.2
                    http://musikboden.se

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

                    17

                    Online

                    1.8k

                    Users

                    12.1k

                    Topics

                    104.9k

                    Posts