Classes | Math

# SimpleNumber : Number : Magnitude : Object

one-dimensional value
Source: SimpleNumber.sc
Subclasses: Float, Integer
See also: Polar, Complex, Float, Integer, UnaryOpUGen, BinaryOpUGen

## Description

Base class for numbers which can be represented by a single one dimensional value.

Most of the Unary and Binary operations are also implemented by UnaryOpUGen and BinaryOpUGen, so you can get more examples by looking at the help for those.

## Class Methods

### SimpleNumber.new

allocates a new SimpleNumber.

### Inherited class methods

## Instance Methods

### math support

### +(aNumber, adverb)

Addition

### -(aNumber, adverb)

Subtraction

### *(aNumber, adverb)

Multiplication

### /(aNumber, adverb)

Division

### %(that)

From superclass: Object

Modulo

### .mod(aNumber, adverb)

Modulo

### .div(aNumber, adverb)

Integer Division

### **(that)

From superclass: Object

Exponentiation

### !=(aNumber, adverb)

Is not

### >(aNumber, adverb)

greater than

### <(aNumber, adverb)

greater than

### >=(aNumber, adverb)

greater or equal than

### <=(aNumber, adverb)

smaller or equal than

### .lcm(aNumber, adverb)

Least common multiple

### .gcd(aNumber, adverb)

Greatest common divisor

### .round(aNumber: 1, adverb)

Round to multiple of aNumber

### .roundUp(aNumber: 1, adverb)

Round up to a multiple of aNumber. For roundDown use trunc.

### .trunc(aNumber: 1, adverb)

Truncate to multiple of aNumber (e.g. it rounds numbers down to a multiple of aNumber).

### .softRound(resolution: 1, margin: 0.05, strength: 1)

Rounds the value to a multiple of resolution. By using margin and strength you can control which values will be rounded, and by how much.

Conceptually this is the equivalent of MIDI quantization in a DAW/MIDI sequencer. In particular it allows a certain sloppiness close to the resolution value.

Note: this method expects values >= 0.

#### Arguments:

resolution | Round this value to a multiple of resolution. E.g. if you chose 1, then all values would be rounded to the nearest integer.
margin | Values that are within ±margin from a multiple of resolution will be left as they are. E.g. if you chose a resolution value of 0.5 and a margin of 0.01, then the values 0.501 and 0.499 would be left as they are, but the value 0.502 would become 0.5. This should be a value between 0 and resolution.
strength | Determines the degree to which this number will be changed. If strength is 1, then this function will return the nearest resolution. If it is 0, then value of this number will be left unchanged. E.g. If the resolution was 1 and strength was 0.5, then the value 0.6 would become 0.8.

#### Discussion:

    ((0..10) / 5).collect { |num| [num, num.softRound(1, 0, 1)] };
    ((0..10) / 5).collect { |num| [num, num.softRound(1, 0.3, 1)] };
    ((0..10) / 5).collect { |num| [num, num.softRound(1, 0, 0.5)] };

### .snap(resolution: 1, margin: 0.05, strength: 1)

Rounds the values margin distance from resolution to a multiple of resolution. By using margin and strength you can control when values will be rounded, and by how much.

Conceptually this is the equivalent of 'snap' in a graphics program. Values within a certain distance (margin) from a grid line are snapped to it. All other values are unchanged.

Note: this method expects values >= 0.

#### Arguments:

resolution | Snap this value to a multiple of resolution. E.g. if you chose 1, then all values would be rounded to the nearest integer.
margin | Only values that are greater ±margin from a multiple of resolution value will be changed. Values that are less than margin will be unchanged. E.g. if you chose a resolution value of 0.5 and a margin of 0.01, then the values 0.501 and 0.499 would be snapped to 0.5, but the value 0.502 would be unchanged. This should be a value between 0 and resolution.
strength | Determines the degree to which this number will be changed. If strength is 1, then this function will return the nearest resolution. If it is 0, then value of this number will be left unchanged. E.g. If the resolution was 1 and strength was 0.5, then the value 0.6 would become 0.8.

