SuperCollider CLASSES

NRand

Sum of uniform distributions.
Inherits from: UGen : AbstractFunction : Object

Description

Generates a single random float value in a sum of n uniform distributions from lo to hi .

Class Methods

*new (lo: 0, hi: 1, n: 0)

Arguments:

lo

Lower limit of the output range.

hi

Upper limit of the output range.

n
n = 1:Uniform distribution - same as Rand.
n = 2:Triangular distribution.
n = 3:Smooth hump.

As n increases, distribution converges towards gaussian.

Inherited class methods

Instance Methods

Inherited instance methods

Examples

(
SynthDef("help-NRand", { arg out=0, n=0;
    Out.ar(out,
        FSinOsc.ar(
            NRand(1200.0, 4000.0, n),
            0, Line.kr(0.2, 0, 0.01, doneAction:2))
    )
}).add;
)

(
n = 0;
Routine({
    inf.do({ arg i;
        Synth.new("help-NRand", [\n, n]); 0.05.wait;
    })
}).play;
)

n = 1;
n = 2;
n = 4;