It all looks fantastic though.
Dave H.
No reason to use floats at all for such unintensive memory process, doubles are actually a little bit more efficient, probably because loading 64-bit values has less latency than loading 32-bit values, from math CPU footprint 32-bit and 64-bit floats seem to be equivalent, 1 tick per op or so.quikquak wrote: Mon Oct 22, 2018 8:20 am I’m looking at this with great interest, but I’m wondering about the decision to not go with allowing floats as an input? Most people’s internal precision is probably still in floats. Not allowing them just seems like a needless enforcement for such a useful tool.
It all looks fantastic though.Well done, and thank-you.
Dave H.
Going from float to double and back, is inexpensive operation. I think overall it may be as efficient as performing sample rate conversion in floats. SSE2 support is now a bare minimum.quikquak wrote: Mon Oct 22, 2018 12:08 pm For a tool, it’s quite important from a usability standpoint, I wanted to use SSE in my prior processing, and I’m still not confident in everybody having SSE2 processors. Are other developers just doing a float to double conversion before calling this I wonder? - Seems a bit of a waste. Or perhaps I should just go with doubles in my entire plugin...
Code: Select all
Resamps[c] = new r8b::CDSPResampler24(internalRate,sampleRate, internalSize);It was introduced by Pentium 4 and it's guaranteed to be supported on every 64-bit processor.quikquak wrote: Mon Oct 22, 2018 12:08 pm I’m still not confident in everybody having SSE2 processors.
Keep in mind that unless your doing the computations in exactly the same way as the library, you'll accumulate some rounding errors that will eventually cause you to fall out of sync. Since trying to match rounding errors is not something you typically want to do, I'd highly suggest thinking about an alternative solution.quikquak wrote: Wed Oct 24, 2018 11:20 am Ok, I’m currently adding the fractional input size to a counter, and when this overruns 1.0 I increase the input size. It seems to work OK. And always returns the correct number of samples. I need to test many different rates though.
r8brain-free-src wasn't designed for real-time SRC, so there's no "convenient" ways to use it for real-time SRC. But it does work for real-time SRC in practice judging by numerous reports. So, real-time SRC indeed requires "workarounds" not offered by the library out-of-the-box.quikquak wrote: Wed Oct 24, 2018 2:43 pm Thanks for the warning, yeah I thought it was a naive approach, I will probably replace it at some point I just wanted to test an OSC idea I had TBH.
Although it has been running OK for an hour with a ratio of 1.8354166666666667! - Nice.
Fractional "oversampling" (or "undersampling" for that matter) ratios are fairly easy to implement by solving the internal sampling instants in terms of the external sample clock once, then using sinc-gathers and sinc-scatters as a "reciprocal" pair of filters that can both use the exact same fractional offsets. I'm not sure if there are really any libraries that implement this, but it's totally robust (when implemented correctly, duh) at the cost of being somewhat slower (partly because of the scatters, but mainly because you lose a bunch of poly-phase optimisations that can be done in the integer ratio case).matt42 wrote: Wed Oct 24, 2018 7:35 pm Depending on the process it might be easier to switch internal sample rate relative to host sample rate, so 88200 for 44100 or other integer ratios and 96000 for 48000 etc. I'd avoid fractional ratios unless necessary
Submit: News, Plugins, Hosts & Apps | Advertise @ KVR | Developer Account | About KVR / Contact Us | Privacy Statement
© KVR Audio, Inc. 2000-2026