#### Discussion:

    ((0..10) / 5).collect { |num| [num, num.snap(1, 0, 1)] };
    ((0..10) / 5).collect { |num| [num, num.snap(1, 0.3, 1)] };
    ((0..10) / 5).collect { |num| [num, num.snap(1, 0, 0.5)] };

### .thresh(aNumber, adverb)

### .min(aNumber, adverb)

Minimum

### .max(aNumber: 0, adverb)

Maximum

### .wrap2(aNumber, adverb)

### .atan2(aNumber, adverb)

Arctangent of (this/aNumber)

### .hypot(aNumber, adverb)

Square root of the sum of the squares.

### .log

#### Returns:

Base e logarithm.

### .log2

#### Returns:

Base 2 logarithm.

### .log10

#### Returns:

Base 10 logarithm.

### .neg

#### Returns:

negation

### .abs

#### Returns:

absolute value.

### .sign

#### Returns:

Answer -1 if negative, +1 if positive or 0 if zero.

### .ceil

#### Returns:

next larger integer.

### .floor

#### Returns:

next smaller integer

### .sin

Sine

### .cos

Cosine

### .tan

Tangent

### .asin

Arcsine

### .acos

Arccosine

### .atan

Arctangent

### .sinh

Hyperbolic sine

### .cosh

Hyperbolic cosine

### .tanh

Hyperbolic tangent

### .frac

fractional part

### .squared

the square of the number

### .cubed

the cube of the number

### .sqrt

the square root of the number.

### .exp

e to the power of the receiver.

### .reciprocal

1 / this

### .pow(aNumber, adverb)

this to the power of aNumber

### .fold2(aNumber, adverb)

the folded value, a bitwise or with aNumber

### .previousPowerOf(base)

the number relative to this that is the previous power of aNumber

### .nextPowerOf(base)

the next power of aNumber

### .nextPowerOfTwo

#### Returns:

the number relative to this that is the next power of 2

### .nextPowerOfThree

the next power of three

### .hash

#### Returns:

a hash value

### <!(that)

From superclass: Object

#### Returns:

the receiver. aNumber is ignored.

### &(that)

From superclass: Object

Bitwise And

### |(that)

From superclass: Object

Bitwise Or

### .bitXor(aNumber, adverb)

Bitwise Exclusive Or

### .bitHammingDistance(aNumber, adverb)

Binary Hamming distance: the count of bits that are not the same in the two numbers

### .bitTest(bit)

#### Returns:

true if bit at index aNumber is set.

### .bitNot

#### Returns:

ones complement

### <<(that)

From superclass: Object

Binary shift left.

### >>(that)

From superclass: Object

Binary shift right.

### +>>(that)

From superclass: Object

Unsigned binary shift right.

### .rightShift(aNumber: 1, adverb)

#### Returns:

performs a binary right shift

### .unsignedRightShift(aNumber, adverb)

#### Returns:

performs an unsigned right shift

### .leftShift(aNumber: 1, adverb)

#### Returns:

performs a binary left shift

### .bitOr(aNumber, adverb)

#### Returns:

performs a bitwise or with aNumber

### .bitAnd(aNumber, adverb)

#### Returns:

performs a bitwise and with aNumber

### .ring1(aNumber, adverb)

(a * b) + a

### .ring2(aNumber, adverb)

((a*b) + a + b)

### .ring3(aNumber, adverb)

(a * a *b)

### .ring4(aNumber, adverb)

((a*a *b) - (a*b*b))

### .difsqr(aNumber, adverb)

(a*a) - (b*b)

### .sumsqr(aNumber, adverb)

(a*a) + (b*b)

### .sqrdif(aNumber, adverb)

(a - b) ** 2

### .sqrsum(aNumber, adverb)

(a + b) ** 2

### .absdif(aNumber, adverb)

(a - b).abs

### .moddif(aNumber: 0, mod: 1)

On a circle, there are two distances between two points. This operator returns the smaller value of the two.

    moddif(0.75, 0, 1)

### .amclip(aNumber, adverb)

0 when b <= 0, a*b when b > 0

### .scaleneg(aNumber, adverb)

