Fathom Development Thread

VST, AU, AAX, etc. plug-in Virtual Instruments discussion
KVRAF

Topic Starter

1513 posts since 25 Mar, 2017

Post Wed Jun 23, 2021 11:33 pm

Double floats are the answer. I stumbled across some medical data which states clearly that the human ear is far more sensitive than the eight decimal places of precision provided by single floating point. All other articles and music audio developers will tell you that I am wrong and that single float is beyond human hearing but I think they might be wrong and it contradicts the medical data. And they might also be forgetting that the rounding error is every single sample.

Only one way to find out.

User avatar
KVRAF
2007 posts since 8 Jun, 2018

Post Thu Jun 24, 2021 12:08 am

FathomSynth wrote:
Wed Jun 23, 2021 11:33 pm
Double floats are the answer. I stumbled across some medical data which states clearly that the human ear is far more sensitive than the eight decimal places of precision provided by single floating point. All other articles and music audio developers will tell you that I am wrong and that single float is beyond human hearing but I think they might be wrong and it contradicts the medical data. And they might also be forgetting that the rounding error is every single sample.

Only one way to find out.
so it is the data type double, in C(++), or long double. it is a swamp, it depends on language, compilers, cpu's, etc.. how double is interpreted, in C it is straightforward (o well, not always).
my interest is to understand it, in order, to understand more about DSP, but also it strangely helps me to understand a synth better, what is under the hood.

if i read it well; double will not add much cpu, more memory. which is in these days, o well.. o yes, reading from and to memory. o the cache! that helps..

rounding errors, i can understand... medical data. well there is a lot to be learned about the human ear. it seems to me a difficult area of research, which doesn't mean good studies can be made, they only demand a lot (and that isn't a problem, science is demanding.. or it isn't science...)

and indeed only way to find out; try it.

but i am also excited about the spectral capabilities, that are added, i had a spectral day yesterday, bought two (no 3, 2 packs) M4L devices (Iota by dillon bastan, and Amazing Noises Spectrum Effects) and an hour afterwards, there was already the update to SpectraLayers Pro 8...
it will add to the spectral capabilities i already have, although they are 'all over the place', not one main plugin, but a combination of devices, plugins, programs, making samples, treat them spectrally, etc..

o well..

EDIT: a bit Cato Maior; MPE would be great. and with double precision.. the timbres!!
take me as apple as reed-son as flesh-icon, immediately
shits the wise man. hero and blind. take me as
stick as tongue as dog... Music & Soundscraping

KVRian
698 posts since 22 Apr, 2004 from Switzerland

Post Thu Jun 24, 2021 1:19 am

Isn't it the case that the High Quality options on other synths have to do with more oversampling? (for example the HQ mode on Ableton Live's EQ8)

User avatar
KVRAF
2007 posts since 8 Jun, 2018

Post Thu Jun 24, 2021 3:21 am

Blaster wrote:
Thu Jun 24, 2021 1:19 am
Isn't it the case that the High Quality options on other synths have to do with more oversampling? (for example the HQ mode on Ableton Live's EQ8)
that is the internal sample rate of a plugin, not how the code computes (...), it isn't the same, but ableton live internally works at 32 bit float? or integer? i was gonna check it today, i think float. also for rounding errors mainly.

so it is something different. how one sample (with a simple in this case i mean, at 48.000, there are 48.000 samples, or a block of samples) is treated within the code, how it is calculated.
take me as apple as reed-son as flesh-icon, immediately
shits the wise man. hero and blind. take me as
stick as tongue as dog... Music & Soundscraping

KVRAF
2574 posts since 17 Sep, 2016

Post Thu Jun 24, 2021 5:13 am

Some deep diving on round-off errors... :idea:

