phasor~ and signal based sync

daanbr's icon

Yellow!

I'm looking for a way to reset the phase of a ramp generating oscillator for clocking purposes.
For critical timing, the reset has to be signal based.

To be honest i'm really surprised phasor~ doesn't have the option for a signal based phase control / reset. (saw~ does, but it's not suitable for clocking).

Any clues on how to achieve this?

Cheers!

ćwiek's icon

if 1 ms is ok, maybe "peakamp~ 1" before phase input?

MuShoo's icon

This requires you to have gen~, but should hopefully do what you need, or at least be a good jumping off point. There's no phase parameter in this (I was lazy and it's somewhat of a pain to do with this style of phasor, actually).

Max Patch
Copy patch and select New From Clipboard in Max.

Anyway, set your frequency in the left inlet, and any change in input in the right inlet will trigger a reset. I'm using a train~ object to generate pulses, but you could actually get away with noise~ and a sah~ - as long as the right inlet is stationary it won't trigger a reset.

Dave Mollen's icon

I posted a solution for this before. It's here: https://cycling74.com/forums/reset-the-phase-phasor-at-signal-rate
Instead of triggering it with a bang you can also generate pulses from other sources with [change] or [delta].

daanbr's icon

Thanks for the feedback~ folks.

Finally had an excuse to explore gen a bit, thanks for the up MuShoo.

Clever solution Dave! the beauty of simplicity... thanks.