a * b when a < 0, otherwise a.

### .clip2(aNumber, adverb)

clips receiver to +/- aNumber

### .excess(aNumber, adverb)

Returns the difference of the receiver and its clipped form.

#### Discussion:

    (a - clip2(a,b))

### .madd(mul, add)

    this * a + b

### testing

### .isPositive

Answer if the number is >= 0.

### .isNegative

Answer if the number is < 0.

### .isStrictlyPositive

Answer if the number is > 0.

### .booleanValue

#### Returns:

true, if strictly positive ( > 0), otherwise false (see Boolean)

### .isNaN

### ==(aNumber, adverb)

### conversion

### .asFraction(denominator: 100, fasterBetter: true)

#### Arguments:

denominator |
fasterBetter | if true, asFraction may find a much closer approximation and do it faster.

#### Returns:

an array of denominator and divisor of the nearest and smallest fraction

### .asAudioRateInput

Converts this into an audiorate input.

### .asTimeString(precision: 0.001, maxDays: 365, dropDaysIfPossible: true)

Produces a time string in the format `ddd:hh:mm:ss.sss`, interpreting the receiver as time in seconds. See String: -asSecs for the inverse function.

#### Arguments:

precision | accuracy of the millisecond format; the string will always be formatted with 3 decimal places for milliseconds. Minimum value: 0.001.
maxDays | maximum number of days
dropDaysIfPossible | a Boolean. If set to `true`, and the number of days in the formatted string would be 0, that section is instead ommitted and the string is formatted as `hh:mm:ss.sss`.

#### Discussion:

    (
    var start;
    start = Main.elapsedTime;
    {
        loop {
            (Main.elapsedTime - start).asTimeString.postln;
            0.05.wait
        }
    }.fork;
    )

### .asPoint

#### Returns:

this as Point. x = y = this.

### .asComplex

#### Returns:

this as Point. x = y = this.

### .asWarp(spec)

#### Arguments:

spec | a ControlSpec

#### Returns:

this as CurveWarp according to spec.

### .asFloat

#### Returns:

this as Float

### .asRect

#### Returns:

a Rect with x = y = w = h = this.

### .asBoolean

#### Returns:

this as a Boolean. this > 0

### .asQuant

#### Returns:

the values as Quant

### .asInteger

#### Returns:

this as Integer

### timing

### .wait

within a routine, yield the number so that the clock can wait for this many beats. Outside a Routine, this trows an error (see also Routine for details).

#### Discussion:

Create a routine by a function fork

    (
    fork {
        1.wait;
        "I did wait".postln;
        1.0.rand.wait;
        "No you didn't".postln;
        2.wait;
        (1..).do { |i|
            "yes I did".postln;
            i.asFloat.rand.wait;
            "no you didn't".postln;
            i.wait
        }
    }
    )

### .waitUntil

