PyoMatrixObject

PyoMatrixObject(self)

Base class for all pyo matrix objects.

A matrix object is a 2 dimensions buffer memory to store precomputed samples.

The user should never instantiate an object of this class.

Methods:

    getSize() : Return matrix size in samples (x, y).
    view() : Opens a window showing the contents of the matrix.
    dump() : Print current status of the object's attributes.
    write(path) : Writes the content of the matrix in a text file.
    read(path) : Sets the content of the matrix from a text file.
    normalize() : Normalize matrix samples between -1 and 1.
    blur() : Apply a simple gaussian blur on the matrix.
    boost(min, max, boost) : Boost the contrast of values in the matrix.
    put(value, x, y) : Puts a value at specified position in the matrix.
    get(x, y) : Returns the value at specified position in the matrix.

Notes:

    Operations allowed on all matrix objects :
    
    len(obj) : Return the number of table streams in an object.
    obj[x] : Return table stream `x` of the object. `x` is a number 
        from 0 to len(obj) - 1.

Methods details:

    PyoMatrixObject.getSize(self):

        Returns matrix size in samples. Size is a tuple (x, y).

    PyoMatrixObject.view(title="Matrix viewer", wxnoserver=False):

        Opens a window showing the contents of the matrix.
        
        Parameters:
        
        title : string, optional
            Window title. Defaults to "Matrix viewer". 
        wxnoserver : boolean, optional
            With wxPython graphical toolkit, if True, tells the 
            interpreter that there will be no server window and not 
            to wait for it before showing the matrix window. 
            Defaults to False.

    PyoMatrixObject.dump(self):

        Print the number of streams and the current status of the 
        object's attributes.

    PyoMatrixObject.write(path):

        Writes the content of the matrix into a text file.
        
        This function can be used to store the matrix data as a
        list of list of floats into a text file.

    PyoMatrixObject.read(path):

        Reads the content of a text file and replaces the matrix data
        with the values in the file.
        
        Format is a list of lists of floats. For example, A two 
        matrixstreams object must be given a content like this:
        
        [[[0.0,1.0,0.5,...], [1.0,0.99,0.98,0.97,...]],
        [[0.0,1.0,0.5,...], [1.0,0.99,0.98,0.97,...]]]
        
        Each object's matrixstream will be resized according to the 
        length of the lists, but the number of matrixstreams must be
        the same.

    PyoMatrixObject.normalize(self):

        Normalize matrix samples between -1 and 1.

    PyoMatrixObject.blur(self):

        Apply a simple gaussian blur on the matrix.

    PyoMatrixObject.boost(min=-1.00, max=1.00, boost=0.01):

        Boost the constrast of values in the matrix.
        
        Parameters:
        
        min : float, optional
            Minimum value. Defaults to -1.0.
        max : float, optional
            Maximum value. Defaults to 1.0.
        boost : float, optional
            Amount of boost applied on each value. Defaults to 0.01.

    PyoMatrixObject.put(value, x=0, y=0):

        Puts a value at specified position in the matrix.
        
        If the object has more than 1 matrixstream, the default is to
        record the value in each matrix. User can call obj[x].put() 
        to record in a specific matrix.
        
        Parameters:
        
        value : float
            Value, as floating-point, to record in the matrix.
        x : int, optional
            X position where to record value. Defaults to 0.
        y : int, optional
            Y position where to record value. Defaults to 0.

    PyoMatrixObject.get(x, y):

        Returns the value, as float, at specified position in the matrix.
        
        If the object has more than 1 matrixstream, the default is to
        return a list with the value of each matrixstream. User can call 
        obj[x].get() to get the value of a specific matrix.
        
        Parameters:
        
        x : int, optional
            X position where to get value. Defaults to 0.
        y : int, optional
            Y position where to get value. Defaults to 0.



Subsections