MatrixMorph

MatrixMorph(input, matrix, sources)

Morphs between multiple PyoMatrixObjects.

Uses an index into a list of PyoMatrixObjects to morph between adjacent matrices in the list. The resulting morphed function is written into the `matrix` object at the beginning of each buffer size. The matrices in the list and the resulting matrix must be equal in size.

Parent class : PyoObject

Parameters:

    input : PyoObject
        Morphing index between 0 and 1. 0 is the first matrix in the list 
        and 1 is the last.
    matrix : NewMatrix
        The matrix where to write morphed function.
    sources : list of PyoMatrixObject
        List of matrices to interpolate from.

Methods:

    setInput(x, fadetime) : Replace the `input` attribute.
    setMatrix(x) : Replace the `matrix` attribute.
    setSources(x) : Replace the `sources` attribute.

Attributes:

    input : PyoObject. Morphing index between 0 and 1.
    matrix : NewMatrix. The matrix where to write samples.
    sources : list of PyoMatrixObject. List of matrices to interpolate from.

Notes:

    The out() method is bypassed. MatrixMorph returns no signal.

    MatrixMorph has no `mul` and `add` attributes.

Examples:

    >>> s = Server().boot()
    >>> s.start()
    >>> import math
    >>> def terrain(size=256, freq=3, phase=16):
    ...     xfreq = 2 * math.pi * freq
    ...     return [[math.sin(xfreq * (j/float(size)) + math.sin(i/float(phase))) for j in range(size)] for i in range(size)]
    ...
    >>> m1 = NewMatrix(256, 256, terrain(256, 1, 4)).normalize()
    >>> m2 = NewMatrix(256, 256, terrain(256, 2, 8)).normalize()
    >>> mm = NewMatrix(256, 256)
    >>> inter = Sine(1, 0, .5, .5)
    >>> morph = MatrixMorph(inter, mm, [m1,m2])
    >>> x = Sine([99,100], 0, .45, .5)
    >>> y = Sine([99,100], 0, .45, .5)
    >>> a = MatrixPointer(mm, x, y, mul=.25).out()

Methods details:

    MatrixMorph.setInput(x, fadetime=0.05):

        Replace the `input` attribute.

        Parameters:

        x : PyoObject
            New signal to process.
        fadetime : float, optional
            Crossfade time between old and new input. Defaults to 0.05.

    MatrixMorph.setMatrix(x):

        Replace the `matrix` attribute.

        Parameters:

        x : NewMatrix
            new `matrix` attribute.

    MatrixMorph.setSources(x):

         Replace the `sources` attribute.

        Parameters:

        x : list of PyoMatrixObject
            new `sources` attribute.