phase drift/offset inside diy gen~ phasor

brendan mccloskey's icon

Hi
I am using two [accum]'s inside gen~ to generate a mutable phasor (for a sample-accurate granulator). In pursuit of a polyphonic version I have added + and % to the muting [accum] to give each voice a unique phase position. It seems to work ok, but when I now vary the grain size, the phase positions drift when I'm expecting them to stay fixed. The very simple annotated patch below illustrates the issue. I know that the error lies in my gen~ skills:

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

"sub" for poly:

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

main:

Brendan

brendan mccloskey's icon

fwiw

I have placed the phase-shifter in a very specific position inside gen~; this is to avoid shifting the zero portion to >0., which will happen when the phasor ramp has the interonset value added to it.

The phase drift seems to be occur when the grain sizes are varied to

Brendan

davidsmith's icon

here's something very similar based on the older 'gen woes' thread that does what you want *(i think).

As your patch is so similar, I tried to incorporate my possible solution but I couldn't get it to work...

the problem seems to lie with the main 'phasor with mute' accum object in individual voices not resetting at the same time *after* they've been changed.

It might not be what your after, but if you send the "size" parameter as a signal, it will affect all voices regardless of which voice is targeted.

GEN-SIMPLE-GRANULAR-POLY.maxpat
Max Patch
granpoly.maxpat
Max Patch