SequenceableCollection:
Filter:
Classes | Collections > Ordered

SequenceableCollection : Collection : Object

Abstract superclass of integer indexable collections

Description

SequenceableCollection is a subclass of Collection whose elements can be indexed by an Integer. It has many useful subclasses; Array and List are amongst the most commonly used.

Class Methods

SequenceableCollection.fill(size, function)

From superclass: Collection

Creates a Collection of the given size, the elements of which are determined by evaluation the given function. The function is passed the index as an argument.

Arguments:

size

The size of the collection which is returned. If nil, it returns an empty collection. If an array of sizes is given, the resulting collection has the appropriate dimensions (see: *fillND).

function

The function which is called for each new element - the index is passed in as a first argument. The function be anything that responds to the message "value".

SequenceableCollection.series(size, start: 0, step: 1)

Fill a SequenceableCollection with an arithmetic series.

SequenceableCollection.geom(size, start, grow)

Fill a SequenceableCollection with a geometric series.

SequenceableCollection.fib(size, a: 0.0, b: 1.0)

Fill a SequenceableCollection with a fibonacci series.

Arguments:

size

the number of values in the collection

a

the starting step value

b

the starting value

SequenceableCollection.rand(size, minVal, maxVal)

Fill a SequenceableCollection with random values in the range minVal to maxVal.

SequenceableCollection.rand2(size, val)

Fill a SequenceableCollection with random values in the range -val to +val.

SequenceableCollection.linrand(size, minVal, maxVal)

Fill a SequenceableCollection with random values in the range minVal to maxVal with a linear distribution.

SequenceableCollection.exprand(size, minVal, maxVal)

Fill a SequenceableCollection with random values in the range minVal to maxVal with exponential distribution.

SequenceableCollection.interpolation(size, start: 0.0, end: 1.0)

Fill a SequenceableCollection with the interpolated values between the start and end values.

Inherited class methods

Undocumented class methods

SequenceableCollection.streamContents(function)

SequenceableCollection.streamContentsLimit(function, limit: 2000)

Instance Methods

|@|(index)

synonym for ArrayedCollection: -clipAt.

@@(index)

synonym for ArrayedCollection: -wrapAt.

@|@(index)

synonym for ArrayedCollection: -foldAt.

.first

Return the first element of the collection.

.last

Return the last element of the collection.

.putFirst(obj)

.putLast(obj)

Place item at the first / last index in the collection. Note that if the collection is empty (and therefore has no indexed slots) the item will not be added.

.indexOf(item)

Return the index of an item in the collection, or nil if not found. Elements are checked for identity (not for equality).

.indexOfEqual(item, offset: 0)

Return the index of something in the collection that equals the item, or nil if not found.

.indicesOfEqual(item)

Return an array of indices of things in the collection that equal the item, or nil if not found.

.indexOfGreaterThan(val)

Return the first index containing an item which is greater than item.

.selectIndices(function)

Return a new collection of same type as receiver which consists of all indices of those elements of the receiver for which function answers true. The function is passed two arguments, the item and an integer index.

If you want to control what type of collection is returned, use -selectIndicesAs

.selectIndicesAs(function, class)

Return a new collection of type class which consists of all indices of those elements of the receiver for which function answers true. The function is passed two arguments, the item and an integer index.

.rejectIndices(function)

Return a new collection of same type as receiver which consists of all indices of those elements of the receiver for which function answers false. The function is passed two arguments, the item and an integer index.

If you want to control what type of collection is returned, use -rejectIndicesAs

.rejectIndicesAs(function, class)

Return a new collection of type class which consists of all indices of those elements of the receiver for which function answers false. The function is passed two arguments, the item and an integer index.

.maxIndex(function)

From superclass: Collection

Answer the index of the maximum of the results of function evaluated for each item in the receiver. The function is passed two arguments, the item and an integer index. If function is nil, then answer the maximum of all items in the receiver.

.minIndex(function)

From superclass: Collection

Answer the index of the minimum of the results of function evaluated for each item in the receiver. The function is passed two arguments, the item and an integer index. If function is nil, then answer the minimum of all items in the receiver.

.find(sublist, offset: 0)

If the sublist exists in the receiver (in the specified order), at an offset greater than or equal to the initial offset, then return the starting index. The sublist must be of the same kind (class) as the list to search in. Elements are checked for equality (not for identity).

.findAll(arr, offset: 0)

Similar to -find but returns an array of all the indices at which the sequence is found.

.indexIn(val)

Returns the closest index of the value in the collection (collection must be sorted).

.indexInBetween(val)

Returns a linearly interpolated float index for the value (collection must be sorted). Inverse operation is -blendAt.

