SuperCollider CLASSES (extension)

AtkMatrixMix
ExtensionExtension

Matrix mixer from the Ambisonic Toolkit (ATK)
Inherits from: Object

Description

Mix an Array of channels to an Array of channels.

NOTE: AtkMatrixMix is usually called internally by the Ambisonic Toolkit's encoders, transformers and decoders.

Class Methods

*ar (in, matrix, mul: 1, add: 0)

Arguments:

in

The input signal, an array.

matrix

The mixing matrix.

mul

Output will be multiplied by this value.

add

This value will be added to the output.

Returns:

An array of channels.

Discussion:

NOTE: In normal circumstances, the user will not call AtkMatrixMix directly.

Inherited class methods

Instance Methods

Inherited instance methods

Examples

Monophonic to FOA

// hand code a mono signal to a planewave in B-format
(
{ 
    var matrix;
    var sig;

    // define encoding matrix
    matrix = Matrix.with([
        [ 2.sqrt.reciprocal ],
        [ 1 ],
        [ 0 ],
        [ 0 ]
    ]);

    // pink noise
    sig = PinkNoise.ar;

    // encode
    AtkMatrixMix.ar(sig, matrix);
}.scope
)

Stereophonic to FOA

// hand code a stereo signal to a +/-45deg in B-format
(
{ 
    var matrix;
    var sig;

    // define encoding matrix
    matrix = Matrix.with([
        [ 2.sqrt.reciprocal, 2.sqrt.reciprocal ],
        [ 2.sqrt.reciprocal, 2.sqrt.reciprocal ],
        [ 2.sqrt.reciprocal, 2.sqrt.reciprocal.neg ],
        [ 0,                 0 ]
    ]);

    // pink noise
    sig = PinkNoise.ar([1, 1]);

    // encode
    AtkMatrixMix.ar(sig, matrix);
}.scope
)