like wait, only specify a time (measured in beats of the current thread's clock). Outside a Routine, this trows an error (see also Routine for details).

### .sleep

make the current thread sleep, until woken up by re-scheduling. Outside a Routine, this trows an error (see also Routine for details).

### .nextTimeOnGrid(clock)

#### Arguments:

clock |

#### Returns:

the next possible multiple of the clock's beats.

### .schedBundleArrayOnClock(clock, bundleArray, lag: 0, server, latency)

### series and arrays

### .nearestInList(list)

#### Returns:

the value in the list closest to this

#### Discussion:

    (
    l = [0, 0.5, 0.9, 1];
    (0, 0.05..1).collect { |i| i.nearestInList(l) }
    )

### .nearestInScale(scale, stepsPerOctave: 12)

#### Arguments:

scale | an array of SimpleNumbers each treated as a step in the octave.
stepsPerOctave | 12 by default

#### Returns:

the value in the collection closest to this, assuming an octave repeating table of note values.

#### Discussion:

    (
    l = [0, 1, 5, 9, 11]; // pentatonic scale
    (60, 61..76).collect { |i| i.nearestInScale(l, 12) }
    )

### .series(second, last)

return an arithmetic series from this over second to last.

#### Discussion:

This is used in the shortcuts:

    (0..100);
    (1, 3 .. 17)

If second is nil, it is one magnitude step towards last (1 or -1). Examples:

    series(5, 7, 10);
    series(5, nil, 10);
    (5, 7 .. 10)

### .seriesIter(second, last)

#### Returns:

a Routine that iterates over the numbers from this to last.

#### Discussion:

Since this is a lazy operation, last may be inf, generating an endless series (see also List Comprehensions)

    r = seriesIter(0, 5);
    r.nextN(8);
    r.nextN(8);

### windowing

### .rectWindow

#### Returns:

a value for a rectangular window function between 0 and 1.

### .hanWindow

#### Returns:

a value for a hanning window function between 0 and 1.

### .welWindow

#### Returns:

a value for a welsh window function between 0 and 1.

### .triWindow

#### Returns:

a value for a triangle window function between 0 and 1.

### mapping

### .distort

a nonlinear distortion function.

### .softclip

Distortion with a perfectly linear region from -0.5 to +0.5

### .scurve

Map receiver in the onto an S-curve.

#### Discussion:

    ((0..100) / 100 ).collect(_.scurve).plot

### .ramp

Map receiver onto a ramp starting at 0.

#### Discussion:

    ((-100..100) / 100 ).collect(_.ramp).plot

### .magnitude

#### Returns:

absolute value (see Polar, Complex)

### .angle

#### Returns:

angle of receiver conceived as Polar or Complex number.

### .degreeToKey(scale, stepsPerOctave: 12)

#### Arguments:

scale | an array of SimpleNumbers each treated as a step in the octave.
stepsPerOctave | 12 is the standard chromatic scale.

#### Discussion:

the value is truncated to an integer and used as an index into an octave repeating table of note values. Indices wrap around the table and shift octaves as they do.

    (
    l = [0, 1, 5, 9, 11]; // pentatonic scale
    (1, 2..15).collect{|i|
        i.degreeToKey(l, 12)
    };
    )

### .keyToDegree(scale, stepsPerOctave: 12)

inverse of degreeToKey.

#### Arguments:

scale | an array of SimpleNumbers each treated as a step in the octave.
stepsPerOctave | 12 is the standard chromatic scale.

#### Discussion:

    (
    l = [0, 1, 5, 9, 11]; // pentatonic scale
    (60, 61..75).collect { |i| i.keyToDegree(l, 12) }
    )

    (
    l = [0, 1, 5, 9, 11]; // pentatonic scale
    (60, 61..75).postln.collect { |i| i.keyToDegree(l, 12).degreeToKey(l) }
    )

### .gaussCurve(a: 1, b: 0, c: 1)

map the receiver onto a gauss function.

#### Discussion:

Uses the formula:

    a * (exp(squared(this - b) / (-2.0 * squared(c)))) Default values: a = 1; b = 0; c = 1

Example code

    (0..1000).normalize(-10, 10).collect { |num| num.gaussCurve }.plot;

### .equalWithPrecision(that, precision: 0.0001, relativePrecision: 0)

#### Arguments:

that | the number to compare with within precision
precision | The absolute precision, independent of the value compared
relativePrecision | The precision relative to the larger absolute of the values compared.

#### Returns:

true if receiver is closer to that than precision.

#### Discussion:

    3.1.equalWithPrecision(3.0, 0.05); // false
    3.1.equalWithPrecision(3.0, 0.1); // false
    3.1.equalWithPrecision(3.0, 0.11); // true
    3000.1.equalWithPrecision(3000.0, 0, 0.01); // true
    3.1.equalWithPrecision(3.0, 0, 0.01); // false

### .quantize(quantum: 1, tolerance: 0.05, strength: 1)

From extension in /Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/deprecated/3.9/deprecated-3.9.sc

Deprecated. Round the receiver to the quantum. If you're looking for MIDI quantization type features use `SimpleNumber#-softRound`

#### Arguments:

quantum | amount.
tolerance | allowed tolerance.
strength | Determines how much the value is allowed to differ in the tolerance range.

#### Discussion:

    ((0..10) / 10).collect { |num| num.quantize(1, 0.3, 0.5) }.postcs.plot;
    ((0..10) / 10).collect { |num| num.quantize(1, 0.6, 0.5) }.postcs.plot;
    ((0..10) / 10).collect { |num| num.quantize(1, 1.0, 0.5) }.postcs.plot;

### .linlin(inMin, inMax, outMin, outMax, clip: 'minmax')

map the receiver from an assumed linear input range to a linear output range. If the input exceeds the assumed input range, the behaviour is specified by the clip argument.

#### Arguments:

inMin | assumed input minimum
inMax | assumed input maximum
outMin | output minimum
outMax | output maximum
clip | nil (don't clip) \max (clip ceiling) \min (clip floor) \minmax (clip both - this is default).

#### Discussion:

    (0..10).collect { |num| num.linlin(0, 10, -4.3, 100) };
    (0..10).linlin(0, 10, -4.3, 100); // equivalent.

### .linexp(inMin, inMax, outMin, outMax, clip: 'minmax')

map the receiver from an assumed linear input range (inMin..inMax) to an exponential output range (outMin..outMax). The output range must not include zero. If the input exceeds the input range, the following behaviours are specified by the clip argument.

#### Arguments:

inMin | assumed input minimum
inMax | assumed input maximum
outMin | output minimum
outMax | output maximum
clip | nil (don't clip) \max (clip ceiling) \min (clip floor) \minmax (clip both - this is default).

#### Discussion:

    (0..10).collect { |num| num.linexp(0, 10, 4.3, 100) };
    (0..10).linexp(0, 10, 4.3, 100); // equivalent.

### .explin(inMin, inMax, outMin, outMax, clip: 'minmax')

map the receiver from an assumed exponential input range (inMin..inMax) to a linear output range (outMin..outMax). If the input exceeds the assumed input range. The input range must not include zero. If the input exceeds the input range, the following behaviours are specified by the clip argument.

#### Arguments:

inMin | assumed input minimum
inMax | assumed input maximum
outMin | output minimum
outMax | output maximum
clip | nil (don't clip) \max (clip ceiling) \min (clip floor) \minmax (clip both - this is default).

#### Discussion:

    (1..10).collect { |num| num.explin(0.1, 10, -4.3, 100) };
    (1..10).explin(0.1, 10, -4.3, 100); // equivalent.

### .expexp(inMin, inMax, outMin, outMax, clip: 'minmax')

map the receiver from an assumed exponential input range (inMin..inMax) to an exponential output range (outMin..outMax). If the input exceeds the assumed input range. Both input range and output range must not include zero. If the input exceeds the input range, the following behaviours are specified by the clip argument.

#### Arguments:

inMin | assumed input minimum
inMax | assumed input maximum
outMin | output minimum
outMax | output maximum
clip | nil (don't clip) \max (clip ceiling) \min (clip floor) \minmax (clip both - this is default).

#### Discussion:

    (1..10).collect { |num| num.expexp(0.1, 10, 4.3, 100) };
    (1..10).expexp(0.1, 10, 4.3, 100); // equivalent.

### .lincurve(inMin: 0, inMax: 1, outMin: 0, outMax: 1, curve: -4, clip: 'minmax')

map the receiver from an assumed linear input range (inMin..inMax) to an exponential curve output range (outMin..outMax). A curve is like the curve parameter in Env. Unlike with linexp, the output range may include zero. If the input exceeds the input range, the following behaviours are specified by the clip argument.

#### Arguments:

inMin | assumed input minimum
inMax | assumed input maximum
outMin | output minimum
outMax | output maximum
curve | 0 (linear) <0 (concave, negatively curved) >0 (convex, positively curved)
clip | nil (don't clip) \max (clip ceiling) \min (clip floor) \minmax (clip both - this is default).

#### Discussion:

    (0..10).collect { |num| num.lincurve(0, 10, -4.3, 100, -3) };
    (0..10).lincurve(0, 10, -4.3, 100, -3); // equivalent.

    // different curves:
    (-4..4).do { |val|
        (0..100).collect(_.lincurve(0, 100, 0, 1, val)).plot
    }

### .curvelin(inMin: 0, inMax: 1, outMin: 0, outMax: 1, curve: -4, clip: 'minmax')

map the receiver from an assumed curve-exponential input range (inMin..inMax) to a linear output range (outMin..outMax). If the input exceeds the assumed input range. A curve is like the curve parameter in Env. Unlike with explin, the input range may include zero. If the input exceeds the input range, the following behaviours are specified by the clip argument.

#### Arguments:

inMin | assumed input minimum
inMax | assumed input maximum
outMin | output minimum
outMax | output maximum
curve | 0 (linear) <0 (concave, negatively curved) >0 (convex, positively curved)
clip | nil (don't clip) \max (clip ceiling) \min (clip floor) \minmax (clip both - this is default).

#### Discussion:

    (1..10).collect { |num| num.curvelin(0, 10, -4.3, 100, -3) };
    (1..10).curvelin(0, 10, -4.3, 100, -3); // equivalent.

    // different curves:
    (-4..4).do { |val|
        (0..100).collect(_.curvelin(0, 100, 0, 1, val)).plot
    }

### .bilin(inCenter, inMin, inMax, outCenter, outMin, outMax, clip: 'minmax')

map the receiver from two assumed linear input ranges (inMin..inCenter) and (inCenter..inMax) to two linear output ranges (outMin..outCenter) and (outCenter..outMax). If the input exceeds the input range, the following behaviours are specified by the clip argument.

#### Arguments:

inCenter |
inMin | assumed input minimum
inMax | assumed input maximum
outCenter |
outMin | output minimum
outMax | output maximum
clip | nil (don't clip) \max (clip ceiling) \min (clip floor) \minmax (clip both - this is default).

#### Discussion:

    var center = 0.5, ctlCenter;
    w = Window("bilin", Rect(100, 100, 200, 100)).front;
    a = Slider(w, Rect(20, 20, 150, 20)).value_(0.5);
    b = Slider(w, Rect(20, 45, 150, 20)).value_(0.5);
    b.action = { center = b.value };
    a.mouseDownAction = { ctlCenter = a.value };
    a.action = {
        b.value = a.value.bilin(ctlCenter, 0, 1, center, 0, 1);
    };

### .biexp(inCenter, inMin, inMax, outCenter, outMin, outMax, clip: 'minmax')

map the receiver from two assumed exponential input ranges (inMin..inCenter) and (inCenter..inMax) to two linear output ranges (outMin..outCenter) and (outCenter..outMax). The input range must not include zero. If the input exceeds the input range, the following behaviours are specified by the clip argument.

#### Arguments:

inCenter |
inMin | assumed input minimum
inMax | assumed input maximum
outCenter |
outMin | output minimum
outMax | output maximum
clip | nil (don't clip) \max (clip ceiling) \min (clip floor) \minmax (clip both - this is default).

#### Discussion:

    // doesn't properly work yet.
    (
    var center = 0.5, ctlCenter;
    w = Window("biexp", Rect(100, 100, 200, 100)).front;
    a = Slider(w, Rect(20, 20, 150, 20)).value_(0.5);
    b = Slider(w, Rect(20, 45, 150, 20)).value_(0.5);
    b.action = { center = b.value };
    a.mouseDownAction = { ctlCenter = a.value + 0.05 };
    a.action = {
        b.value = (a.value + 0.1).biexp(ctlCenter, 0.1, 1.1, center, 0, 1);
    };
    )

### .lcurve(a: 1, m: 0, n: 1, tau: 1)

map the receiver onto an L-curve.

#### Discussion:

Uses the formula

    a * (m * exp(x) * rTau + 1) / (n * exp(x) * rTau + 1)

This is used for smoothing values and limiting them to a range.

    (0..1000).normalize(-10, 10).collect { |num| num.lcurve }.plot;

### .degrad

#### Returns:

converts degree to radian

### .raddeg

#### Returns:

converts radian to degree

### .midicps

Convert MIDI note to cycles per second

#### Returns:

cycles per second

### .cpsmidi

Convert cycles per second to MIDI note.

#### Returns:

midi note

### .midiratio

Convert an interval in semitones to a ratio.

#### Returns:

a ratio

### .ratiomidi

Convert a ratio to an interval in semitones.

#### Returns:

an interval in semitones

### .ampdb

Convert a linear amplitude to decibels.

### .dbamp

Convert a decibels to a linear amplitude.

### .octcps

Convert decimal octaves to cycles per second.

### .cpsoct

Convert cycles per second to decimal octaves.

### streams

### .storeOn(stream)

stores this on the given stream

### .printOn(stream)

prints this on the given stream

### random

### .coin

Let x be the receiver clipped to the range [0, 1]. With probability x, return true. With probability 1 - x, return false.

### .rand

#### Returns:

Random number from zero up to the receiver, exclusive.

### .rand2

#### Returns:

a random number from -this to +this.

### .rrand(aNumber, adverb)

#### Arguments:

aNumber | the upper limit
adverb |

#### Returns:

a random number in the interval ]a, b[.

#### Discussion:

If both a and b are Integer then the result will be an Integer.

### .linrand

#### Returns:

a linearly distributed random number from zero to this.

### .bilinrand

#### Returns:

Bilateral linearly distributed random number from -this to +this.

### .sum3rand

This was suggested by Larry Polansky as a poor man's gaussian.

#### Returns:

A random number from -this to +this that is the result of summing three uniform random generators to yield a bell-like distribution.

### .exprand(aNumber, adverb)

an exponentially distributed random number in the interval ]a, b[. This is always a Float. (Note that the distribution of numbers is not exactly an exponential distribution, since that would be unbounded: we might call it a logarithmic uniform distribution.)

#### Arguments:

aNumber | the upper limit
adverb |

### .gauss(standardDeviation)

a gaussian distributed random number.

#### Arguments:

standardDeviation | the upper limit

#### Discussion:

Always returns a Float.

    (0..1000).collect { |num| gauss(0.0, num) }.plot;

### .partition(parts: 2, min: 1)

randomly partition a number into parts of at least min size.

#### Arguments:

parts | number of parts
min | the minimum size

#### Discussion:

    75.partition(8, 3);
    75.partition(75, 1);

### UGen Compatibility Methods

Some methods to ease the development of generic ugen code.

### .lag

### .lag2

### .lag3

### .lagud

### .lag2ud

### .lag3ud

### .slew

### .varlag

#### Returns:

`this`

### misc

### .isValidUGenInput

#### Returns:

false if receiver cannot be used in UGen.

### Inherited instance methods

### Undocumented instance methods

### .asBufWithValues

### .asEvent

From extension in /Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Streams/Rest.sc

### .asMIDIInPortUID

From extension in /Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Control/asMIDIPort.sc

### .asSize

From extension in /Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Geometry/Size.sc

### .binaryValue

### .buildForProxy(proxy, channelOffset: 0)

From extension in /Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/JITLib/ProxySpace/wrapForNodeProxy.sc

### .delta

From extension in /Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Streams/Rest.sc

### .firstArg(aNumber, adverb)

### .guiClass

From extension in /Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/GUI/tools/guicrucial/gui.sc

### .hypotApx(aNumber, adverb)

### .numChannels

### .performBinaryOpOnComplex(aSelector, aComplex, adverb)

### .performBinaryOpOnSignal(aSelector, aSignal, adverb)

### .performBinaryOpOnSimpleNumber(aSelector, aNumber, adverb)

### .playAndDelta

### .poll(trig: 10, label, trigid: -1)

### .proxyControlClass

From extension in /Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/JITLib/ProxySpace/wrapForNodeProxy.sc

### .rate

### .writeInputSpec(file, synth)

### .writeInputSpecOld(file, synth)

From extension in /Applications/SuperCollider.app/Contents/Resources/SCClassLibrary/Common/Audio/SynthDefOld.sc
helpfile source: /Applications/SuperCollider.app/Contents/Resources/HelpSource/Classes/SimpleNumber.schelp
link::Classes/SimpleNumber::