.blendAt(index, method: 'clipAt')

From superclass: Object

Returns a linearly interpolated value between the two closest indices. Inverse operation is -indexInBetween.

.copyRange(start, end)

Return a new SequenceableCollection which is a copy of the indexed slots of the receiver from start to end. If end < start, an empty collection is returned.

WARNING: x.copyRange(a, b) is not equivalent to x[a..b]. The latter compiles to ArrayedCollection: -copySeries, which has different behavior when end < start.

.copyToEnd(start)

Return a new SequenceableCollection which is a copy of the indexed slots of the receiver from start to the end of the collection. x.copyToEnd(a) can also be written as x[a..]

.copyFromStart(end)

Return a new SequenceableCollection which is a copy of the indexed slots of the receiver from the start of the collection to end. x.copyFromStart(a) can also be written as x[..a]

.remove(item)

Remove item from collection. Elements are checked for identity (not for equality).

.take(item)

Remove and return item from collection. The last item in the collection will move to occupy the vacated slot (and the collection size decreases by one). See also takeAt, defined for ArrayedCollection: -takeAt. Elements are checked for identity (not for equality).

WARNING: take(item) works on Arrays but not on Lists, because the internally called method takeAt(item) is not defined for Lists.

.obtain(index, default)

Retrieve an element from a given index (like SequenceableCollection: -at). This method is also implemented in Object, so that you can use it in situations where you don't want to know if the receiver is a collection or not. See also: SequenceableCollection: -instill

Arguments:

index

The index at which to look for an element

default

If index exceeds collection size, or receiver is nil, return this instead

.instill(index, item, default)

Put an element at a given index (like SequenceableCollection: -put). This method is also implemented in Object, so that you can use it in situations where you don't want to know if the receiver is a collection or not. It will always return a new collection. See also: SequenceableCollection: -obtain

Arguments:

index

The index at which to put the item

item

The object to put into the new collection

default

If the index exceeds the current collection's size, extend the collection with this element

.keep(n)

Keep the first n items of the array. If n is negative, keep the last -n items.

.drop(n)

Drop the first n items of the array. If n is negative, drop the last -n items.

.join(joiner)

Returns a String formed by connecting all the elements of the receiver, with joiner inbetween. See also String: -split as the complementary operation.

.flat

Returns a collection from which all nesting has been flattened.

.flatten(numLevels: 1)

Returns a collection from which numLevels of nesting has been flattened.

Arguments:

numLevels

Specifies how many levels downward (inward) to flatten. Zero returns the original.

.flatten2(numLevels: 1)

A symmetric version of -flatten. For a negative numLevels, it flattens starting from the innermost arrays.

Arguments:

numLevels

Specifies how many levels downward (inward) or upward (outward) to flatten.

.flatBelow(level: 1)

Flatten all subarrays deeper than level.

Arguments:

level

Specifies from what level onward to flatten. level 0 is outermost, so flatBelow(0) is like flat.

.flop

Invert rows and columns in a two dimensional Collection (turn inside out). See also: Function.

Note that the innermost arrays are not copied:

.flopWith(func)

Flop with a user defined function. Can be used to collect over several collections in parallel.

Arguments:

func

A function taking as many arguments as elements in the array.

.flopTogether( ... moreArrays)

Invert rows and columns in a an array of dimensional Collections (turn inside out), so that they all match up in size, but remain separated.

.flopDeep(rank)

Fold dimensions in a multi-dimensional Collection (turn inside out).

Arguments:

rank

The depth (dimension) from which the array is inverted inside-out.

NOTE: Note that, just like in flop, the innermost arrays (deeper than rank) are not copied.

.maxSizeAtDepth(rank)

From superclass: Collection

Returns the maximum size of all subarrays at a certain depth (dimension)

Arguments:

rank

The depth at which the size of the arrays is measured

.maxDepth(max: 1)

From superclass: Collection

Returns the maximum depth of all subarrays.

Arguments:

max

Internally used only.

.isSeries(step)

Returns true if the collection is an arithmetic series.

Arguments:

step

Step size to look for. If none is given, any step size will match.

.resamp0(newSize)

Returns a new Collection of the desired length, with values resampled evenly-spaced from the receiver without interpolation.

.resamp1(newSize)

Returns a new Collection of the desired length, with values resampled evenly-spaced from the receiver with linear interpolation.

.choose

Choose an element from the collection at random.

.wchoose(weights)

Choose an element from the collection at random using a list of probabilities or weights. The weights must sum to 1.0.

.sort(function)

Sort the contents of the collection using the comparison function argument. The function should take two elements as arguments and return true if the first argument should be sorted before the second argument. If the function is nil, the following default function is used. { arg a, b; a < b }

