How to limit bangs?
May 1, 2008 at 3:39am
How to limit bangs?
Hi, I’m a New Media student at SUNY Purchase and am looking for some assistance with this project because none of the professors here know MAX at all.
I’m using light sensors to trigger video playback but the problem is it bangs it continuously so the video never actually gets going until the sensor has been covered again.
The sensors are giving off numbers like 300 when covered and 500 when exposed so I’m using IF objects like this:
if $i1 > 500 then set $i1
Also, if I want it to trigger only during a certain range of numbers can I just tack on a “< 600" after my "> 500″?
Any advice on how better to do this would be much appreciated! I’ve attached my patch so far if you want to take a look.
May 1, 2008 at 6:33am
What exactly are you trying to do?
I see you’re using the if/then range checker to trigger reading different movies into jit.qt.movie. You should use a bang message instead of sending your number to a bang. It’ll be more efficient.
you can use the if/then object to sniff for a range of numbers, but you have to use ‘&&’ to create multiple conditions. Your example would look like [if $i1 > 500 && < 600 then bang]. This expression will send out a bang every time it gets a number that is greater than 500 and less than 600.
if you only need it to bang once when the numbers come from outside the range to inside it, use [change] connected to a [> 500]. You can use [select 1] connected to those to send a single bang when the numbers are within range.
May 1, 2008 at 8:09am
hi and welcome, couple advices.
1. start small. isolate just one sensor. get it right and duplicate. build a
2. refrain from using number boxes *as part* of the flow, connect object
3. working with sensors is can be frustrating, research this objects: slide,
4. have a single metro (or better, qmetro) in a patch. get to know the order
5. decide if your working with floats or ints.
#P window setfont “Sans Serif” 9.;
On Thu, May 1, 2008 at 6:39 AM, bow
> Hi, I’m a New Media student at SUNY Purchase and am looking for some
May 1, 2008 at 9:34pm
Your help is MUCH appreciated. I’m getting a better understanding of how to do this but a few questions which are probably pretty basic but:
- which inlets of [change] do I connect the [>500] and the [select 1] to?
Basically, I want to say if there is a change >500 then send one bang until until there is another change >500
- Yair, how do I translate the code you typed in the message into a patch?
May 1, 2008 at 10:17pm
look at the help files for the objects. The [>500] sends out a 1 if the argument is true, and a 0 if the argument is false. The middle outlet of the [change] object sends a one out if it detects a change from 0 to 1. [select 1] will send a bang if a 1 gets passed to it.
I have max 5 and am unsure how cross compatible patches are (still haven’t read the updated documentation) but here’s a picture of what it would look like.
May 2, 2008 at 3:55am
Thank you both for you help! You guys rule!
still can’t get this to work though:
The split object works perfectly for “sniffing” different number ranges. So that’s good!
The problem now again is with limiting the bang. The “>500___ change ___select 1″ suggestion seems to work inconsistently.
Just so it’s clear what I’m trying to do:
May 2, 2008 at 4:16am
I’ll let you figure it out, but look at the [onebang] object, which lets out 1 bang at the beginning of a stream of bangs (going it one of its outlets), and only lets another one out when another bang goes into its other outlet.
It sounds like a very interesting project.
Can’t open the file attached to the previous post, though.
May 2, 2008 at 5:33am
here’s my advice fwiw.
simplify for now. start off with two range values and two movies and get that working correctly. then add the rest.
you should really be using abstractions as well. a simple abstraction which enclosed a qt.movie and an [if then] object checking for a certain range.
but in any case, you won’t get much help with a patch that’s such a mess. strip it down to the simplest case possible which still illustrates what you’re trying to do.
You must be logged in to reply to this topic.