Is it better to use double precision in audio processing ?
I have sufficient memories and HDD spaces
My audio interface is Audient ID22 and I have RME Converter, native instruments, Dorico, Ableton Live etc
If yes, I will really appreciate if you can advise me how to do this in C++ programming
Is it better to use double precision in audio processing
Not always. Although the calculation almost takes the same time, double number requires a larger bandwidth and you cannot hear the difference. But there are cases where double precision is a must, e.g., a low pass/shelf at 10Hz.
If yes, I will really appreciate if you can advise me how to do this in C++ programming
Suppose we have juce::AudioBuffer<float> &buffer from processBlock() and pre-allocated juce::AudioBuffer<double> doubleBuffer, you can copy data as follows:
doubleBuffer.makeCopyOf(buffer, true); // copy data to double precision buffer
// process doubleBuffer;
buffer.makeCopyOf(doubleBuffer, true); // copy data back to buffer
Yes it is OK if your host support that (I am not sure whether all hosts support double precision buffer input, maybe someone else can confirm this for you).
i use double precision a lot because bugs that are introduced due to float being too small can be really sneaky, so unless i need some performance optimisations i just keep things double