speed limiting pseudo bangs in Gen?


    Jun 03 2017 | 8:38 pm
    Is there a way to speed limit pseudo triggers in Gen?
    While comparing RMS to peak values my gen generates a 1 upon peak value exceeding a threshold value, else resulting in 0. Using this to pseudo-trigger an ADSR.
    The mechanism generates way too many pseudo-triggers per time, obviously, as any hit on a contact mic for instance generates several triggers in very short intervals, of which i actually only need the first one, but suppress the rest of that sequence.
    I'd like to limit the occurrence of 1 in a signal flow to appear only once, if the last appearance was less than let's say 100 ms before.
    I know it must be a simple (codebox?) thing, but can't seem to be able to wrap my hand around this.
    Thank you for any insight.

    • Jun 04 2017 | 2:58 pm
      Here's a patch, which makes this problem visible. I can limit the speed of triggering, but end up having no triggers left at all, when speed gets too high.
      Please look at this. I think i only miss a minor point in the gen~ part. But which point exactly?
      Max Patcher
      In Max, select New From Clipboard.
    • Jun 05 2017 | 9:49 am
      use a change operator, perhaps?
    • Jun 05 2017 | 10:37 am
      Not sure if this is exactly what you're trying to do, but it's a simple trigger threshold + hold time. The main thing is to use a sample counter for the hold time that will suppress further output, but also ensure that this sample counter can only be reset once it has expired.
      Max Patcher
      In Max, select New From Clipboard.
    • Jun 05 2017 | 12:56 pm
      Thanks a lot for this example patch, Graham.
      This is exactly, what i was looking for, and teaches me much about Gen intestines as well. Didn't realize i can do the if () things with a ? operator. Ai ai ai. Great workshop! Are you doing this sometimes, workshops, i mean? In Berlin eventually?
    • Jun 07 2017 | 4:57 pm
      I reworked Grahams patch below. Added was a random pseudo trigger generator and two scopes, so one can see, if passed through triggers are still in sync (they are).
      This works nicely after this peak vs. rms trigger generator.
      Max Patcher
      In Max, select New From Clipboard.