Double precision (64 bit audio) tips


#1

Hey guys, I’m looking to support double precision for an upcoming plugin, I’m also additionally internally upscaling the buffer to doubles if it’s coming in as floats as the non linear DSP does indeed benefit from double precision. I’m just wondering if anyone has experience with doing something similar, and if they can offer any tips for best practices when doing this.

At the moment, if the buffer is in floats, I simply loop over each sample and copy it casted as (double) into a new AudioBuffer<double>, and do this for each channel (for cache coherency). And do similar back down to float again for the output. I’m hoping there is a quicker and more efficient way of doing this, so if anyone knows a method for converting or copying from AudioBuffer<float> to AudioBuffer<double>, that would be greatly appreciated. If there was some kind of FloatVectorOperations for this, that would be great.

Cheers!


#2

I’ve run into another issue in the meantime, JUCE’s AudioVisualiserComponent appears to only support float buffers, which means if I’m using double precision processing I’ll have to to temporarily downcast the buffer to float, and since there’s no vectorized way of doing this I’ll have to iterate through the samples manually to do it each buffer if I want to use that component, which again seems costly.