HISE Logo Forum
    • Categories
    • Register
    • Login

    Impossible to loop short sample !

    Scheduled Pinned Locked Moved Bug Reports
    17 Posts 6 Posters 3.0k 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.
    • Christoph HartC
      Christoph Hart
      last edited by

      Can you upload the sample data too (PM me if you don't want to do this publicly)?

      It's rather hard to guess what's not working here :)

      1 Reply Last reply Reply Quote 0
      • chrisC
        chris
        last edited by chris

        Here a short Video demonstrate the problem i also add the SFZ.

        Dropbox - File Deleted - Simplify your life

        favicon

        (www.dropbox.com)

        Thanks,

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

          Ah, yes it's a duplicate of this long time friend of mine:

          Link Preview Image
          Preloading and Looping

          Hello, As Christoph knows, I've been working with HISE with modified source code. That being said, I did take note of the fact that the vanilla version of HI...

          favicon

          Forum (forum.hise.audio)

          Maybe this time I'll actually do something about it :)

          1 Reply Last reply Reply Quote 0
          • chrisC
            chris
            last edited by

            ok thanks for this;)

            1 Reply Last reply Reply Quote 0
            • AxiomCruxA
              AxiomCrux
              last edited by

              Did this fix ever get merged?

              http://www.axiom-crux.net

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

                Nope and now it starts to get embarrassing...

                1 Reply Last reply Reply Quote 0
                • AxiomCruxA
                  AxiomCrux
                  last edited by

                  maybe @Cyberdyne387 could provide his fix from the referenced forum thread? I didn't see a github repo in the list of forks. I wondered if maybe its a simple enough fix to copy paste and describe the changes in the issues list or on this thread?

                  http://www.axiom-crux.net

                  C 1 Reply Last reply Reply Quote 0
                  • C
                    Cyberdyne387 @AxiomCrux
                    last edited by Cyberdyne387

                    @macromachines

                    First of all, apologies for taking so long to read this: truth be told, I’ve been pretty swamped with other matters.

                    It’s important to note that I may not have the modified code in its entirety anymore due to trying to keep my HISE source code updated every so often, and even if I do, I never did find a C++ way to address the sample-end-too-short issue. I’m willing to share my edit for the loop-end-too-early issue, however, and I may still have a JavaScript that adjusted the preload size so that the loop would play at all regardless.

                    UPDATE: found the fixed C++ file. It should hopefully compile fine with the latest source code.

                    Link Preview Image
                    StreamingSamplerSound.cpp

                    Shared with Dropbox

                    favicon

                    Dropbox (www.dropbox.com)

                    To specify what exactly I changed when it comes to this issue, Christoph wrote a conditional statement in the setPreloadSize function for the circumstance of if the entire length of the sample is too short for the internalPreloadSize, but looping is enabled. What I changed is I added an additional conditional statement checking to see if the loop end point is also smaller than the internalPreloadSize.

                    As for whether the loop plays at all under a given preloadSize, sadly, loops and loading the entire sample seem to not get along well at this time, so my final change was specifying that entireSampleLoaded be false if the preloadSize is larger than the loop end point. In addition, I also specified the loopChanged function to force-reload the preload buffer in the high chance that you wish to change the loop but not the preload buffer size at a given time.

                    Hopefully this helps people out.

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

                      @cyberdyne387 - thanks for the code. I have diffed it with the current state and it can be merged without problems. However I'd like to test these things a little bit before committing in the codebase - changing this code is like open heart surgery, so every line counts :)

                      C 1 Reply Last reply Reply Quote 0
                      • C
                        Cyberdyne387 @Christoph Hart
                        last edited by

                        @christoph-hart Not a problem when it comes to testing the code extensively before committing. I did realize I made a minor mistake in my fix, anyway: the force-reloading of the preload buffer I had only run when the looping is set to enabled, meaning it will play the duration of the sample as a loop even if the last loop change you did was disabling the loop. Fixed on my end now, with the same link.

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

                          Alright, I've pushed a fix to this problem.

                          I ended up rewriting the fix for myself, but at the end I did almost the same things as you :)

                          Thanks again for the input!

                          C 1 Reply Last reply Reply Quote 1
                          • C
                            Cyberdyne387 @Christoph Hart
                            last edited by

                            Just tested your version of the edits for myself, only to need to revert back to my version of StreamingSamplerSound. Both copies of the file work fine when there's no sample start offset, but it appears the one you committed causes the loop to play silence for the duration of the sample start offset

                            1 Reply Last reply Reply Quote 0
                            • chrisC
                              chris
                              last edited by

                              Just install this update Working Perfect, Thanks a lot.....

                              1 Reply Last reply Reply Quote 0
                              • FrankbeatF
                                Frankbeat
                                last edited by

                                I'm also having problems looping short samples. Files with loop settings like the following seem to overcharge HISE (develop branch from roughly Feb 2023):

                                <sample {other params here} LoopStart="633" LoopEnd="1033"/>
                                <sample {other params here} LoopStart="321" LoopEnd="721"/>
                                <sample {other params here} LoopStart="669" LoopEnd="1093"/>
                                <sample {other params here} LoopStart="339" LoopEnd="763"/>
                                

                                But hey, why not just duplicate one or two cycles in theses files? Very simple solution :smiling_face:

                                Using HISE from the develop branch (Feb '23)

                                LindonL 1 Reply Last reply Reply Quote 0
                                • LindonL
                                  Lindon @Frankbeat
                                  last edited by

                                  @Frankbeat so if you think about it there's always going to be a problem for HISE with looping very short samples spread cross the keyboard range - as you move further up the keyboard away from the root note - the sample needs to be shortened(even further) to repitch - until we get to the "that aint ever gonna work" position... so yes duplicating your short loop multiple times (say 10 or 20) will help a fair bit...

                                  HISE Development for hire.
                                  www.channelrobot.com

                                  FrankbeatF 1 Reply Last reply Reply Quote 0
                                  • FrankbeatF
                                    Frankbeat @Lindon
                                    last edited by

                                    @Lindon Oh, I'm sorry I didn't mention it: This was tested with no pitch tracking applied. Each sample just played back on its root note. But of course, you're correct. I never pitch track a sample more than 2 semitones up or down.

                                    Using HISE from the develop branch (Feb '23)

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

                                    31

                                    Online

                                    1.7k

                                    Users

                                    11.8k

                                    Topics

                                    102.5k

                                    Posts