integrating grooveduck or zero-crossings into phasor-based beat slicer

protozoa's icon

I could use a little help integrating either grooveduck or zero crossing faders into the phasor-based sample slicer in gen~. Ideally only a slight delay would be introduced to smooth out amplitude discontinuities. I'm much more comfortable programming in Max but I'm having a hard time with learning gen. I've been working at this for a long time but I'm hoping someone here has the knowledge and skill to do this in a few minutes.

beat slicer and grooveduck and zerox.maxpat
Max Patch

Graham Wakefield's icon

The usual starting point would be to have two players and briefly crossfade between them. The point being that neither player can make a sudden jump (waveform cut) unless it is fully crossfaded out.

Then it is all about figuring out when to schedule crossfaded to achieve the slicing effect you want.

It might be easier to decouple the player playback from the phasor. First, get the phasor's rate of change, or slope, via phasor -> delta -> wrap -0.5 0.5. You can then accumulate that using a history & + loop. That will give you an endlessly rising line that has the same slope as the phasor, and you can use that to drive sample playback. Stick a switch into the feedback loop to be able to reset the position as desired, but only allow that switch to interrupt the line of the player is currently crossfaded out. That gives you a very generalized way to make cuts without clicks.

Then it is all about how you decide when to make cuts (when to trigger the switch), and what offsets to use when you do (what value to put in the switch).

There's more refinements you can do to this, like waiting for a transient or zero crossing to align the crossfades better (which also requires lookahead for half the crossfade period), but getting a basic seamless jump with crossfading is the first step.