thoughts about high quality buffer player with interpolation

    Dec 30 2017 | 11:36 pm
    Hi all,
    I need a buffer player with variable speed with high-quality interpolation (sinc-based), with as less as possible mirroring and filtering errors. So basically a high-quality sounding "speed $1" in groove~ (with slower speed than original). As far as I know, two options are possible in Max: . message "resample 1" in groove~. But first it seems it never worked properly in Max 6, and seems to have been suppressed in Max 7. And second, no options are possible (window size and shape, number of points, etc...) . the gen example "gen~.sincinterpolation.forloop.maxpat". Very nice one, but slightly buggy in its standard implementation. The buffer window size is set to 16385, whereas it should be an even number, so that the sinc function created by the "fill sinc" properly works (i.e. so that every sample corresponds exactly to 1024 points in the buffer window). It would be nice to correct the example patch in the distribution accordingly.
    Here is a corrected version of this patch, that also allows to set the number of samples in the window, the subdivisions in points, as well as the shape of the smoothing window freely:
    This works well and with very little mirroring for a window size of 2*16 samples subdivided in 2^16 points each and a blackman window. But it's a kind of a CPU hog. With 2*12 samples subdivided in 2^10 points each (default parameters in my patch) it stills sounds quite well (and dramatically better as groove~). The settings of gen~.sincinterpolation.forloop.maxpat would correspond to 8 for parameter "number of samples/2" and "10" for parameter "subdivisions". Also not bad, but more ripples (not flat response of the interpolator).
    I guess it should be possible to optimize the CPU usage by working on the window design (for instance Lanczos).
    It's very nice to have this in gen and be able to change all parameters, but the same algorithm will definitely be more efficient as a real external object. It's a must-have that groove~ finally incorporates a high-quality interpolator. The standard one is nice to create glitchy digital effects, but if transparent interpolation is required it's definitely not any more sufficient.