it's possible something like that is causing the gap. it's not something most people would notice if they're not trying to do seamless looping (i never noticed myself) so in most applications the algorithm is completely acceptable. as for how i did it i could keep it a secret and you'd really think i was some kind of genius or i could tell you and you'll see how simple it is. kk i'll tell you he he. i calculated the length of the song from the beginning to the end of the last note. let's call this the notation length. i simply import the wave file into everyone's favorite wave editor audacity and cut everything that comes after the notation length which will basically be echoes, reverb, etc. from the ending notes. i paste this over the very beginning of the file. viola! seamless. there's times where it's a little trickier like when there's a non-changing pattern of some kind going on continuously where the phase at the end has to be lined up with the phase at the beginning and/or when there's not a lot of echo-y stuff to carry over and fill in the transition. but i'll cross that bridge if and when i get to it d: glad the ogg file works. yeee-hawwww!