NewMatrix

NewMatrix(width, height, init=None)

Create a new matrix ready for recording.

Optionally, the matrix can be filled with the contents of the `init` parameter.

See `MatrixRec` to write samples in the matrix.

Parent class : PyoMatrixObject

Parameters:

    width : int
        Desired matrix width in samples.
    height : int
        Desired matrix height in samples.
    init : list of list of floats, optional
        Initial matrix. Defaults to None.

Methods:

    replace() : Replaces the actual matrix.
    getRate() : Returns the frequency (cycle per second) to give 
        to an oscillator to read a row at its original pitch.

See also : MatrixRec

Examples:

    >>> s = Server().boot()
    >>> s.start()
    >>> SIZE = 256
    >>> mm = NewMatrix(SIZE, SIZE)
    >>> fmind = Sine(.2, 0, 2, 2.5)
    >>> fmrat = Sine(.33, 0, .05, .5)
    >>> aa = FM(carrier=250, ratio=fmrat, index=fmind)
    >>> rec = MatrixRec(aa, mm, 0).play()
    >>> lfw = Sine([.1,.11], 0, .124, .25)
    >>> lfh = Sine([.15,.16], 0, .124, .25)
    >>> w = Sine(10, 0, lfw, .5)
    >>> h = Sine(1.5, 0, lfh, .5)
    >>> c = MatrixPointer(mm, w, h, mul=.3).out()

Methods details:

    NewMatrix.replace(x):

        Replaces the actual matrix.
        
        Parameters:
        
        x : list of list of floats
            New matrix. Must be of the same size as the actual matrix.

    NewMatrix.getRate(self):

        Returns the frequency (cycle per second) to give to an 
        oscillator to read the sound at its original pitch.