if expression

Jan 4, 2007 at 4:25pm

if expression

hei there!

what i’m trying to do should be super simple! i want to create an if expression!!!

in any other programming language it should look somthing like that:

if -1.0 < $f1.0 > 1.0 && -1.0 < $f2 > 1.0 then OUTPUT

BUT it just wont work! thanks for your time! m.Kern

#29499
Jan 4, 2007 at 4:37pm

#92322
Jan 4, 2007 at 5:20pm

Kern,

> what i’m trying to do should be super simple! i want to create an
> if expression!!!
> in any other programming language it should look somthing like that:
>
> if -1.0 < $f1.0 > 1.0 && -1.0 < $f2 > 1.0 then OUTPUT

============

#P window setfont “Sans Serif” 9.;
#P flonum 73 146 52 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 16 146 52 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 16 119 67 196617 unpack f f;
#P flonum 444 146 52 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 387 146 52 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 16 33 52 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 387 119 67 196617 unpack f f;
#P newex 399 93 50 196617 print out2;
#P newex 28 93 50 196617 print out1;
#P flonum 387 33 52 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 16 66 381 196617 if $f1 > -1. && $f1 < 1. && $f2 > -1. &&
$f2 < 1. then $f1 $f2 else out2 $f1 $f2;
#P connect 4 1 7 0;
#P connect 0 1 4 0;
#P connect 0 1 3 0;
#P connect 4 0 6 0;
#P connect 1 0 0 1;
#P connect 8 1 10 0;
#P connect 0 0 8 0;
#P connect 0 0 2 0;
#P connect 8 0 9 0;
#P connect 5 0 0 0;
#P window clipboard copycount 11;

============

#92323
Jan 5, 2007 at 1:15am

On 4-Jan-2007, at 11:37, Jeremy Bernstein wrote:

> In all the programming languages I’m familiar with, you’d need to
> write something like the following, which does work in Max.
>
> [ if $f1 > -1.0 && $f1 < 1.0 && $f2 > -1.0 && $f2 < 1.0 then $f1
> $f2 else out2 $f1 $f2 ]

Actually, both COBOL and SQL (with which Jeremy may not have had the
pleasure) allow constructs in the form

IF const1 < x < const2 THEN ...

C and C++ also allow

if (const1 < x < const2)

but it means something *completely* different from what Martin was
expecting. Get thee to K&RII.-)

If people would spend a little more time with the tutorials and
manuals, this would be a very low-traffic mail list.

————– http://www.bek.no/~pcastine/Litter/ ————-
Peter Castine +–> Litter Power & Litter Bundle for Jitter
Universal Binaries on the way
iCE: Sequencing, Recording &
Interface Building for |home | chez nous|
Max/MSP Extremely cool |bei uns | i nostri|
http://www.dspaudio.com/ http://www.castine.de

#92324
Jan 5, 2007 at 1:50am

But then who would be around to read your plugs for the Litter bundles?

Quote: Peter Castine wrote on Thu, 04 January 2007 18:15
—————————————————-

> If people would spend a little more time with the tutorials and
> manuals, this would be a very low-traffic mail list.
>

#92325

You must be logged in to reply to this topic.