gen~ phasor phase sync not working?
Hey all,
Seems like I can't get phasor to sync by resetting its phase.
What am I doing wrong? Can someone please explain, as I've spent hours and just don't get it: how the right inlet of phasor is supposed to work at all? (gen help file, unlike the rest of the Max help files, are very obscure to me)
Well I'm not sure what sort of behavior you're expecting. Like what is the line object supposed to be doing? I'm not getting any output from that. If you just want to sync the phasor to the metro object, then I would run that into a click~ object - it converts a bang into a single sample pulse - then run that into the phase input of the phasor.
In gen~, the right inlet to the phasor is there to reset the phasor's phase to zero. Any non-zero input to the right inlet will reset the phase to zero. It's intended mainly as a kind of "sync" for e.g. using a phasor as the basis of tempo system etc.
As with most things gen~, if an op doesn't do what you need, you can probably patch something equivalent and modify it. For example, if you want to set a specific phase value, you can patch an equivalent to phasor. A phasor just accumulates a phase increment per sample (a feedback loop) that is wrapped in 0 to 1, and the sync inlet just switches this out for zero:
To set a specific phase value other than zero, just replace the 0
operator in there.
I know it also gets asked often how to set up a phasors with specific phase offset to another. That's even easier -- just use one phasor, and derive a second ramp by offsetting the phase and rotating back into the 0..1 range:
The thing with gen~ is that the basic object set is fairly small (around a hundred ops, and really only about 30 you use for 99% of patches) and low level, but that makes it way more flexible, because you can pretty much patch up most things that you might need. And many of the built-in ops you can reconstruct from simpler combinations of math, logic, and history ops, like that phasor patch above. And in nearly all cases they'll be just as efficient, because gen compiles the patch as a whole, not each object in turn.
There's also so much more you can do with phasor ramps with a bit of math and logic -- a bit part of the GO book is all about this :-)
Thanks all, I got it.
@Graham Wakefield, your approach is pretty cool, give some food for thought. I already bought your book, and it's the next I will read once I finish the Electronic Music & Sound Design Vol.3!
Cheers!