Retriggerable single-cycle ramp from a phase/rate signal

Luca Schwarz's icon

Hi everyone,

I'm working on a timing system in Max / gen~ and I'm trying to build a small component that behaves like a phase-synchronous one-shot ramp.

Context:

I have a continuously running phase signal (0→1 ramp), produced by rate / phasor.
This phase is the master timing reference in my patch and must keep running continuously.

What I would like to generate is a retriggerable ramp that:

• starts when I send a single-sample trigger
• follows the exact timing of the existing phase signal
• outputs one or more full 0→1 cycles
• then stops again

Example behaviour:

trigger → output N ramps (adjustable)

So essentially:

trigger → phase-synchronous ramp generator with adjustable number of cycles

Important constraints:

• the original phase signal must NOT be reset
• the ramp must stay perfectly synchronized to that phase
• the trigger is a single-sample impulse

Thanks a lot!

MakePatchesNotWar's icon

What are you struggling with? It seems like you have a good idea of how to implement this no?

Stevon's icon

I don't know if I understood this correctly but, if its in phase with the "master-phasor"wouldn't that be just a gate that closes after N-Amount of cycles?