https://en.wikipedia.org/wiki/Round-off_error
A roundoff error, also called rounding error, is the difference between the result produced by a given algorithm using exact arithmetic and the result produced by the same algorithm using finite-precision, rounded arithmetic. Rounding errors are due to inexactness in the representation of real numbers and the arithmetic operations done with them. This is a form of quantization error. When using approximation equations or algorithms, especially when using finitely many digits to represent real numbers (which in theory have infinitely many digits), one of the goals of numerical analysis is to estimate computation errors. Computation errors, also called numerical errors, include both truncation errors and roundoff errors.
Compared with the fixed-point number system, the floating-point number system is more efficient in representing real numbers so it is widely used in modern computers. While the real numbers R are infinite and continuous, a floating-point number system F is finite and discrete. Thus, representation error, which leads to roundoff error, occurs under the floating-point number system.
Windows10; plugins from AAS, Ableton, AIR, Ample, Arturia, Cakewalk, Cherry, DiscoDSP, Fathom, IKM, Initial, iZotope, KV331, NI, PluginGuru, PreSonus, Surge, TAL, Tone2, Toontrack, Tracktion, u-he, UJAM, UVI, Vital, Waves, XLN ...

KVRAF
8232 posts since 6 Oct, 2004

Post Thu Jun 24, 2021 11:38 am

FathomSynth wrote:
Wed Jun 23, 2021 11:33 pm
Double floats are the answer. I stumbled across some medical data which states clearly that the human ear is far more sensitive than the eight decimal places of precision provided by single floating point. All other articles and music audio developers will tell you that I am wrong and that single float is beyond human hearing but I think they might be wrong and it contradicts the medical data. And they might also be forgetting that the rounding error is every single sample.

Only one way to find out.
Without a scientific reference, I firmly believe that the most subtle ambience and noise sets the stage for more clearly audible sounds. It's part of why some sounds/music grabs you, and the rest of it just floats by in the breeze. Just as there are places that might inexplicably make the hair on one's neck stand up, be it city or forest, desert or sea, indoors or out. As there are vocalists that communicate far more than lyrics and spoken thoughts. There is much more to sound than meets the eye. Math describes it better than math defines it.
Mi dos centavos
Cheers

KVRAF
8232 posts since 6 Oct, 2004

Post Thu Jun 24, 2021 11:42 am

I also think that human vision conditions our hearing. Beauty being in the ear of the listener, being linked to the beauty in the eye of the beholder.
Tres centavos

KVRAF

Topic Starter

1513 posts since 25 Mar, 2017

Post Thu Jun 24, 2021 11:51 am

I don't think oversampling is the secret. Its literally just like using a bigger buffer which Fathom already does. Plus you just have to convert back anyway to the host sample rate which involves more buffer fetching and interpolation which injects a new layer of rounding errors.

I'm pretty sure Ableton now can process internally using double floats. I read an article on it on their web site not long ago.

Its not so much a matter of rounding errors as it is a simple matter of precision. If the human ear can hear to ten or twelve decimal places and a single float is storing all samples in eight decimal places then it is a simple matter of the digital signal chopping off information which the human ear can hear. Obviously that will not sound as good.

Like it was said above, the only way to find out is to do it.

Also when I am done I will run a test. I will create the exact same synth note signal using a simple sawtooth wave and produce it using both single and double precision floats. Then I will subtract the float signal from the double to produce the difference signal which will be the precision error signal. If the precision error signal is audible then that means that the extra quality of using double precision is audible.

User avatar
KVRian
1019 posts since 25 Sep, 2014 from Specific Northwest

Post Thu Jun 24, 2021 12:23 pm

These days, CPU cycles saved using singles are minimal, at best, unless you are also using some approximations that are only good out to 6 or 7 decimal places. Calculating everything internally as doubles prevents rounding errors (accumulators that return zeros when their sums should actually register a non-zero value) and does provide a sound quality improvement for some algorithms. Converting double-> single to pass back after processing is negligible. Oversampling only helps minimize aliasing and is just one tool in that toolbox.

* This is all based on my informal testing and listening. YMMV.

User avatar
KVRian
1019 posts since 25 Sep, 2014 from Specific Northwest

Post Thu Jun 24, 2021 12:31 pm