.sortBy(key)

Sort the contents of the collection using the key key, which is assumed to be found inside each element of the receiver.

.order(function)

Return an array of indices that would sort the collection into order. function is treated the same way as for the -sort method.

.swap(i, j)

Swap two elements in the collection at indices i and j.

.pairsDo(function)

Calls function for each subsequent pair of elements in the SequentialCollection. The function is passed the two elements and an index.

.doAdjacentPairs(function)

Calls function for every adjacent pair of elements in the SequenceableCollection. The function is passed the two adjacent elements and an index.

.separate(function: true)

Separates the collection into sub-collections by calling the function for each adjacent pair of elements. If the function returns true, then a separation is made between the elements.

.clump(groupSize)

Separates the collection into sub-collections by separating every groupSize elements.

.clumps(groupSizeList)

Separates the collection into sub-collections by separating elements into groupings whose size is given by integers in the groupSizeList.

.curdle(probability)

Separates the collection into sub-collections by randomly separating elements according to the given probability.

.integrate

Returns a collection with the incremental sums of all elements.

.differentiate

Returns a collection with the pairwise difference between all elements.

.reduce(operator, adverb)

Applies the method named by operator to the first and second elements of the collection, and then applies the method to the result and to the third element of the collection, then applies the method to the result and to the fourth element of the collection, and so on, until the end of the array.

If the collection contains only one element, it is returned as the result. If the collection is empty, returns nil.

Arguments:

operator

May be a Function (taking two or three arguments) or a Symbol (method selector).

adverb

An optional adverb to be used together with the operator (see Adverbs for Binary Operators). If the operator is a functions, the adverb is passed as a third argument.

.convertDigits(base: 10)

Returns an integer resulting from interpreting the elements as digits to a given base (default 10). See also asDigits in Integer: -asDigits for the complementary method.

.hammingDistance(that)

Returns the count of array elements that are not equal in identical positions. http://en.wikipedia.org/wiki/Hamming_distance

The collections are not wrapped - if one array is shorter than the other, the difference in size should be included in the count.

Fuzzy comparisons

With fuzzy comparisons, the arrays do not need to match exactly. We can check how similar they are, and make decisions based on that. This is the magic behind autocorrection.

.editDistance(other, compareFunc)

Returns the minimum number of changes to modify this SequenceableCollection into the other SequenceableCollection. A change can be: an addition, a deletion, or a substitution. This is known as the Levenshtein Distance and is implemented in SuperCollider using the Wagner–Fischer algorithm.

The default comparison uses identity - see Object: -== and Object: -===

Where both arrays are raw arrays (String, Int16Array, Int32Array, FloatArray etc., or any derived classes), like comparing two strings, a faster primitive will be used to calculate the distance.

In cases where the arrays are of different types, it will fall back to a slower, non-primitive implementation.

For cases that require comparisons other than identity, the optional compareFunc can be given to compare elements. This function will be passed two arguments, representing a single element from each array to compare, and this function must return a boolean as to whether or not the elements are equal.

NOTE: Specifying a compareFunc will bypass the primitive and may take significantly longer to execute for larger arrays.

Arguments:

other

The SequenceableCollection to compare against

compareFunc

An optional comparison function to use for each element. It will be provided two arguments, and the function must return a boolean as to whether or not they are the same. Default value is nil, which will use identity (not equality) to compare elements.

.similarity(other, compareFunc)

Returns a value between 0 and 1 representing the percentage similarity between this SequenceableCollection and the other SequenceableCollection.

A value of 1 means they are exactly the same, a value of 0 means they are completely different. This is calculated based on the -editDistance

Arguments:

other

The SequenceableCollection to compare against

compareFunc

An optional compareFunc to be used to calculate the edit distance (see -editDistance)

Math Support - Unary Messages

All of the following messages send the message -performUnaryOp to the receiver with the unary message selector as an argument.

.neg

.reciprocal

.bitNot

.abs

.asFloat

.ceil

.floor

.frac

.sign

.squared

.cubed

.sqrt

.exp

.midicps

.cpsmidi

.midiratio

.ratiomidi

.ampdb

.dbamp

.octcps

.cpsoct

.log

.log2

.log10

.sin

.cos

.tan

.asin

.acos

.atan

.sinh

.cosh

.tanh

.rand

.rand2

.linrand

.bilinrand

.sum3rand

.distort

.softclip

.coin

.even

.odd

.isPositive

.isNegative

.isStrictlyPositive

.real

.imag

.magnitude

.magnitudeApx

.phase

.angle

.rho

.theta

.asFloat

.asInteger

.performUnaryOp(aSelector)

Creates a new collection of the results of applying the selector to all elements in the receiver.

