Reset phasor when click is detected at signal rate

    Jun 19 2013 | 6:30 am
    Hey all,
    I've been digging around a bit and I have a super simple question.
    How do I reset a phasor when a signal goes from 0. to 1.?
    I need the phasor to be going at a given frequency but reset intermittently by another signal. It must be done at signal rate which I am fairly certain rules out using the "phase" inlet.
    I tried to build something with the gen~-phasor.maxpat example but my gen~ fu is not yet strong enough (I know I need to use expr but I can't quite figure it out).

    • Jun 19 2013 | 10:30 am
      The trick is not to reset the actual phasor~, but instead offset its output by subtracting it from itself, sah~ samples for an offset constant at the click~, pong~ wraps the offset output:
      (included a gen~ version there, too, simply replaced 'pong~' with 'wrap') (just one of many ways to do it...)
    • Jun 19 2013 | 3:18 pm
      Perfect, thanks! I would not have figured that out.