Reset cycle~ Phase with bang?

Mikelib's icon

Hi,
I am synthesizing a bell tone that has some slight modulation on the fundamental. I have amp modulated the tone with a cycle~ object. The only problem is that when I trigger the bell tone using a bang the modulated cycle could be anywhere in it's waveform. Therefore the hits are not consistent. How do I reset the phase of the cycle on each bang?

Thanks in advance, Mike.

pgk's icon

is this what you want to do?

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

Mikelib's icon

Hi,
Thanks for the reply. Sending a 0. into the phase input doesn't seem to work for me. I have tried a float into sig~ and into phase as well and it still doesn't reset.

Thanks,Mike.

Tim Lloyd's icon

You can use a phasor~ to drive the phase inlet of cycle~ and then reset phasor with a [button] > [ trigger 0]. Then you just send the desired frequency to phasor~ instead of cycle~.

like so:

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

pgk's icon

I see...

Maybe you could post a small patch with what you want to do
and indicate the problem specifically.

Cheers!

Mikelib's icon

Excellent. The phasor reset works. Thanks for the help guys.

Mike.

jayrope's icon

Thanx Tim Llyod, helped here to get phase distorted bass drums clean.

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

Question: How to avoid clicks on a cycle~ when the phasor~ gets triggered again? Example patch:

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

Hi
in this solution I reset the phase of the oscillator in 1ms, then open the envelope over 5ms. It's simply a matter of event ordering, and seems to work fine; any residual transients occur only at around 100-200Hz, but are not envelope or phase-reset clicks:

Brendan

jayrope's icon

Thank you very much, Brendan. Smart and simple.

_ hyena/_'s icon

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

this is my patch. with the hints in this thread it got better, but i still hear differences in each instance of my kick drum. why? anyway it seems a bit awkward in 2018 in such a refined environment as max msp to not have a simple way to reset the phase to zero degrees in oscillators.

kLSDiz's icon

@_ HYENA/_
See below (changes to your patch marked with red color). In your original patch the cycle~ object had attached two sources of frequency. Of course you can make your own object encapsulating desirable behaviour, and from that point on Max will have "simple way" of doing anything ;-).

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

_ hyena/_'s icon

thanks, checking it right now!!!
EDIT: perfect!it now works and i finally understood! so the phasor not only resets the phase, but modulating fase sets the frequency too of the cycle~, correct? (thanks again)

Roman Thilenius's icon

phasor ... drives the "playhead" inside the cycle wavetable (as soon as its signal is connected to the second inlet of cycle) - as opposed to a cycle object "running" on its own.

phasor starts exactly at 0. and ends exactly at 1. , where 0-1 describes the way once through the wavetable.
(i guess it would be right to claim that technically the cycle object has a "phasor" built in, which is controlled by inlet #1)

you can modify the phasor output to play backwards or only the first half of the cycle object, or you can distort the linear path from 0. to 1., or, as requested here, to restart the playing from 0. controlled by a bang, which is, among things, required to sync two or more cycles.

_ hyena/_'s icon

thanks for your clear explanation! really useful!