Forums > MaxMSP

Rounding problem

January 31, 2009 | 9:28 pm

If I create a 207.65 Hz triangular wave for exemple, it create a 207.649994 Hz triangular wave… Why ?

– Pasted Max Patch, click to expand. –

January 31, 2009 | 11:14 pm

Quote: Bertrand Fraysse wrote on Sat, 31 January 2009 13:28
—————————————————-
> If I create a 207.65 Hz triangular wave for exemple, it create a 207.649994 Hz triangular wave… Why ?
>
>

– Pasted Max Patch, click to expand. –

>
—————————————————-

Floating point numbers work that way; they aren’t infinitely precise.

http://en.wikipedia.org/wiki/Floating-point

You can hardly hear the difference, though.

mz


January 31, 2009 | 11:26 pm

The difference in frequencies is 0.000006 hz which equates to a beat repetition period of about 46 hours. Not audible.
>
> You can hardly hear the difference, though.
>
> mz
>
>
—————————————————-


January 31, 2009 | 11:41 pm

Yes I agree, I can’t hear the difference, but I don’t remember this hapenning in Max 4…
207.65 does not have to be changed, or I don’t understand why it has to show it. My object box is a lot larger for no reason.
But… It’s not a big problem.


February 1, 2009 | 12:07 am

If the long float displays are harshing your mellow (as they sometimes do for me), check ‘Float Display Correction’ in the Interface Pane of the Preferences window. This will make Max truncate numbers at what it guesses is the least significant digit.

-Ben


February 1, 2009 | 12:27 am

Great ! Thank you very much Ben.


Viewing 6 posts - 1 through 6 (of 6 total)