Only allow control signal change on zero crossing

Mark Durham's icon

I'm trying to avoid clicks on a sample playback from wave~ by only allowing the control signals to change on zero crossings.

I'm stuck on how to do this, after playing around with sah~, gate~ zerox~ etc for a while now...

Any ideas?

Mark Durham's icon

This is the sort of thing I've tried:

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

I'm trying to understand why in that patch the phasor~ stops? It seems like this shouldn't happen as I'm just trying to trigger the sah~ with the output... explanations welcome!

nouserid's icon

Maybe this is what you're looking for?

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

Mark Durham's icon

No I'm afraid not. Perhaps I confused it with my example. This isn't about phasor~ ramps. But nice patch anyway - no doubt useful one day.

I'm playing sounds with wave~ (actually a version of wavefade.maxpat from examples) and want to adjust playback position, but with those changes only taking place on zero crossings to avoid clicks.

So I want to have a control signal going into the patcher for the start position, say 0.4, then when I change that to, say, 0.6 it waits until a zero crossing to take effect. I thought I was going to be able to do it with sah~ but it holds until a signal is above a certain level. I need a sah~ which only changes when the value is == 0. If that makes sense?

nouserid's icon

Yes, I think I understand now, though I'm not sure if I can help since I'm still fairly new to Max. Is this on the right track? Please forgive me if I have no idea what I'm doing haha.

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

nouserid's icon

Guess not.

Holland Hopson's icon

phasor~ to delta~ to <~ 0. to sah~ should do the trick.

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