SuperCollider CLASSES (extension)

AtkMatrix
ExtensionExtension

A superclass to the Atk's various matrix classes.
Inherits from: Object

Description

An AtkMatrix is not typically instantiated directly, but rather through one of its subclasses: FoaEncoderMatrix, FoaDecoderMatrix, and FoaXformerMatrix.

Class Methods

*new (kind, set, type)

*new should not be called directly from AtkMatrix but rather is called from the various creation methods of its subclasses: FoaEncoderMatrix, FoaDecoderMatrix, or FoaXformerMatrix.

*newFromMatrix (aMatrix, set, type)

Create an instance from a raw 2D Matrix.

Arguments:

aMatrix

A Matrix in the form of

Matrix.with([[row1],[row2],...[rowN]])
set

'FOA', 'HOA1', 'HOA2', ... etc. Set describes both the signal set and the tool set, encompassing the Ambisonic order, as well as channel ordering and normalisation.

type

'decoder', 'encoder', or 'xformer'.

NOTE: set and type will be required if the AtkMatrix will subsequently be written to a file.

Inherited class methods

Instance Methods

-op

Answers 'matrix', i.e. the type of operation used to compute the resulting signals.

-matrix

Returns the raw coefficient Matrix.

-info

A convenience method to post the properties of the matrix, including metadata if the matrix was loaded from a .yml file.

-fileParse

If the instance was created by loading a .yml file, this method returns the IdentityDictionary containing the parsed metadata. This can be useful if anything was stored in the metadata that can be subsequently used once reloaded, such as encoding directions, rotations, etc.

NOTE: For simply a quick glance at the metadata, it's recommended to use -info.

-filePath

Answers the path of the file used to create the instance, or nil if not created by loading a matrix from a file.

-fileName

Answers the name of the file used to create the instance, or nil if not created by loading a matrix from a file.

-writeToFile (fileNameOrPath, note, attributeDictionary, overwrite: false)

Write the matrix to a file

Arguments:

fileNameOrPath

A String of the file name. The file extension determines the format:

  • .yml allows for additional user-specified metadata (recommended).
  • .txt writes the matrix coefficients only, in rows.
  • .mosl.txt creates basic matrix files compatible with the ATK for Reaper, a set of JSFX plugins for the Reaper DAW.

You may provide a full path if you would like to save the file somewhere other than the default location in the Atk extensions folder. See the Discussion below for more information.

note

A String that is a short description or bit of info about the matrix to store for future reference.

attributeDictionary

A Dictionary containing any information that's useful to store in key:value pairs. Keys that match getters in the AtkMatrix will take precedence over the defaults. See the Discussion for more details.

overwrite

A boolean specifying whether you'd like to force overwriting an existing file of the same name and extension.

Discussion:

The Guide to ATK Matrix Files offers examples and more discussion regarding writing and reading matrices and metadata, including how to generate matrices for use in Reaper.

-info

A convenience method to post the properties of the matrix, including metadata if the matrix was loaded from a .yml file.

-fileParse

If the instance was created by loading a .yml file, this method returns the IdentityDictionary containing the parsed metadata. This can be useful if anything was stored in the metadata that can be subsequently used once reloaded, such as encoding directions, rotations, etc.

NOTE: For simply a quick glance at the metadata, it's recommended to use -info.

-filePath

Answers the path of the file used to create the instance, or nil if not created by loading a matrix from a file.

-fileName

Answers the name of the file used to create the instance, or nil if not created by loading a matrix from a file.

Inherited instance methods

Undocumented instance methods

-type