Frac32 vs Float


#1

I've been poking about....

It looks like Frac32 aka Q5.27 is the preference for fractional values.

That's a choice, particularly for a machine without an FPU, but this platform has one, and so far as I can tell it's performance is comparable to the int operations and involve less mucking about with shifts, saturation, etc. You lose a few fraction bits going to single precision float, but code clarity is improved (IMO).

Then there's the interesting case of the mutable modules where Q5.27s are converted to and from a float on either side of the call to the mutable code.

So is there any thought to having a FloatBuffer type to connect objects?

You could even do implicit conversion and allow direct connections between Frac32 and Float types :slight_smile:

I apologize if this is a fixed/floating point religious issue, I'm just trying to avoid the cognitive load of shifts, SMMUL, SMMULA, etc.


Using floats vs fixed point maths
#2

:grinning:

Oh the shifting...... That confused me a lot to start with :sob: But I get it now :grin:

I have also been a lot into PD and for example everything time related is just much easier to work with when you dont have to do all the bit shifting.

Sorry dont know much about the rest :wink:


#3

The shifting is still confusing me. Could you maybe explain it a bit? The explanation I found here [https://sebiik.github.io/community.axoloti.com.backup/t/coding-axoloti-objects/2606](Coding Axoloti Objects) does not explain why it is needed.