Hi,
I copy a max version patch that should filter jittering numbers:
Why it output floats? I don't want it to output float rather same numbers (integers) as input
filtering jittering numbers - avoiding floats
Hi,
I copy a max version patch that should filter jittering numbers:
Why it output floats? I don't want it to output float rather same numbers (integers) as input
@KMETE The average/mean of 1 and 2 is 1.5. Put an [i]
after the change and it will round to the nearest integer.
Edit: actually [i]
does not round, it just strips the decimal so 1.5 becomes 1. [expr round($f1)]
will round.
@KMETE said:
I copy a max version patch...
A hidden source of trouble with this approach is that Max has integer-only operators while Pd only has floats.
In Max (IIRC), 3.1 --> [+ 2] produces 5, not 5.1. 3.1 --> [+ 2.] (with a decimal point) produces 5.1.
In Pd, the "dot" thing doesn't exist. If you're copying a Max patch that depends on integer-math behavior, you can't just copy it directly -- you need to handle the integer conversion explicitly.
I've gotten bitten by this multiple times when going the other direction (building something in Max and expecting float ops).
hjh
Oops! Looks like something went wrong!