Re: [Loopdub-devel] Sample Rate Configuration
Brought to you by:
radarsat1
From: Stephen S. <rad...@gm...> - 2008-01-03 22:12:39
|
> 1. Merge the internal and hardware sample rates. > 2. Automatically resample all loops to the hardware sample rate when > they are loaded. That... is a good idea. Why didn't I think of it.. ;-) > Now, what about the clicking problem? Let's run with the Ah, sorry I should have explained that I understand the clicking problem. During real-time resampling, if the hardware buffer size times the ratio between the two sample rates does not work out to an integer, then you will get a partial-sample at the end of every buffer. (i.e., the sample value is sort of spread-out over more than one sample bin.) This won't be an issue if the resampling is done when the loop is loaded. Perhaps it only on the last sample, but I don't know if this would be audible. > So, perhaps we could devise a buffer size that is compatible with most > of those sample rates, and simply print a warning for the user when > they load a sample that is not at one of those sample rates. Not a > fully general solution, but perhaps a practical one? It's possible. What I chose works fine for the usual conversion of 44100 to 48000 (and would scale to 96000): 800 * (44100/48000) * (48000/48000) = 735 However, if we do as you say and resample the loops on load, we no longer need to consider the buffer size, but the total sample size which, when rescaled, should come out to an integer to as to avoid a possible click at the end of the loop. Unfortunately we have no control over the loop length. I can imagine in some cases though, it might be better to shave off a few samples from the original loop before resampling in order to improve the quality of the resampled loop. (so that it comes out to an integer) Steve |