how to generate a bang when signal reaches peak amplitude?

    Jan 20 2010 | 12:59 am
    I need to generate a bang every time my MSP signal reaches it's peak amplitude. I only need it to work for a triangle~ that oscillates from -1. to 1. The problem is that snapshot~ doesn't seem to ever capture the 1. and I am not aware of something like sel that works with signals.
    Thanks, Zach

    • Jan 20 2010 | 1:09 am
      Try [delta~] which will output something positive when the [triangle~] is ascending and negative when descending, then check which using [
    • Jan 20 2010 | 1:38 am
      Perfect. Thanks!
    • Jan 20 2010 | 5:40 pm
      what about ==~1. and then snapshot?
    • Jan 20 2010 | 11:37 pm
      dont think you can use snapshot, as the signal might hit one and then pass by so quickly that snapshot may not necessarily see this
    • Jan 21 2010 | 2:50 am
      The real problem with looking for a signal equal to 1 is that the oscillator probably won't hit 1. It might happen every now and again, but most often the 1 of the waveform would theoretically fall between samples, and hence if you examine the signal out of the object you won't see a value of 1.
      In the past this 'issue' came up quite a lot, so actually this made it to the Max FAQs as you can see here (5th question down):
      delta~ based approaches for this task are generally much more appropriate, simpler and accurate then any methods based on detecting a particular value....
    • Jul 11 2012 | 10:26 pm
      i need to output a bang each time a square wave changes from 0 to 1, or from 1 to 0. how might i do this??
      thanks :) :) :)
    • Jul 11 2012 | 11:16 pm
      i'm trying to find out based on the previous replies on this thread, but [
      the help file for it says: "
      maybe i'm being dim, but doesn't that mean it outputs two values with a less than zero input?
      or just any help with my question in my previous post?
    • Jul 12 2012 | 11:11 am
      must be a typo in the help file-- should read: " in answer to your original question use >=~ 0.5 and edge~
    • Oct 13 2014 | 3:45 pm
      Hi, I am doing some logical operations with signals and I want to count every time I have 1 as result and not only the crossings from 1 to 0 or vise versa . Any idea?
    • Oct 13 2014 | 7:45 pm
      Send it into the left in left of +=~. It will do a running sum.