Math help!
  • I need some help working out a function:

    I want to trigger a timer with a toggle switch, but I want the timer to reset on both the on and the off position. It seems the timer needs a momentary zero pulse before registering the "new" 1.

    As it stands, you can use a momentary switch to reset the clock each time you push the button, or you can use a toggle switch and the timer will reset when it turns back to pink (on).

    A low-latency math-based approach would fit my needs the best - trying to avoid using the OSC node with the square wave for a pulse.

    Thoughts?
  • Edit: oops, wrong. Just a moment.
    IMG_0046.PNG
    2048 x 1536 - 146K
  • @biminiroad, well, you want to compare the current value with the previous value on a very small time scale. The Delay node is a bit of overkill, but it works. So I would actually use my example above, but set the delay time to something extremely small (but not zero). Does that work?
  • @Taylor - This works perfectly. I doubt I could think of a more simple solution - plus, the delay node only introduces like 0.02ms of latency, so it's all good.
  • This can work too.
    image.jpg
    2048 x 1536 - 122K
  • Thanks @JDRaoul! That probably saves a bit of CPU. Will fix it for Autofader 1.1 and Matrix Mixer 3.6. I'm sick of looking at them for now though - moving on to something else!
  • I have a "Pulse if Changed" subpatch I'd probably use in that instance. I also use it to create an impulse for counters and things like that.
    JJT Pulse if Changed.audulus
    31K
  • Screenshot attached.
    IMG_0104.PNG
    2048 x 1536 - 151K
  • @jjtrash - Nice! Thanks.
  • @JDRaoul's and @jjthrash's solutions are better than mine. The Delay node is kind of a memory hog, since it can support up to 10 seconds of delay (IIRC).
  • Actually I was thinking it would be nice to have a simpler delay node available for control signals, with only a delay time knob. Essentially delay that's always totally wet, and with no feedback. It just delays the signal plain and simple, like a capacitor.
  • Yeah, my Leslie speaker effect uses 4 delays just for control signals. I have another effect I'm working on that would benefit from a less complex delay setup, I think.
  • +1 for simple delay