-
Notifications
You must be signed in to change notification settings - Fork 62
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
Resampling block #59
Comments
Yes! You can look at the resampler from JUCE for inspiration. I've been using it with NAM since last summer and it works perfectly for this exact purpose. So might as well port it to NAM. I use a |
Oh, by the way, two more requests for that:
(obviously method names are arbitrary) |
A few years ago this was considered the highest quality open source resampling library from the master behind Voxengo plugins: https://github.com/avaneev/r8brain-free-src. I assume it still is, check it out! |
I am not sure that the cubic resampler WIP in the NeuralAmpModelerCore repo will be of high enough quality. Cubic resampling will introduce a lot of aliasing. But r8brain-free-src is not designed for real time usage afaik, and will be too heavy. I propose to use either WDL_Resampler or perhaps this which @baconpaul kindly MIT'd for me. |
Implementing WDL_Resampler in the plug-in code would be simple |
I've got some really good results with the Lancsoz resampler, which has much less aliasing that the interpolation modes and is fast and only adds a tiny bit of latency: sdatkinson/NeuralAmpModelerPlugin#341 |
Once I fixed that bug. Lol. Glad to see it helps! |
Coming back to this, I don't think it makes sense to implement the resampler here: same as AudioDSPTools, it's not "NAM-specific" and others may have their own favorites already. Still, I definitely appreciate the input on this Issue and will be referencing it as I work on getting resampling in my plugin; thanks! |
Implement
Resample
, which subclassesDSP
. It encapsulates anotherDSP
object, and takes care of the incoming and outgoing resampling required to expose a buffer to the encapsulated object at the sample rate that it expects.The use case for this is sdatkinson/NeuralAmpModelerPlugin#59. For example, a NAM model that expects a sample rate of 48k may be encapsulated, and the DAW may be running the plugin with a buffer provided at a sample rate of 44.1kHz.
Resample
will:This will incur a delay due to the bounding samples that are required to interpolate a given sample as well as the integer sample numbers, meaning that a varying number of samples will be outputted by both of the resampling functions.
If the inner and outer sampling rates are equal, then it would be great to bypass any interpolation math and do a straight pass-through.
The purpose of the resampling block is to expose a clean interface around the encapsulated DSP object, and should be orthogonal from the resampling algorithm itself that's used. I'll provide a simple cubic interpolation algorithm, and other developers may swap in more accurate or better-optimized routines as they'd like.
The text was updated successfully, but these errors were encountered: