On Tue, 2010-11-23 at 01:33 -0800, Albert Santoni wrote: > > When you're starting from standstill, the scaler code should apply a > ramp-in envelope to the audio to avoid a discontinuous change from > zero to something non-zero. That's one source of popping.
It does do the ramp-in. I redid the ramp-in and ramp-out to modify existing samples, not pick one sample and ramp it. > > Another thing I found before was that you should interpolate between > playback rates smoothly, because the waveform widget (for example) > changes the speed in big discrete jumps. This causes a sort of > "digital" sound, though it's not necessarily a source of the clicks. yeah I have the same interpolation code. It seems to be correct, except that when there are large changes in rate, and especially if the rate reverses. I think right now the problem is in rate-reversal. My solution has been to do this: * we have the real sound buffer we have to fill, real_buffer. * I create two sub-buffers, each smaller than the original buffer but more than half the size so I can crossfade them. * I recursively run the scale function for buffer sub_a, going from old rate to 0. * Then I run the scale function for buffer sub_b, going from 0 to the new rate. * Then I crossfade/overlap the two buffers into the real_buffer. This should provide something approaching what a scratch sounds like. I still get popping, but it's a lot better. Maybe there's a more "correct" way to go from one rate to another when they are in opposite directions? The old code was wrong because it would buffer samples in one direction and then write samples that should be going in the other direction. > > Did you rewrite the relevant parts of EngineBuffer/CachingReader to > store the playback position as a float? No, I just took the idea that was already there, of keeping the index to the current sample as a float and then interpolating between two samples to get the right value. The trick is maintaining that index across iterations of the buffer and saving the last value from the old buffer so I can continue to do interpolation. ------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev _______________________________________________ Mixxx-devel mailing list Mixxx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mixxx-devel