syncphasor Signal Generators:Phasors syncphasor syncphasor Produces a normalized moving phase value with sync input and output. Description Produces a moving phase value between zero and one and an extra impulse output ("sync out") whenever its phase value crosses or is reset to zero. The phase can be reset at any time by an impulse on the "sync in" parameter. Syntax aphase, asyncout syncphasor xcps, asyncin, [, iphs] Initialization iphs (optional) -- initial phase, expressed as a fraction of a cycle (0 to 1). A negative value will cause phase initialization to be skipped. The default value is zero. Performance aphase -- the output phase value; always between 0 and 1. asyncout -- the sync output has a value of 1.0 for one sample whenever the phase value crosses zero or whenever the sync input is non-zero. It is zero at all other times. asyncin -- the sync input causes the phase to reset to zero whenever asyncin is non-zero. xcps -- frequency of the phasor in cycles-per-second. If xcps is negative, the phase value will decrease from 1 to 0 instead of increasing. An internal phase is successively accumulated in accordance with the xcps frequency to produce a moving phase value, normalized to lie in the range 0 <= phs < 1. When used as the index to a table unit, this phase (multiplied by the desired function table length) will cause it to behave like an oscillator. The phase of syncphasor though can be synced to another phasor (or other signal) using the asyncin parameter. Any time that asyncin is a non-zero value, the value of aphase will be reset to zero. syncphasor also outputs its own "sync" signal that consists of a one-sample impulse whenever its phase crosses zero or is reset. This makes it easy to chain together multiple syncphasor opcodes to create an oscillator "hard sync" effect. Examples Here is an example of the syncphasor opcode. It uses the file syncphasor.csd. Example of the syncphasor opcode. See the sections Real-time Audio and Command Line Flags for more information on using command line flags. See also phasor. And the Table Access opcodes like: table, tablei, table3 and tab. Credits Adapted from the phasor opcode by &nameanthony; January 2008 New in Csound version 5.08