How to reset a cycle~ used as lfo

Luc Blanchard's icon

Hi,
I'm using a cycle~ to generate an lfo outputting a signal from -1 to 1 , i'd like to create a bang that reset the cycle signal to a fixed position like 0.
Is it possible ? I tried to input a number in the phase in, but it only create a small shift on the current cycle position.

Thanks for your help.

Max Gardener's icon
Max Patch
Copy patch and select New From Clipboard in Max.

I don't use cycle~, myself - my stuff's always in an abstraction where I want to select different waveforms for outlet, so driving everything off a single phasor~ somewhere (with a rate~ here and there) is more how I roll.

Luc Blanchard's icon

Awesome thanks !

Christopher Dobrian's icon

The right ("phase") inlet of the cycle~ object should more accurately be called the "phase offset" inlet. When MSP is turned on, every cycle~ object starts at cosine phase (at a value of 1), plus whatever phase offset is specified in the right inlet either by a signal or by the most recently received float (with the phase offset value specified as a fraction of a cycle). If you change the value going in that inlet, you're changing the amount that gets added to the phase, but it doesn't cause cycle~ to leap to that location immediately.

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

Instead, you should use a cycle~ with frequency of 0 (the default) and move through the wavetable by driving it with the output of a phasor~ (set to the desired frequency) going into cycle~'s right inlet, Then, whenever you want to reset the phase, send the desired phase into the right inlet of the phasor~, which, unlike cycle~, does reset to that phase position immediately.