Math Support - Binary Messages

All of the following messages send the message -performBinaryOp to the receiver with the binary message selector and the second operand as arguments.

+(aNumber, adverb)

-(aNumber, adverb)

*(aNumber, adverb)

/(aNumber, adverb)

.div(aNumber, adverb)

.min(aNumber, adverb)

.max(aNumber: 0, adverb)

<(aNumber, adverb)

<=(aNumber, adverb)

>(aNumber, adverb)

>=(aNumber, adverb)

.bitXor(aNumber, adverb)

.lcm(aNumber, adverb)

.gcd(aNumber, adverb)

.round(aNumber: 1, adverb)

.trunc(aNumber: 1, adverb)

.atan2(aNumber, adverb)

.hypot(aNumber, adverb)

.ring1(aNumber, adverb)

.ring2(aNumber, adverb)

.ring3(aNumber, adverb)

.ring4(aNumber, adverb)

.difsqr(aNumber, adverb)

.sumsqr(aNumber, adverb)

.sqrdif(aNumber, adverb)

.absdif(aNumber, adverb)

.amclip(aNumber, adverb)

.scaleneg(aNumber, adverb)

.clip2(aNumber: 1, adverb)

.excess(aNumber: 1, adverb)

.rrand(aNumber, adverb)

.exprand(aNumber, adverb)

%(that)

From superclass: Object

**(that)

From superclass: Object

&(that)

From superclass: Object

|(that)

From superclass: Object

>>(that)

From superclass: Object

+>>(that)

From superclass: Object

<!(that)

From superclass: Object

.performBinaryOp(aSelector, theOperand, adverb)

Creates a new collection of the results of applying the selector with the operand to all elements in the receiver. If the operand is a collection then elements of that collection are paired with elements of the receiver.

Math Support - Special Functions

A variety of Special Functions are supplied by the Boost C++ library. The library's online documentation serves as the primary reference for the following functions. The methods here match closely with those found in the source library, as do argument names.

Below you'll find descriptions of the functions and their bounds, but for visualizing the functions, have a look in Tour of Special Functions.

NOTE: The following methods are documented slightly clearer in SimpleNumber: Special Functions using functional notation. As of this writing, a bug in the help file formatting misleadingly documents the methods in receiver notation (methods preceded by .), but should be read to suggests the usage: foo([a], [b]). The equivalent receiver notation is: [a].foo([b]). Note that those methods with only one argument erroneously omit that argument from the argument list; each element in the collection is implicitly passed as the method's argument, e.g. foo([a]) or [a].foo
WARNING: Many of the functions are only valid in certain numerical ranges. For the most part, error handling happens in the underlying boost functions. While these errors are often obtuse, you'll usually find a useful message at the end of the error regarding proper ranges and the erroneous value supplied. Refer to the online documentation for more detailed descriptions, and the Tour of Special Functions for plots showing ranges and asymptotes.

.bernouliB2n

Returns the (2*n)th Bernoulli number.

Because all odd numbered Bernoulli numbers are zero (apart from B(1) which is -1/2) the interface will only return the even numbered Bernoulli numbers.

.tangentT2n

Returns a single tangent number at i. Also called a zag function.

.tgamma

Returns the "true gamma" of value z.

.tgamma1pm1

Returns gamma(dz + 1) - 1.

.lgamma

Returns the natural logarithm of the gamma function.

.digamma

Returns the digamma or psi function of z.

Digamma is defined as the logarithmic derivative of the gamma function.

.trigamma

Returns the trigamma function of z.

Trigamma is defined as the derivative of the digamma function.

.polygamma(n, z)

Returns the polygamma function of z.

Polygamma is defined as the n'th derivative of the digamma function.

.tgammaRatio(a, b)

Returns the ratio of gamma functions tgamma(a) / tgamma(b).

.tgammaDeltaRatio(a, delta)

Returns the ratio of gamma functions tgamma(a) / tgamma(a+delta).

.gammaP(a, z)

Returns the normalised lower incomplete gamma function.

Requires a > 0 and z >= 0.

.gammaQ(a, z)

Returns the normalised upper incomplete gamma function.

Requires a > 0 and z >= 0.

.tgammaLower(a, z)

Returns the full (non-normalised) lower incomplete gamma function.

Requires a > 0 and z >= 0.

.tgammaUpper(a, z)

Returns the full (non-normalised) upper incomplete gamma function.

Requires a > 0 and z >= 0.

.gammaPInv(a, p)

Returns a value such that p = gamma_p(a, x).

Requires a > 0 and 1 >= p,q >= 0.

.gammaQInv(a, q)

Returns a value x such that q = gamma_q(a, x).

