round ceiling for max 5?

Feb 6, 2011 at 11:32am

round ceiling for max 5?


are there any externals for rounding to the ceiling for max 5?

thanks for any help.

Feb 6, 2011 at 12:40pm

expr int($f1)+1?

Feb 6, 2011 at 1:28pm

This won’t work if the input is an integer.

There’s a ceil function by Jasch, or you can use bach.expr…
… or
[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)

Feb 6, 2011 at 2:30pm

How about jstrigger?

– Pasted Max Patch, click to expand. –
Feb 6, 2011 at 7:14pm

[expr int($f1+0.999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)]


Oh…that actually doesn’t work :(
but if you don’t mind the low accuracy:
expr int($f1+0.99999)

Feb 7, 2011 at 10:28pm

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.

Feb 8, 2011 at 4:05am


Feb 8, 2011 at 9:14am

thanks for suggestions guys, i wil try lp.scampi

May 31, 2013 at 5:46am

is there anything in max 6 that does this? im surprised its not a standard expression.

May 31, 2013 at 2:26pm

[jit.ceil] ought to work, I guess.

May 31, 2013 at 11:42pm

How about:

+ 0.5


– Pasted Max Patch, click to expand. –



You must be logged in to reply to this topic.