Phasor~, tap speed

Mistadobalina's icon

I want to tap the speed for a phasor~ and reset the phase for every tap. This way I will be able to sync the phasor~ to a beat. I think this is also happening inside stompboxes that use a tap tempo function.

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

What I've tried so far causes a discontinuity in the waveform, so you hear a click. Do you know any solution for this?

pid's icon

this is because your trapezoid~ is being driven by a phasor~ that does not always reach its peak (because you reset the phase with every tap), therefore the fade out portion of the trapezoid~ does not take effect. all the clipping is occurring because of this non-engaged fadeout portion. just add some logic to deal with the discontinuity.

Mistadobalina's icon

Yeah, I am aware of that. It's just that I'm having some trouble figuring out the logic to deal with it.

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

Here's a solution I've come up with, but I hope it can be done more efficiently.