Forums > MaxMSP

compare if with split in the same structure

May 12, 2012 | 2:18 am

hi there
there is a simple comparison.
i think it is the same structure but different ways to accomplish
i dont know which one is more efficiency than another.

and if I want the number is not bang every time but bang once in a certain range ? how ?

thanx very much

– Pasted Max Patch, click to expand. –

[attachment=193604,3859]

Attachments:
  1. snappp.png

May 12, 2012 | 4:36 am

split wins:

– Pasted Max Patch, click to expand. –

May 12, 2012 | 5:59 am

@Chris Muir you win :) thanx a lot


May 12, 2012 | 6:34 am

[flonum]
|
[expr ($i1>=0 && $i1< =238)*(-1) + ($i1>238 && $i1< =485)*(244) + ($i1>485 && $i1< =735)*(374) ]
|
[if $i1 then $i1]
|
[+ 1]
|
[print expr]

110 wins.

p.s.: damned, i had to fix it twice and now its three objects instead of one expr like planned. :)


May 12, 2012 | 8:21 am

exper is not the fastest, assuming I did this right:

– Pasted Max Patch, click to expand. –

May 12, 2012 | 8:50 am

i sometimes wonder how one could predict better when expr is more effective than if.
what happens when you do the same but with float?


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