Requires a > 0 and 1 >= p,q >= 0.

.gammaPInvA(x, p)

Returns a value such that p = gamma_p(a, x).

Requires x > 0 and 1 >= p,q >= 0.

.gammaQInvA(x, q)

Returns a value x such that q = gamma_q(a, x).

Requires x > 0 and 1 >= p,q >= 0.

.gammaPDerivative(a, x)

Implements the partial derivative with respect to x of the incomplete gamma function (lower).

.gammaQDerivative(a, x)

Implements the partial derivative with respect to x of the incomplete gamma function (upper).

.factorial

Returns i!.

WARNING: factorial will overflow if i > 170

.doubleFactorial

Returns i!!.

For even i, i !! = i(i-2)(i-4)(i-6) ... (4)(2).

For odd i, i !! = i(i-2)(i-4)(i-6) ... (3)(1).

.risingFactorial(x, i)

Returns the rising factorial of x and i:

x(x+1)(x+2)(x+3)...(x+i-1)

Both x and i can be negative as well as positive.

.fallingFactorial(x, i)

Returns the falling factorial of x and i:

x(x-1)(x-2)(x-3)...(x-i+1)

This function is only defined for positive i. Argument x can be either positive or negative.

.binomialCoefficient(n, k)

Requires k <= n.

.beta(a, b)

The beta function is defined by: tgamma(a)*tgamma(b) / tgamma(a+b).

.ibeta( ... args)

Returns the normalised incomplete beta function of a, b and x.

Require 0 <= x <= 1, a,b >= 0, and in addition that not both a and b are zero.

.ibetaC( ... args)

Returns the normalised complement of the incomplete beta function of a, b and x.

Require 0 <= x <= 1, a,b >= 0, and in addition that not both a and b are zero.

.betaFull( ... args)

Returns the full (non-normalised) incomplete beta function of a, b and x.

Require 0 <= x <= 1, and a,b > 0.

.betaFullC( ... args)

Returns the full (non-normalised) complement of the incomplete beta function of a, b and x.

Require 0 <= x <= 1, and a,b > 0.

.ibetaInv( ... args)

Returns a value x such that: p = ibeta(a, b, x).

Requires a,b > 0 and 0 <= p <= 1.

.ibetaCInv( ... args)

Returns a value x such that: q = ibetaC(a, b, x).

Requires a,b > 0 and 0 <= q <= 1.

.ibetaInvA( ... args)

Returns a value a such that: p = ibeta(a, b, x).

Requires b > 0, 0 < x < 1, and 0 <= p <= 1.

.ibetaCInvA( ... args)

Returns a value a such that: q = ibetaC(a, b, x).

Requires b > 0, 0 < x < 1, and 0 <= q <= 1.

.ibetaInvB( ... args)

Returns a value b such that: p = ibeta(a, b, x).

Requires a > 0, 0 < x < 1, and 0 <= p <= 1.

.ibetaCInvB( ... args)

Returns a value b such that: q = ibetaC(a, b, x).

Requires a > 0, 0 < x < 1, and 0 <= q <= 1.

.ibetaDerivative( ... args)

Returns the partial derivative with respect to x of the incomplete beta function ibeta(a,b,x).

.erf

Returns the error function of z.

.erfC

Returns the complement of the error function of z.

.erfInv

Returns the inverse error function of z, that is a value x such that:

p = erf(x).

.erfCInv

Returns the inverse of the complement of the error function of z, that is a value x such that:

p = erfC(x)

.legendreP(n, x)

Returns the Legendre Polynomial of the first kind.

Requires -1 <= x <= 1.

.legendrePPrime(n, x)

Returns the derivatives of the Legendre polynomials.

.legendrePZeros

Since the Legendre polynomials are alternatively even and odd, only the non-negative zeros are returned. For the odd Legendre polynomials, the first zero is always zero. The rest of the zeros are returned in increasing order.

.legendrePAssoc( ... args)

Returns the associated Legendre polynomial of the first kind.

Requires -1 <= x <= 1.

.legendreQ(n, x)

Returns the value of the Legendre polynomial that is the second solution to the Legendre differential equation.

Requires -1 <= x <= 1.

.laguerre(n, x)

Returns the value of the Laguerre Polynomial of order n at point x.

.laguerreAssoc( ... args)

Returns the Associated Laguerre polynomial of degree of dgree n and order m at point x.

.hermite(n, x)

Returns the value of the Hermite Polynomial of order n at point x.

.chebyshevT(n, x)

Returns the Chebyshev polynomials of the first kind.

.chebyshevU(n, x)

Returns the Chebyshev polynomials of the second kind.

.chebyshevTPrime(n, x)

Returns the derivatives of the Chebyshev polynomials of the first kind.

.chebyshevTZeros

Returns the roots (zeros) of the n-th Chebyshev polynomial of the first kind.

.sphericalHarmonic( ... args)

Returns the (Complex) value of the Spherical Harmonic.

theta is taken as the polar (colatitudinal) coordinate within [0, pi], and phi as the azimuthal (longitudinal) coordinate within [0,2pi].

See boost documentation for further information, including a note about the Condon-Shortley phase term of (-1)^m.

.sphericalHarmonicR( ... args)

Returns the real part of the Spherical Harmonic.

.sphericalHarmonicI( ... args)

Returns the imaginary part of the Spherical Harmonic.

.cylBesselJ(v, x)

Returns the result of the Bessel functions of the first kind.

The functions return the result of domain_error whenever the result is undefined or complex. This occurs when x < 0 and v is not an integer, or when x == 0 and v != 0.

.cylNeumann(v, x)

Returns the result of the Bessel functions of the second kind.

The functions return the result of domain_error whenever the result is undefined or complex. This occurs when x <= 0.

.cylBesselJZero(v, index)

Returns a single zero or root of the Bessel function of the first kind.

index is a 1-based index of zero of the cylindrical Bessel function of order v.

.cylNeumannZero(v, index)

Returns a single zero or root of the Neumann function (Bessel function of the second kind).

index is a 1-based index of zero of the cylindrical Neumann function of order v.

.cylBesselI(v, x)

Returns the result of the modified Bessel functions of the first kind.

.cylBesselK(v, x)

Returns the result of the modified Bessel functions of the second kind.

Requires x > 0.

.sphBessel(v, x)

Returns the result of the spherical Bessel functions of the first kind.

Requires x > 0.

.sphNeumann(v, x)

Returns the result of the spherical Bessel functions of the first kind.

Requires x > 0.

.cylBesselJPrime(v, x)

Returns the first derivative with respect to x of the corresponding Bessel function.

.cylNeumannPrime(v, x)

Returns the first derivative with respect to x of the corresponding Neumann function.

Requires x > 0.

.cylBesselIPrime(v, x)

Returns the first derivative with respect to x of the corresponding Bessel function.

.cylBesselKPrime(v, x)

Returns the first derivative with respect to x of the corresponding Bessel function.

Requires x > 0.

.sphBesselPrime(v, x)

Returns the first derivative with respect to x of the corresponding Bessel function.

Requires x > 0.

.sphNeumannPrime(v, x)

Returns the first derivative with respect to x of the corresponding Neumann function.

Requires x > 0.

.cylHankel1(v, x)

Returns the result of the Hankel functions of the first kind.

.cylHankel2(v, x)

Returns the result of the Hankel functions of the second kind.

.sphHankel1(v, x)

Returns the result of the spherical Hankel functions of the first kind.

.sphHankel2(v, x)

Returns the result of the spherical Hankel functions of the second kind.

.airyAi

Returns the result of the Airy function Ai at x.

.airyBi

Returns the result of the Airy function Bi at x.

.airyAiPrime

Returns the derivative of the Airy function Ai at x.

.airyBiPrime

Returns the derivative of the Airy function Bi at x.

.airyAiZero

Returns the mth zero or root of the Airy Ai function. The Airy Ai function has an infinite number of zeros on the negative real axis.

m is 1-based.

.airyBiZero

Returns the mth zero or root (1-based) of the Airy Bi function. The Airy Bi function has an infinite number of zeros on the negative real axis.

m is 1-based.

.ellintRf( ... args)

Returns Carlson's Elliptic Integral RF.

Requires that x,y >= 0, with at most one of them zero, and that z >= 0.

.ellintRd( ... args)

Returns Carlson's Elliptic Integral RD.

Requires that x,y >= 0, with at most one of them zero, and that z >= 0.

.ellintRj( ... args)

Returns Carlson's Elliptic Integral RJ.

Requires that x,y,z >= 0, with at most one of them zero, and that p != 0.

.ellintRc(x, y)

Returns Carlson's Elliptic Integral RC.

Requires that x >= 0, with at most one of them zero, and that y != 0.

.ellintRg( ... args)

Returns Carlson's Elliptic Integral RG.

Requires that x,y >= 0.

.ellint1(k, phi)

Returns the incomplete elliptic integral of the first kind, Legendre form.

Requires -1 <= k <= 1.

.ellint1C

Returns the complete elliptic integral of the first kind, Legendre form.

Requires -1 <= k <= 1.

.ellint2(k, phi)

Returns the incomplete elliptic integral of the second kind, Legendre form.

Requires -1 <= k <= 1.

.ellint2C

Returns the complete elliptic integral of the second kind, Legendre form.

Requires -1 <= k <= 1.

.ellint3( ... args)

Returns the incomplete elliptic integral of the third kind, Legendre form.

Requires -1 <= k <= 1 and n < 1/sin^2(phi).

.ellint3C(k, n)

Returns the complete elliptic integral of the third kind, Legendre form.

Requires -1 <= k <= 1 and n < 1.

.ellintD(k, phi)

Returns the incomplete elliptic integral D(phi, k), Legendre form.

Requires -1 <= k <= 1.

.ellintDC

Returns the complete elliptic integral D(phi, k), Legendre form.

Requires -1 <= k <= 1.

.jacobiZeta(k, phi)

Returns the result of the Jacobi Zeta Function.

Requires -1 <= k <= 1.

.heumanLambda(k, phi)

Returns the result of the Heuman Lambda Function.

Requires -1 <= k <= 1.

.jacobiCd(k, u)

.jacobiCn(k, u)

.jacobiCs(k, u)

.jacobiDc(k, u)

.jacobiDn(k, u)

.jacobiDs(k, u)

.jacobiNc(k, u)

.jacobiNd(k, u)

.jacobiNs(k, u)

.jacobiSc(k, u)

.jacobiSd(k, u)

.jacobiSn(k, u)

.zeta

Returns the zeta function of z.

Requires z != 1.

.expintEn(n, z)

Returns the exponential integral En of z.

Requires that when n == 1, z !=0.

.expintEi

Returns the exponential integral of z.

Requires z != 0.

.sinPi

Returns sin(x * π).

.cosPi

Returns cos(x * π).

.log1p

Returns the natural logarithm of x+1.

.expm1

Returns e^x - 1.

.cbrt

Returns the cube root of x.

.sqrt1pm1

Returns sqrt(1+x) - 1.

.powm1(x, y)

Returns x^y - 1.

.sincPi

Returns the Sinus Cardinal of x. Also known as the "sinc" function.

sincPi(x) = sin(x) / x

.sinhcPi

Returns the Hyperbolic Sinus Cardinal of x.

sinhcPi(x) = sinh(x) / x

.asinh

Returns the reciprocal of the hyperbolic sine function at x.

.acosh

Returns the reciprocal of the hyperbolic cosine function at x.

Requires x >= 1.

.atanh

Returns the reciprocal of the hyperbolic sine function at x.

Requires -1 < x < 1.

.owensT(h, a)

Returns the Owens T function of h and a.

Multichannel wrappers

All of the following messages are performed on the elements of this collection, using Object: -multiChannelPerform.

The result depends on the objects in the collection, but the main use case is for UGens.

See also Multichannel Expansion

.clip( ... args)

.wrap( ... args)

.fold( ... args)

.prune( ... args)

.linlin( ... args)

.linexp( ... args)

.explin( ... args)

.expexp( ... args)

.lincurve( ... args)

.curvelin( ... args)

.bilin( ... args)

.biexp( ... args)

.range( ... args)

.exprange( ... args)

.unipolar( ... args)

.bipolar( ... args)

.lag( ... args)

.lag2( ... args)

.lag3( ... args)

.lagud( ... args)

.lag2ud( ... args)

.lag3ud( ... args)

.varlag( ... args)

.slew( ... args)

.blend( ... args)

.checkBadValues( ... args)

Calls this.multiChannelPerform(selector, *args) where selector is the name of the message.

.multichannelExpandRef(rank)

This method is called internally on inputs to UGens that take multidimensional arrays, like Klank and it allows proper multichannel expansion even in those cases. For SequenceableCollection, this returns the collection itself, assuming that it contains already a number of Refs. See Ref for the corresponding method implementation.

Arguments:

rank

The depth at which the list is expanded. For instance the Klank spec has a rank of 2. For more examples, see SequenceableCollection: -flopDeep

Rhythm-lists

.convertRhythm

Convert a rhythm-list to durations.

Discussion:

supports a variation of Mikael Laurson's rhythm list RTM-notation.1

The method converts a collection of the form [beat-count, [rtm-list], repeats] to a List of Floats. A negative integer within the rtm-list equates to a value tied over to the duration following. The method is recursive in that any subdivision within the rtm-list can itself be a nested convertRhythm collection (see example below). The repeats integer has a default value of 1.

If the divisions in the rtm-list are events, the event durations are interpreted as relative durations, and a list of events is returned.

Starting UNIX processes

.unixCmd(action, postOutput: true)

Execute a UNIX command asynchronously. This object should be an array of strings where the first string is the path to the executable to be run and all other strings are passed as arguments to the executable. This method starts the process directly without using a shell.

Arguments:

action

A Function that is called when the process has exited. It is passed two arguments: the exit code and pid of the exited process.

postOutput

A Boolean that controls whether or not the output of the process is displayed in the post window.

Returns:

An Integer - the pid of the newly created process. Use Integer: -pidRunning to test if a process is alive.

Discussion:

Example:

.unixCmdGetStdOut(maxLineLength: 1024)

Similar to -unixCmd except that the stdout of the process is returned (synchronously) rather than sent to the post window. This object should be an array of strings where the first string is the path to the executable to be run and all other strings are passed as arguments to the executable. This method starts the process directly without using a shell.

Inherited instance methods

Undocumented instance methods

++(aSequenceableCollection)

+++(aSequenceableCollection, adverb)

==(aCollection)

.asFraction(denominator: 100, fasterBetter: true)

.asMIDIInPortUID

From extension in /usr/local/share/SuperCollider/SCClassLibrary/Common/Control/asMIDIPort.sc

.asOSCArgArray

From extension in /usr/local/share/SuperCollider/SCClassLibrary/Common/Control/extConvertToOSC.sc

.asOSCArgBundle

From extension in /usr/local/share/SuperCollider/SCClassLibrary/Common/Control/extConvertToOSC.sc

.asOSCArgEmbeddedArray(array)

From extension in /usr/local/share/SuperCollider/SCClassLibrary/Common/Control/extConvertToOSC.sc

.asPoint

.asQuant

.asRect

.asSequenceableCollection

.ascii

.bitAnd(aNumber, adverb)

.bitHammingDistance(aNumber, adverb)

.bitOr(aNumber, adverb)

.canFreeSynth

From extension in /usr/local/share/SuperCollider/SCClassLibrary/Common/Audio/canFreeSynth.sc

.containsSeqColl

.convertOneRhythm(list, tie: 0.0, stretch: 1.0)

.curverange( ... args)

.degrad

.degreeToKey(scale, stepsPerOctave: 12)

.delimit(function)

.firstArg(aNumber, adverb)

.flatIf(func)

.fold2(aNumber: 1, adverb)

.hanWindow

.hash

.hoareFind(k, function, left, right)

.hoareMedian(function)

.hoarePartition(l0, r0, p, function)

.hypotApx(aNumber, adverb)

.indexOfPrime

.insertionSort(function)

.insertionSortRange(function, left, right)

.isAssociationArray

.isSequenceableCollection

.keyToDegree(scale, stepsPerOctave: 12)

.keysValuesDo(function)

.lastIndex

.leftShift(aNumber, adverb)

.median(function)

.mergeSort(function)

.mergeSortTemp(function, tempArray, left, right)

.mergeTemp(function, tempArray, left, mid, right)

.middle

.middleIndex

.minNyquist

.mod(aNumber, adverb)

.moddif( ... args)

.mode(degree, octave: 12)

.multiChannelPerform(selector ... args)

.nearestInList(list)

.nearestInScale(scale, stepsPerOctave: 12)

.nextPrime

.nextTimeOnGrid(clock)

.nthPrime

.performBinaryOpOnComplex(aSelector, aComplex, adverb)

.performBinaryOpOnSeqColl(aSelector, theOperand, adverb)

.performBinaryOpOnSimpleNumber(aSelector, aNumber, adverb)

.performDegreeToKey(scaleDegree, stepsPerOctave: 12, accidental: 0)

.performKeyToDegree(degree, stepsPerOctave: 12)

.performNearestInList(degree)

.performNearestInScale(degree, stepsPerOctave: 12)

.prFlat(list)

.prepareForProxySynthDef(proxy)

From extension in /usr/local/share/SuperCollider/SCClassLibrary/JITLib/ProxySpace/wrapForNodeProxy.sc

.prevPrime

.quickSort(function)

.quickSortRange(i, j, function)

.raddeg

.ramp

.rate

.rectWindow

.removing(item)

.rightShift(aNumber, adverb)

.roundUp(aNumber: 1, adverb)

.sanitize( ... args)

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

.scurve

.sortMap(function)

.sortedMedian

.sqrsum(aNumber, adverb)

.sumRhythmDivisions

.thresh(aNumber, adverb)

.top

.transposeKey(amount, octave: 12)

.triWindow

.unlace(numlists, clumpSize: 1, clip: false)

.unsignedRightShift(aNumber, adverb)

.welWindow

.wrap2(aNumber: 1, adverb)

.wrapAt(index)

.wrapAtDepth(rank, index)

.wrapPut(index, value)

[1] - see Laurson and Kuuskankare's 2003, "From RTM-notation to ENP-score-notation" http://jim2003.agglo-montbeliard.fr/articles/laurson.pdf