round ceiling for max 5?

Feb 6, 2011 at 11:32am

round ceiling for max 5?

Hello,

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

thanks for any help.

#54826
Feb 6, 2011 at 12:40pm

expr int($f1)+1?
_
johan

#197427
Feb 6, 2011 at 1:28pm

Hi.
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)

#197428
Feb 6, 2011 at 2:30pm

How about jstrigger?

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

[expr int($f1+0.999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)]

:D

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

#197430
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.

#197431
Feb 8, 2011 at 4:05am

   

#197432
Feb 8, 2011 at 9:14am

thanks for suggestions guys, i wil try lp.scampi

#197433
May 31, 2013 at 5:46am

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

#251292
May 31, 2013 at 2:26pm

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

#251331
May 31, 2013 at 11:42pm

How about:

+ 0.5
|
round

<code>

– Pasted Max Patch, click to expand. –

</code>

#251349

You must be logged in to reply to this topic.