compare if with split in the same structure

May 12, 2012 at 2:18am

compare if with split in the same structure

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
#63489
May 12, 2012 at 4:36am

split wins:

– Pasted Max Patch, click to expand. –
#228889
May 12, 2012 at 5:59am

@Chris Muir you win :) thanx a lot

#228890
May 12, 2012 at 6:34am

[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. :)

#228891
May 12, 2012 at 8:21am

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

– Pasted Max Patch, click to expand. –
#228892
May 12, 2012 at 8:50am

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?

#228893

You must be logged in to reply to this topic.