A sawtooth-triangle oscillator UGen with variable duty. A width of zero
produces a sawtooth of falling slope, with an initial phase of zero making it
start at +1. A width of 0.5 produces a triangle wave, starting at -1 then
raising to +1, then falling again to -1. A width of 1.0 produces a sawtooth of
rising slope, starting -1.
Increasing the initial wave will increase the offset into the waveform. For
example, with a phase of 0.5 and a width of 0.5, the result is a triangle
waveform that starts at +1.
There is a strange anomaly for the falling sawtooth (zero width): Instead of
starting directly at +1, the first sample is -1 and only from the second sample
at +1 the waveform starts falling. In other words, the waveform has a delay of
// width modulation
val freq = LFPulse.kr(3, 0, 0.3).madd(200, 200)
val width = LFTri.kr(1.0).madd(0.5, 0.5)
VarSaw.ar(freq, 0, width) * 0.2
frequency in Hertz
initial phase offset in cycle (0 to 1)
duty cycle from zero to one.