-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
additional Interpolation methods for resampling #9328
Comments
Commented by: daschuer We originally had a cubic interpolation in Mixxx which was considered as sound not better. The file of question now lives here: mixxx/src/engine/enginebufferscalelinear.cpp Line 328 in f3a1442
I think a good and easy to implement feature would be to add an option to use either rubber band or Soundtouch for the linear case as well. Does anyone know what they do in the linear case (vinyl pitch) ? |
Commented by: daschuer Ok, Soundtouch uses it's own cubic interpolation. |
Commented by: kazakore SoundTouch, being a frames based method of timestrectch, I really don't think would work well at all. The only way I could imagine RubberBand doing it would be double processing, first timestretching as normal, then pitchshifting to the pitch it should be. I could well be wrong but if that's the case that would be an excessive amount of processing to achieve this! And I've done quite a lot of comparison of Linear Vs Cubic Interpolation at the output of a DAW and Cubic has nearly always sounded far superior. If it didn't then my guess would be a faulty implementation previously..... Is there a PR number or similar I can use to test myself? Or is it just a matter of copying over the file you have specified with the one with the same name in Master/2.1 and compiling? |
Commented by: daschuer The scalers are selected here: mixxx/src/engine/enginebuffer.cpp Line 249 in c241ae5
|
Commented by: kazakore "Ok, Soundtouch uses it's own cubic interpolation. Happy to hear I'm wrong and they have included these use cases. So your solution sounds like it could be a good one. |
Commented by: kazakore Not managed to find the different Scalers, or not one that seems to use interpolation rather than change play_pos (probably due to not being used to the code and have zero C++ skills) but I did come across this comment: "// When no time-stretching or pitch-shifting is needed we use our own linear When talking about scratching I can fully believe that Linear will sound better than Cubic, I would ague that in this case it's very likely that Nearest Neighbour will sound even better than Linear. Scratching for digital DJs is a bit of a niche though really and I don't think a reason to lose a configurable option for modes that sounds better during normal playback.... |
Commented by: daschuer There is also the question after group delay, that may be an issue when scratching.
We may consider to use libsamplerate directly, to bypass the rubberband overhead when doing only interpolation. |
Commented by: kazakore DO you mean add an internal switch so that Mixxx will automatically switch between a method optimised for Scratching under certain conditions and then use the user selected mode at other times, which itself depends on whether Key Lock is active or not? |
Commented by: kazakore Have you considered trying libzita-resample? Their claims are to be faster and better quality than libsamplerate and on the whole my experience with all the Zita tools is pretty positive. Something makes me think you don't use single-precision floats in the audio engine though, so it might not be suitable at all..... " Libzita-resampler is a C++ library for resampling audio signals. It is designed to be used within a real-time processing context, to be fast, and to provide high-quality sample rate conversion. The library operates on signals represented in single-precision floating point format. For multichannel operation both the input and output signals are assumed to be stored as interleaved samples. The API allows a trade-off between quality and CPU load. For the latter a range of approximately 1:6 is available. Even at the highest quality setting libzita-resampler will be faster than most similar libraries, e.g. libsamplerate. " http://kokkinizita.linuxaudio.org/linuxaudio/zita-resampler/resampler.html |
Commented by: daschuer We may add a new comobox: Vinyl-Pitch Engine: "Linear (faster) / Sinc (better)" https://demonstrations.wolfram.com/SincInterpolationForSignalReconstruction/ |
Reported by: kazakore
Date: 2018-06-05T11:32:00Z
Status: Confirmed
Importance: Wishlist
Launchpad Issue: lp1775164
Feature request:
I would like to see additional Interpolation options to increase the audio quality when not using Key Lock.
Currently there is no option for this, with Linear being the only possible choice. This may be good for low powered devices but does not provide overly good audio quality.
Minimum options I would like to see are:
None
Linear
Sinc
I can find a number of examples where these are provided, often with various different quality settings for Sinc (how many convolutions of the sinx/x curve it iterates over) if this might be of help (eg I believe the Audacious and its Plugins are written in C++ so be a possible source of inspiration if needed) but I feel the learning curve would be too high for me to attempt myself with any reasonable timeframe.
Additionally I would suggest a look into Cubic Spline Interpolation. I haven't really come across this so commonly in open source software but have seen it well used in propriety software and it gives a quality close to that of Sinc while being far easier on the processor.
The text was updated successfully, but these errors were encountered: