Forums

    10 posts

  • avatar
    265 sounds
    47 posts
    Looping Samples


    Why is it that when I play a breakbeat on Freesound and click on the 'loop' button, it does replay the sample, but also adds a gap of silence at the end of the sample before it kicks in again ? I apologise in advance if this sounds like a loopy question but it should loop without a gap surely ?

    Click here to lend your support to: Freesound 2011-2012 donations and make a donation at www.pledgie.com !
  • avatar
    75 sounds
    204 posts


    Hi Snapper,

    Can you tell me the name of the sample??
    Then I can try and see if its the same with me.
    And of course there are samples that are not made to be looped.

    Record all the crap you can!! doesnt matter if it sounds like shit.
  • avatar
    265 sounds
    47 posts


    Hi escortmarius,

    Thanks for your update. Here is a link to my sample that loops seemlessly in my sequencer, but on this site, there is a gap before it replays weird Am I doing something wrong ?

    http://www.freesound.org/people/Snapper4298/sounds/173021/

    Click here to lend your support to: Freesound 2011-2012 donations and make a donation at www.pledgie.com !
  • avatar
    75 sounds
    204 posts


    I think its the freesound player or something.....
    On the website its the same for me, and if I play the sample in audacity it loops perfect.
    So your sample is fine!(nice beats by the way) smile

    Record all the crap you can!! doesnt matter if it sounds like shit.
  • avatar
    316 sounds
    118 posts


    None of the loops will loop correctly online in Freesound, but if they are correclty looped in the first place they should loop ok in your DAW. I often upload a few bars with the loop repeating a few times to give people the idea..! smile

  • avatar
    265 sounds
    47 posts


    Thanks guys. I wanted to make sure I wasn't doing something wrong as I got a comment on a sound saying my beat didn't loop and I thought o_O I looped it to within a bit of a byte ~_^

    Click here to lend your support to: Freesound 2011-2012 donations and make a donation at www.pledgie.com !
  • avatar
    17 sounds
    55 posts


    I've a feeling that at some point in the past they would loop seamlessly on the site... in any case, it ought to be technically possible without too much trouble I'd have thought. It would be great if this could be implemented.

  • avatar
    167 sounds
    1462 posts


    You have to remember that there is some latency with internet streaming. Yes, the audio buffer should store the audio file while it's playing, but to my knowledge there is some latency when sending the playback to the start point. I'm no networking or flash expert, but i'm taking an educated guess in saying in may be impossible to achieve seamless looping.

    To achieve seamless looping on the scale of 1ms you would need an infinite amount of audio buffer, which isn't practical.

    I don't remember the loop function to have operated any differently, even in Freesound v1


    I am the thing that goes bump in the night...

    ╭─────────╮
    PLEASE VISIT
    ➤ Phazebook
    ➤ HeadCloud
    ╰─────────╯
  • avatar
    224 sounds
    90 posts


    Latency should not matter, as at the time of looping the entire thing has been downloaded already. Certainly, before playback reaches the end, the download aspect could have moved on to re-downloading the start, if necessary, when looping is turned on.

    The real issue is whether the underlying technology used for the player (Flash) has this reasonable capability or not, or how hard would it be to get it to do the obvious?

    There is a similar issue in my blu-ray player's apps that stream on-line content -- they always wait until the current stream is totally finished being displayed before they start downloading the next stream -- so the downloading thread finishes and no new one is started until the buffer is fully exhausted. Total waste of computing power and network bandwidth. And very frustrating to have to wait at the beginning or end of every Ad, or between episodes/chapters. So it's not just Flash or the freesound player -- its a ubiquitous non-feature, kind of like how scroll-bars snap back when your cursor wanders too far away in all versions of Windows (except that someone had to actually go to trouble to *program* it to actually create that defective behavior).

    By the way, there is another issue, where once you have converted to a lossy format, even continuously playing back an originally-seamless sound loop can let you hear a discontinuity at the loopback because the lossy encoders simply do not support loop encoding. Admittedly, it's not nearly as bad as the gap we have there today, but still noticeable. I.e., your original lossless format sound might be perfectly looped, but when you (or anyone) converts it to something like MP3, it simply is not seamless anymore. There is no reason an encoder could not be modified (by its programmer) to work correctly for seamless loops -- it could even simplify the code to know that the sound wraps around (no special handling for the ends)! I guess this is yet another obvious thing that simply hasn't caught on! Actually, there might be encoders out there that can do it, but freesound currently has no mechanism to know when to engage such a feature.

    It would be nice if such a feature existed and could be triggered by a tag, internal metadata in the sound file (I know, for example, that you can indicate looping in a WAV file), or the presence of a tag *and* the detectable continuity of loopability (I suspect that could be a useful research topic or exercise for the university), or perhaps an entirely new flag attribute to be added to sounds. The problem with all those ideas is that the entire base of existing sounds might not be able to benefit. Hmmm, that does argue for making it fully automatic -- if the analysis says the original file is a seamless loop, then seamless loop encoding should be used, and existing sounds could be re-converted for the thumbnails. But the threshold for passing the seamlessness test might take some adjustment with psycho-acoustic research (some people's idea of a seamless-enough loop might still show significant discontinuities upon mathematical inspection). On the other hand, some samples might start with a transient that could make any threshold too low for proper detection of the loopability of that sound. Like I said, ... could be a good area for research.

    -- Keith W. Blackwell
  • avatar
    224 sounds
    90 posts


    Actually, there is some discussion of support for seamless looping in sound manager and flash at http://schillmania.com/projects/soundmanager2/demo/api/ and http://www.flickr.com/photos/schill/4499319436/
    . From what I see in the freesound source, it is currently not using the looping feature at all, but instead using onFinish() to simply call play() again. I think this could actually be an easy fix. But one of the things mentioned in the second link is that mp3 encoding can introduce a gap due to the blocks inherent to the mp3 format (I didn't know about that).

    -- Keith W. Blackwell

    10 posts