Blaster wrote:
Thu Jun 24, 2021 1:19 am
Isn't it the case that the High Quality options on other synths have to do with more oversampling? (for example the HQ mode on Ableton Live's EQ8)
High-quality can be due to anti-aliasing, but it can also have to do with using Newton-Raphson to calculate non-linear values. Basically, you make a guess and the algorithm gives you a new, better guess, and an error margin. Low quality allows for a larger acceptable error amount. High quality lowers the acceptable error margin, forcing the algorithm to be run more times until it returns something in the lower error margin.

KVRAF
2574 posts since 17 Sep, 2016

Post Thu Jun 24, 2021 5:08 pm

FathomSynth wrote:
Thu Jun 24, 2021 11:51 am
Like it was said above, the only way to find out is to do it.
The proof in the pudding... :wink:
Windows10; plugins from AAS, Ableton, AIR, Ample, Arturia, Cakewalk, Cherry, DiscoDSP, Fathom, IKM, Initial, iZotope, KV331, NI, PluginGuru, PreSonus, Surge, TAL, Tone2, Toontrack, Tracktion, u-he, UJAM, UVI, Vital, Waves, XLN ...

KVRAF
8232 posts since 6 Oct, 2004

Post Thu Jun 24, 2021 6:09 pm

And more proof is on pallets waiting to be shipped around the world from Trance Warehouse #2 :hyper:

KVRAF

Topic Starter

1513 posts since 25 Mar, 2017

Post Thu Jun 24, 2021 10:04 pm

HaHa, Yes Trance Warehouse. I just finished it today. 190 presents. Rhythms, Leads, Basses, Pads, Keys, Pianos and Voices. It will be released along with version 3.4.

Yes, exactly, proof is in the pudding, so I'm going to implement doubles and see what the improvement is.

User avatar
KVRian
1369 posts since 22 Sep, 2016

Post Fri Jun 25, 2021 5:28 am

Blaster wrote:
Thu Jun 24, 2021 1:19 am
Isn't it the case that the High Quality options on other synths have to do with more oversampling? (for example the HQ mode on Ableton Live's EQ8)
Define Quality?
Interestingly enough after the high quality synth we often enough put an amp, a saturator, a bit crusher or a cutoff filter in the chain ... to get some dirtyness and analog feeling into the sound.

When talking about floats. It's interesting that floats have a much higher density around 0 compared to when we look towards infinity... Meaning you have much more number of R represented around 0 than anywhere else. So when computing in this area you could intuitively say your results are more likely to be exactly represented by a float.

Okay what does that mean... Simply it can depend heavily on your algorithm. Let's think about an example: (a+b)*c. You can choose to go a*c + b*c as well... which one would you chose when?
So now think you have something to compute and you can choose two ways as we did. and let's say one way a intermediate result may escape into very high numbers. And with the other way all intermediat results stay around 0. Which would you choose?

The problem might be even trickier because "numerical computing errors" might cancel out or get amplified in the course of the computations ...say you have a temp result with heavy error influence and apply log function to it, or use it as exponent. What's the difference?

I mean that by cleverly arranging the way one computes something, you can avoid rounding errors. But let's think about it again - does this define "quality".

Think about the first version of doom ... "quality" was there defined as "it has fast graphics without stutter" ... these guys came up with https://en.wikipedia.org/wiki/Fast_inverse_square_root and said: the result is close enough in a mathematical sense but cool fast animations are more important.

Anyway ... that's just some smart-ass comments regarding "quality" and floating points.

Peter

User avatar
KVRAF
6066 posts since 6 Jan, 2017 from Outer Space

Post Fri Jun 25, 2021 10:55 pm

FathomSynth wrote:
Wed Jun 23, 2021 11:33 pm
Double floats are the answer. I stumbled across some medical data which states clearly that the human ear is far more sensitive than the eight decimal places of precision provided by single floating point. All other articles and music audio developers will tell you that I am wrong and that single float is beyond human hearing but I think they might be wrong and it contradicts the medical data. And they might also be forgetting that the rounding error is every single sample.

Only one way to find out.
Eight decimal places is 32-bit float. A 64-bit application on 64-bit processor would do 64-bit anyway. Problems with resolution belongs to a long gone past…

Return to “Instruments”