integers as binary patterns sync problem

Hannes d'Hoine's icon

I'm making a sequencer with the integer to binary functions from the GO-book. I have included a detail of the patch. When I change the integer from which the sequence is derived (red message boxes), I sometimes get double trigs and such because the sequence doesn't stay in sync to the previous value.

I am trying to fix this. I have tried a latch operator that only lets the new values through upon reset of the general phasor (both step values and seed values, in1 and in2 on the gen~ patcher) but that doesn't help. Any ideas?

What I basically want to achieve is that the sequence stays in sync all the time, and that changing the seed integer doesn't have an effect on the sync.

I think that I somehow need to update the seed and division values at the same time, when the div phasor is zero. But when I latch the stepnumber (in 2 of the gen patcher) everything stops.

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

Holland Hopson's icon

I synched the pattern choice and the reset with the phasor~ and it seems to have fixed the problem. There's still room for improvement since the synch happens outside of gen~, but it may be enough to get you started.

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

Hannes d'Hoine's icon

Thanks! Forgot to edit the original post, I managed to change also in sync with the phasor within the gen patcher. It didn't work originally because I was using the wrong phasor. (First the generale phasor and later the div, bit using the pattern phasor did the trick :) )