PyoObject

PyoObject(self)

Base class for all pyo objects that manipulate vectors of samples.

The user should never instantiate an object of this class.

Methods:

    play() : Start processing without sending samples to output. 
        This method is called automatically at the object creation.
    stop() : Stop processing.
    out(chnl, inc) : Start processing and send samples to audio output 
        beginning at `chnl`.
    mix(voices) : Mix object's audio streams into `voices` streams and 
        return the Mix object.
    setMul(x) : Replace the `mul` attribute.
    setAdd(x) : Replace the `add` attribute.
    setDiv(x) : Replace and inverse the `mul` attribute.
    setSub(x) : Replace and inverse the `add` attribute.
    set(attr, value, port) : Replace any attribute with portamento. 
    ctrl(map_list, title) : Opens a sliders window to control parameters.
    get(all) : Return the first sample of the current buffer as a float.
    dump() : Print current status of the object's attributes.

Attributes:

    mul : float or PyoObject
        Multiplication factor.
    add : float or PyoObject
        Addition factor.

Notes:

    - Other operations:
    
    len(obj) : Return the number of audio streams in an object.
    obj[x] : Return stream `x` of the object. `x` is a number 
        from 0 to len(obj) - 1.
    del obj : Perform a clean delete of the object.
    
    - Arithmetics:
    
    Multiplication, addition, division and substraction can be applied 
    between pyo objects or between pyo objects and numbers. Doing so 
    returns a Dummy object with the result of the operation.
    `b = a * 0.5` creates a Dummy object `b` with `mul` attribute set 
    to 0.5 and leave `a` unchanged.
    
    Inplace multiplication, addition, division and substraction can be 
    applied between pyo objects or between pyo objects and numbers. 
    These operations will replace the `mul` or `add` factor of the object. 
    `a *= 0.5` replaces the `mul` attribute of `a`.

Methods details:

    PyoObject.play(dur=0, delay=0):

        Start processing without sending samples to output. 
        This method is called automatically at the object creation.
        
        Parameters:
        
        dur : float, optional
            Duration, in seconds, of the object's activation. The default is 0
            and means infinite duration.
        delay : float, optional
            Delay, in seconds, before the object's activation. Defaults to 0.

    PyoObject.stop(self):

        Stop processing.

    PyoObject.out(chnl=0, inc=1, dur=0, delay=0):

        Start processing and send samples to audio output beginning at `chnl`.
        
        Parameters:

        chnl : int, optional
            Physical output assigned to the first audio stream of the object. 
            Defaults to 0.

            If `chnl` is an integer equal or greater than 0, successive 
            streams increment the output number by `inc` and wrap around 
            the global number of channels.
            
            If `chnl` is a negative integer: streams begin at 0, increment 
            the output number by `inc` and wrap around the global number of 
            channels. Then, the list of streams is scrambled.
            
            If `chnl` is a list: successive values in the list will be 
            assigned to successive streams.
        inc : int, optional
            Output increment value.
        dur : float, optional
            Duration, in seconds, of the object's activation. The default is 0
            and means infinite duration.
        delay : float, optional
            Delay, in seconds, before the object's activation. Defaults to 0.

    PyoObject.mix(voices=1):

        Mix the object's audio streams into `voices` streams and return 
        the Mix object.
        
        Parameters:

        voices : int, optional
            Number of audio streams of the Mix object created by this method. 
            If more than 1, object's streams are alternated and added into 
            Mix object's streams. Defaults to 1.

    PyoObject.setMul(x):

        Replace the `mul` attribute.
        
        Parameters:

        x : float or PyoObject
            New `mul` attribute.

    PyoObject.setAdd(x):

        Replace the `add` attribute.
                
        Parameters:

        x : float or PyoObject
            New `add` attribute.

    PyoObject.setDiv(x):

        Replace and inverse the `add` attribute.
                
        Parameters:

        x : float or PyoObject
            New inversed `add` attribute.

    PyoObject.setSub(x):

        Replace and inverse the `mul` attribute.
        
        Parameters:

        x : float or PyoObject
            New inversed `mul` attribute.

    PyoObject.set(attr, value, port=0.03):

        Replace any attribute with portamento.
        
        This method is intended to be applied on attributes that are not
        already assigned to PyoObjects. It will work only with floats or
        list of floats.
                
        Parameters:

        attr : string
            Name of the attribute as a string.
        value : float
            New value.
        port : float, optional
            Time, in seconds, to reach the new value

    PyoObject.ctrl(map_list=None, title=None, wxnoserver=False):

        Opens a sliders window to control the parameters of the object. 
        Only parameters that can be set to a PyoObject are allowed 
        to be mapped on a slider.

        If a list of values are given to a parameter, a multisliders 
        will be used to control each stream independently.
        
        Parameters:

        map_list : list of SLMap objects, optional
            Users defined set of parameters scaling. There is default 
            scaling for each object that accept `ctrl` method.
        title : string, optional
            Title of the window. If none is provided, the name of the 
            class is used.
        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 controller window. 
            Defaults to False.

    PyoObject.get(all=False):

        Return the first sample of the current buffer as a float.
        
        Can be used to convert audio stream to usable Python data.
        
        Object that implements string identifier for specific audio 
        streams must use the corresponding string to specify which stream
        to get value. See get() method definition in these object's man pages.
        
        Parameters:

            all : boolean, optional
                If True, the first value of each object's stream
                will be returned as a list. Otherwise, only the value
                of the first object's stream will be returned as a float.
                Defaults to False.

    PyoObject.dump(self):

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



Subsections