VSaw

Multidimensional sawtooth video oscillator
See also: LFSaw

Description


Similar to its analog sibling LFSaw the VSaw is a video sawtooth oscillator. It can process inputs of one to four dimensions and produces an output in the same dimension. The arguments parallel the arguments used by LFSaw , although the output is configured to range from [0, 1].

Class Methods


VSaw.fr(freq: 1.0, phase: 0.0)

dimensions

input

output

1, 1, 1, 1

1

2, 2, 2, 2

2

3, 3, 3, 3

3

4, 4, 4, 4

4

Arguments

freq

Oscillator frequency in cycles per second or Hz.

phase

Oscillator phase in radians.

Examples


// This example represents some of the early origins of the Scintillator logo.
// It uses a VSaw to generate the bands. Each pixel on the screen is oscillating
// at 5 Hz, but the phase changes as a function of distance from the center of
// the screen. This smooth variation in phase causes the bands to appear to
// move outward over time.
(
~t = ScinthDef.new(\t, {
    var pos = VNormPos.pr.abs.neg;
    var z = min(VX.pr(pos), VY.pr(pos));
    VBWOut.pr(VStep.pr(0.5, VSaw.pr(freq: 5, phase: z)));
}).add;
)

(
~k = Scinth.new(\t);
)