A non-band-limited gaussian function oscillator.
LFGauss
implements the formula:
f(x) = exp((x - iphase)^2 / (-2.0 * width^2))
where x
in this context is the phase, which cycles in a range -1
to 1
over the period duration. The Gaussian function in this form is a bell-shaped apodization function, making it convenient for use as an envelope.
Its minimum value occurs when the phase x = -1
and x = 1
, and its maximum occurs when x = 0
.
duration |
Duration of one cycle, in seconds. (Hint: duration |
width |
The width of the bell curve (its standard deviation). Practically speaking, a width The bell curve becomes broader with increasing width. Beyond roughly |
iphase |
Initial offset phase offset in the range |
loop |
If loop |
doneAction |
A |
By default, the maximum value of LFGauss
is 1
. The minimum value will depend on the width, and can by inspected with -minval.
The function can be mapped to a specified range with -range, which can be useful when using LFGauss
as an envelope that may need to span a range of, e.g., [0, 1]
.
See the examples below for understanding and manipulating the Min and max values, curve width.
Returns the function's lowest value for the given width parameter, which is exp(1.0 / (-2.0 * width^2))
.
Scales the output to the given range. This can be convenient when using LFGauss
as an envelope (see examples below).
-minval for a given width (assuming iphase = 0
) is:
minval = exp(-1.0 / (2.0 * squared(width)))
width for a given -minval is:
width = sqrt(-1.0 / log(minval))
width at half of the maximum value(0.5
) is:
(2 * sqrt(2 * log(2)) * width) = ca. 2.355 * width
0
– it asymptotically approaches it at -inf
and inf
. When using it as an envelope, it has to start at some smaller value, and it has an offset for this value. You can remove this offset by explicitly setting the -range, e.g. to [0, 1]
(this is the default).