round ceiling for max 5?
are there any externals for rounding to the ceiling for max 5?
thanks for any help.
This won’t work if the input is an integer.
There’s a ceil function by Jasch, or you can use bach.expr…
[expr (($f1 >= 0) * int(($f1 != int($f1)) + $f1)) + (($f1 < 0) * int ($f1))]
will do the trick (not sure it’s the most clever way, though)
How about jstrigger?
-- Pasted Max Patch, click to expand. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 370.3ocyS0saCBBF8Z7ofvUsINhfh+r61CvdBZZVnJ0RiBFkl0sl9tOE0U6R 1lcaWraHgy2GGNmCebxAf1nOJZPv6gqf.vIG.vB0A.F1CPk7ioE7FaansEZ0 gRjaeoJtIcmTk+TsH0zSSDAGSiYQLWHMNBS78Xz.WHyC60hztBWObXYlkQ8l 82wFIbqVYT7RgsxC0RdwXk1aUpJDFqLHW.0GLinzIjzHe0RBg1du8v8cZdoR zqzNuvMHWHZCWkidWWU0hFgxvMRsZhwHgIX+HhGIxE5G3iSXIgzVWZMl0WcG +riS2h6LiSk34V+O5Qi3n8xP6aL0x7bQMbwibyNbpPVrfuxa8xkyL5YwXRrW RXhKjDP9prO3OI6I2X1i9Qw0MM8QCwAwAr3jua5i9uX5aRbXEIpPp93eSqi6 vuNiZzGpSG4c3MEdwpYhFiTYmmmzC6pd1IyxD1xiBtTlUokJyfD9j2q4pH5L TTvuPQsaN67F5N8Gf. -----------end_max5_patcher-----------
Oh…that actually doesn’t work :(
but if you don’t mind the low accuracy:
lp.scampi has ceil, floor, trunc, round, and toinf modes for converting floats to integer.
Max 5 users will want the version of lp.scampi in the Litter Pro Bundle. Lp.scampi is also included in the free Litter Start Pack, but the Starter Pack is really only happy in the Max 4 world. I may get so tired of writing this caveat that I get an updated, Max 5-friendly version of the Starter Pack out. Still, there *is* always the Pro Bundle, which is quite happy in Max 5.
thanks for suggestions guys, i wil try lp.scampi
is there anything in max 6 that does this? im surprised its not a standard expression.
[jit.ceil] ought to work, I guess.
<code>-- Pasted Max Patch, click to expand. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 389.3ocwT00aBBCE8Y3WQSecLSopnr2V1OiEyREpyt.sDnj4lw+6q8hchJpr Mi6klzSuv8bN2OV66gmqVwqvnGPOi77V664APV.us28v4rUIYrJHLbhJOmK0 3fl2z7UZ.+ItHSHe0gKRAT072teD0AtPI0RVNGd5wRAKy8hrNWHy3ZHGg6.U 0ZGJYKZASmrzjoWJ4I5FlOgLfDfFECmSrmTCBZVqzVI9DRaHc.whtw22dDzS UK4uajxQh9NDYv3tjL4GJYZmRN7zRNBjYnUNAngSORyM+E8GE7l3wKxTLy2d E8DyezP2NT+v3eYAunjWY5sXZgR1RqzgiAUFCkY2w2RYeOidFOKB7rltkwj9 5YAH7bloy913cSuJCKzK04LI5+2DNwPUopVl1k0DciFpFEBKRBur2zK6.hAa VNd3hVfAV788nJUcYhKCtdBzNVjxqzBILjzJH6JmVAsTjlxks2alKRKTBodK IPy5rh0WNcP55lS1J1MjSGjtSvo3+.mLW13+EvuwoFE -----------end_max5_patcher-----------
Using 0.4999 works (for most uses) but 0.5 will round any integer up to the next integer instead of staying unchanged.
Incidentally I am looking for a floor/ceil object. I have to say it’s quite annoying searching around for such basic things when they could have been implemented easily in the round object to begin with…
Forums > MaxMSP