detecting if a number coming from a sensor is changing


    Feb 03 2009 | 11:39 pm
    hi again
    i have had a look at the change object but it seems to do the opposite of what i want
    i am playing sounds in response to numbers coming in from a sensor and i need an object (or combination of objects) that can continually test numbers coming in from the sensor to see if they are changing or staying the same. if they stay the same (and the sensor is not registering anything) then after a short while i want to fade the sounds out, i think i can do this but i need something to test if the numbers are not changing.
    can anyone help?
    many thanks

    • Feb 03 2009 | 11:55 pm
      Hi, I didn't see your original post, but I recently discovered the glory of the change object myself. What if you used it to trigger a timer? The change object would start the timer whenever the numbers change, and then you could put a "select" object after the timer, and have it trigger an adsr~ (or whatever it is you are using to fade your sound out). Have the select object look for the number 5000 for example. That way, if the numbers don't change for 5 seconds (5000 ms) the select object will trigger an envelope - or whatever else you like, to change your audio. Anyway, hope this idea is what you're looking for - I'm only a junior member, but maybe this will help.
    • Feb 04 2009 | 3:16 am
      I think that's what you are looking for...
    • Feb 04 2009 | 7:13 am
      yeah, I think your way is easier... I tend to go by the brute force method. nasty habit of mine.
    • Feb 04 2009 | 10:59 am
      doh! i forgot to mention that im only using max 4.5. is there any chance anyone can convert that inv change.maxpat so i can see it?
      many thanks
    • Feb 04 2009 | 11:40 am
      this will do it!
      >
      >doh! i forgot to mention that im only using max 4.5. is there any chance
      >anyone can convert that inv change.maxpat so i can see it?
      >
      >many thanks
    • Feb 04 2009 | 7:53 pm
      In my experience, values from sensors are constantly changing. That's why I love using them... So you might try tracking the difference between successive values. Then if the amount of change is within or beyond a certain range you can trigger something.
    • Feb 05 2009 | 2:19 am
      Quote: Holland Hopson wrote on Wed, 04 February 2009 13:53
      ----------------------------------------------------
      > In my experience, values from sensors are constantly changing. That's why I love using them... So you might try tracking the difference between successive values. Then if the amount of change is within or beyond a certain range you can trigger something.
      ----------------------------------------------------
      yes, love and hate the inherent jitteriness of them... that's been more of a pain than a pleasure for me. ah well. The "difference idea" is good for triggering something only when there's a bigger change than the average noisiness that comes even when the sensor isn't really sensing anything. Likewise, depending on the programming on the sensor side, you can prevent some of the jitter from coming in in the first place (only send out if it jumps by 2, etc).
      Also you might check out the "sensor tamer" in the Extras--Examples Overview, could give some ideas.
    • Feb 05 2009 | 2:38 am
      On Feb 4, 2009, at 11:53 AM, Holland Hopson wrote:
      > In my experience, values from sensors are constantly changing.
      When I want clean sensor data, I have used this abstraction, which I
      call flatline :
      Chris Muir
      cbm@well.com
    • Feb 05 2009 | 2:54 am
      Chris, that is a great solution which solved a bunch of rather unsuccessful fiddling I've tried. Very nice!
    • Feb 05 2009 | 7:55 am
      I use filtering something like this:
    • Feb 05 2009 | 11:01 am
      Yet another solution, originally built by Trond Lossius and modified a tad over here. A bit bigger, but it does some nifty things.
      Uses lp.stacey from Litter Starter Pack, available at the URI below.