If statement not switching btwn movies

Feb 15, 2011 at 11:50am

If statement not switching btwn movies

Hi, I’m trying to switch videos depending on the value from an arduino input which i can do fine when I simply switch but is not working when I use the if statement. Can anyone help?

– Pasted Max Patch, click to expand. –
#54968
Feb 15, 2011 at 12:24pm

if is an object, not a message. A new object is created when pressing the “N” letter on your keyboard while a message is created with a “M”.

Anyway, for your patch, I’d use a sel:

– Pasted Max Patch, click to expand. –
#197939
Feb 15, 2011 at 11:14pm

Thanks for pointing out my use of M instead of N Patrick – this had me really puzzled. I am going to stick with the if statement though because I need to stream the inputs according to ranges so I am using 2 if statements and one split object.

– Pasted Max Patch, click to expand. –
#197940
Feb 19, 2011 at 11:51am

I’ve got the if and split objects working fine with imovie (see post above) but am trying to apply the same logic to a jit.qt.movie unsuccessfully. I’m going to post this issue in the jitter forum too as I’m not sure where the problem lies. Any ideas? Thanks

– Pasted Max Patch, click to expand. –
#197941
Feb 19, 2011 at 1:21pm

Should the 2nd if statement actually be a > rather than a < ?

#197942
Feb 19, 2011 at 1:36pm

Yes it should but that’s not the problem. I just can’t get the if objects to work but the split object is working so I’m going to replace the ifs with splits. Thanks for responding anyway.

#197943
Feb 19, 2011 at 9:41pm

Kurt Kalske came up with this response which works – Thanks again Kurt:

“There were two errors in your patch. The “if” statement requires a typed variable, “$i1″ instead of just “$1″.
Also there’s a logic error: you want to test when your variable transitions into the next chosen range, not constantly reporting what range it is in. Try the example below.

Multiple boolean conditions are very difficult in Max. I tend to do this sort of thing in Javascript, because it’s much more straightforward in text code.

– Pasted Max Patch, click to expand. –
#197944

You must be logged in to reply to this topic.