DataTable

DataTable(size, chnls=1, init=None)

Create an empty table ready for data recording.

See `TableRec` to write samples in the table.

Parent class : PyoTableObject

Parameters:

    size : int
        Size of the table in samples.
    chnls : int, optional
        Number of channels that will be handled by the table. 
        Defaults to 1.
    init : list of floats, optional
        Initial table. List of list can match the number of channels,
        otherwise, the list will be loaded in all tablestreams. 
        Defaults to None.

Methods:

    getSize() : Returns the length of the table in samples.
    getRate() : Returns the frequency (cycle per second) to give 
        to an oscillator to read the sound at its original pitch.
    replace() : Replaces the actual table.

See also : NewTable TableRec

Examples:

    >>> s = Server().boot()
    >>> s.start()
    >>> import random
    >>> notes = [midiToHz(random.randint(60,84)) for i in range(10)]
    >>> tab = DataTable(size=10, init=notes)
    >>> ind = RandInt(10, 8)
    >>> pit = Index(tab, ind)
    >>> a = SineLoop(freq=pit, feedback = 0.05, mul=.5).out()

Methods details:

    DataTable.getSize(self):

        Returns the length of the table in samples.

    DataTable.getRate(self):

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

    DataTable.replace(x):

        Replaces the actual table.

        Parameters:

        x : list of floats
            New table. Must be of the same size as the actual table.
            List of list can match the number of channels, otherwise, 
            the list will be loaded in all tablestreams.