LFGauss:
Filter:
Classes | UGens > Generators > Deterministic

LFGauss : UGen : AbstractFunction : Object

Gaussian function oscillator
Source: Osc.sc

Description

A non-band-limited gaussian function oscillator. Output ranges from minval to 1.

LFGauss implements the formula:

where x is to vary in the range -1 to 1 over the period dur. minval is the initial value at -1.

Class Methods

LFGauss.ar(duration: 1, width: 0.1, iphase: 0.0, loop: 1, doneAction: 0)

LFGauss.kr(duration: 1, width: 0.1, iphase: 0.0, loop: 1, doneAction: 0)

Arguments:

duration

duration of one full cycle ( for freq input: dur = 1 / freq )

width

relative width of the bell. Best to keep below 0.25 when used as envelope. (default: 0.1)

iphase

initial offset (default: 0)

loop

if loop is > 0, UGen oscillates. Otherwise it calls doneAction after one cycle (default: 1)

doneAction

doneAction, which is evaluated after cycle completes (2 frees the synth, default: 0). See Done for more detail.

Inherited class methods

Instance Methods

.minval

Returns the lowest value for the given parameters, which is exp(1.0 / (-2.0 * squared(width)))

.range(min: 0, max: 1)

Scales the output to the given range. This can be convenient when using LFGauss as an envelope (see example below).

Inherited instance methods

Examples

Some plots

Some calculations

assuming iphase = 0:

minval for a given width: minval = exp(-1.0 / (2.0 * squared(width)))

width for a given minval: width = sqrt(-1.0 / log(minval))

width at half maximum (0.5): (2 * sqrt(2 * log(2)) * width) = ca. 2.355 * width

Sound examples

Gabor Grain

NOTE: The gaussian function doesn't start with 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).