trigphasor
A resettable linear ramp between two levels.
Plugin opcode in scugens.
A resettable linear ramp between two levels (port of Supercollider's Phasor). trigphasor is a linear ramp between kstart and kend values. When its trigger input crosses from non-positive to positive, trigphasor's output will jump to its reset position (or to _kstart_if no reset value was given). Upon reaching the end of its ramp, trigphasor will wrap back to its start.
Syntax
aindex trigphasor xtrig, xrate, kstart, kend [, kresetPos]
kindex trigphasor xtrig, xrate, kstart, kend [, kresetPos]
Performance
xtrig -- trigger, whenever this crosses from non-positive to possitive
xrate -- value added at each evaluation. When running at k-rate, this value is added at each cycle; at a-rate, this value is added per sample (ksmps per cycle).
kstart, kend -- start and end values of the phasor
xtrig -- trigger, whenever this crosses from non-positive to possitive
kresetPos -- if specified, this value will be used to jump to after a trigger. Otherwise, a trigger will set the position back to kstart
To generate a phasing signal from kstart to kend with a given period (duration of each cycle), the calculation would be:
In the case of phasor being used at k-rate, use kr instead of sr in the above formula.
Examples
Here is an example of the trigphasor opcode. It uses the file trigphasor.csd.
See also
Credits
By: Eduardo Moguillansky 2017