Tables

Tables are one-dimension containers to keep samples (sounds, envelopes, algorithmic patterns, etc.) in memory and access them quickly.

ChebyTable

class ChebyTable(list=[1.0, 0.0], size=8192)[source]

Chebyshev polynomials of the first kind.

Uses Chebyshev coefficients to generate stored polynomial functions which, under waveshaping, can be used to split a sinusoid into harmonic partials having a pre-definable spectrum.

Parent

PyoTableObject

Args
list: list, optional

Relative strengths of partials numbers 1,2,3, …, 12 that will result when a sinusoid of amplitude 1 is waveshaped using this function table. Up to 12 partials can be specified. Defaults to [1].

size: int, optional

Table size in samples. Defaults to 8192.

>>> s = Server().boot()
>>> s.start()
>>> t = ChebyTable([1,0,.33,0,.2,0,.143,0,.111])
>>> lfo = Sine(freq=.25, mul=0.45, add=0.5)
>>> a = Sine(freq=[200,201], mul=lfo)
>>> b = Lookup(table=t, index=a, mul=1-lfo).out()

Public Methods:

__init__([list, size])

Initialize self.

autoNormalize(x)

Activate/deactivate automatic normalization when harmonics changed.

replace(list)

Redraw the waveform according to a new set of harmonics relative strengths that will result when a sinusoid of amplitude 1 is waveshaped using this function table.

getNormTable()

Return a DataTable filled with the normalization function corresponding to the current polynomial.

graph([yrange, title, wxnoserver])

Opens a multislider window to control the data values.

list

list.

Inherited from PyoTableObject

__init__([list, size])

Initialize self.

save(path[, format, sampletype, quality])

Writes the content of the table in an audio file.

write(path[, oneline])

Writes the content of the table in a text file.

read(path)

Reads the content of a text file and replaces the table data with the values stored in the file.

getBuffer([chnl])

Return a reference to the underlying object implementing the buffer protocol.

setSize(size)

Change the size of the table.

getSize([all])

Return table size in samples.

put(value[, pos])

Puts a value at specified sample position in the table.

get(pos)

Returns the value, as float, stored at a specific position in the table.

getTable([all])

Returns the content of the table as list of floats.

normalize([level])

Normalizes table samples to a given level.

reset()

Resets table samples to 0.0.

removeDC()

Filter out DC offset from the table’s data.

reverse()

Reverse the table’s data in time.

invert()

Reverse the table’s data in amplitude.

rectify()

Positive rectification of the table’s data.

pow([exp])

Apply a power function on each sample in the table.

bipolarGain([gpos, gneg])

Apply different gain factor for positive and negative samples.

lowpass([freq])

Apply a one-pole lowpass filter on table’s samples.

fadein([dur, shape])

Apply a gradual increase in the level of the table’s samples.

fadeout([dur, shape])

Apply a gradual decrease in the level of the table’s samples.

add(x)

Performs addition on the table values.

sub(x)

Performs substraction on the table values.

mul(x)

Performs multiplication on the table values.

div(x)

Performs division on the table values.

copyData(table[, srcpos, destpos, length])

Copy samples from a source table.

rotate(pos)

Rotate the table content to the left around the position given as argument.

copy()

Returns a deep copy of the object.

view([title, wxnoserver])

Opens a window showing the contents of the table.

refreshView()

Updates the graphical display of the table, if applicable.

size

int.

Inherited from PyoObjectBase

__init__([list, size])

Initialize self.

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Methods:

_get_current_data()

Inherited from PyoTableObject

_setViewFrame(frame)

_setGraphFrame(frame)

_get_current_data()

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])

autoNormalize(x)[source]

Activate/deactivate automatic normalization when harmonics changed.

Args
x: boolean

True for activating automatic normalization, False for deactivating it.

replace(list)[source]

Redraw the waveform according to a new set of harmonics relative strengths that will result when a sinusoid of amplitude 1 is waveshaped using this function table.

Args
list: list

Relative strengths of the fixed harmonic partial numbers 1,2,3, …, 12. Up to 12 partials can be specified.

getNormTable()[source]

Return a DataTable filled with the normalization function corresponding to the current polynomial.

graph(yrange=(-1.0, 1.0), title=None, wxnoserver=False)[source]

Opens a multislider window to control the data values.

When editing the grapher with the mouse, the new values are sent to the object to replace the table content.

Args
yrange: tuple, optional

Set the min and max values of the Y axis of the multislider. Defaults to (0.0, 1.0).

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.

If wxnoserver is set to True, the interpreter will not wait for the server GUI before showing the controller window.

Note

The number of bars in the graph is initialized to the length of the list of relative strentghs at the time the graph is created.

property list

list. Relative strengths of the fixed harmonic partial numbers.

CosLogTable

class CosLogTable(list=[(0, 0.0), (8191, 1.0)], size=8192)[source]

Construct a table from logarithmic-cosine segments in breakpoint fashion.

Parent

PyoTableObject

Args
list: list, optional

List of tuples indicating location and value of each points in the table. The default, [(0,0.), (8191, 1.)], creates a logarithmic line from 0.0 at location 0 to 1.0 at the end of the table (size - 1). Location must be an integer.

size: int, optional

Table size in samples. Defaults to 8192.

Note

Locations in the list must be in increasing order. If the last value is less than size, the rest of the table will be filled with zeros.

Values must be greater than 0.0.

>>> s = Server().boot()
>>> s.start()
>>> t = CosLogTable([(0,0), (4095,1), (8192,0)])
>>> a = Osc(table=t, freq=2, mul=.25)
>>> b = SineLoop(freq=[599,600], feedback=0.05, mul=a).out()

Public Methods:

__init__([list, size])

Initialize self.

replace(list)

Draw a new envelope according to the new list parameter.

loadRecFile(filename[, tolerance])

Import an automation recording file in the table.

getPoints()

Returns list of points of the current table.

graph([yrange, title, wxnoserver])

Opens a grapher window to control the shape of the envelope.

list

list.

Inherited from PyoTableObject

__init__([list, size])

Initialize self.

save(path[, format, sampletype, quality])

Writes the content of the table in an audio file.

write(path[, oneline])

Writes the content of the table in a text file.

read(path)

Reads the content of a text file and replaces the table data with the values stored in the file.

getBuffer([chnl])

Return a reference to the underlying object implementing the buffer protocol.

setSize(size)

Change the size of the table.

getSize([all])

Return table size in samples.

put(value[, pos])

Puts a value at specified sample position in the table.

get(pos)

Returns the value, as float, stored at a specific position in the table.

getTable([all])

Returns the content of the table as list of floats.

normalize([level])

Normalizes table samples to a given level.

reset()

Resets table samples to 0.0.

removeDC()

Filter out DC offset from the table’s data.

reverse()

Reverse the table’s data in time.

invert()

Reverse the table’s data in amplitude.

rectify()

Positive rectification of the table’s data.

pow([exp])

Apply a power function on each sample in the table.

bipolarGain([gpos, gneg])

Apply different gain factor for positive and negative samples.

lowpass([freq])

Apply a one-pole lowpass filter on table’s samples.

fadein([dur, shape])

Apply a gradual increase in the level of the table’s samples.

fadeout([dur, shape])

Apply a gradual decrease in the level of the table’s samples.

add(x)

Performs addition on the table values.

sub(x)

Performs substraction on the table values.

mul(x)

Performs multiplication on the table values.

div(x)

Performs division on the table values.

copyData(table[, srcpos, destpos, length])

Copy samples from a source table.

rotate(pos)

Rotate the table content to the left around the position given as argument.

copy()

Returns a deep copy of the object.

view([title, wxnoserver])

Opens a window showing the contents of the table.

refreshView()

Updates the graphical display of the table, if applicable.

size

int.

Inherited from PyoObjectBase

__init__([list, size])

Initialize self.

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Methods:

Inherited from PyoTableObject

_setViewFrame(frame)

_setGraphFrame(frame)

_get_current_data()

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])

replace(list)[source]

Draw a new envelope according to the new list parameter.

Args
list: list

List of tuples indicating location and value of each points in the table. Location must be integer.

loadRecFile(filename, tolerance=0.02)[source]

Import an automation recording file in the table.

loadRecFile takes a recording file, usually from a ControlRec object, as filename parameter, applies a filtering pre-processing to eliminate redundancies and loads the result in the table as a list of points. Filtering process can be controled with the tolerance parameter.

Args
filename: string

Full path of an automation recording file.

tolerance: float, optional

Tolerance of the filter. A higher value will eliminate more points. Defaults to 0.02.

getPoints()[source]

Returns list of points of the current table.

graph(yrange=(0.0, 1.0), title=None, wxnoserver=False)[source]

Opens a grapher window to control the shape of the envelope.

When editing the grapher with the mouse, the new set of points will be send to the object on mouse up.

Ctrl+C with focus on the grapher will copy the list of points to the clipboard, giving an easy way to insert the new shape in a script.

Args
yrange: tuple, optional

Set the min and max values of the Y axis of the graph. Defaults to (0.0, 1.0).

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.

If wxnoserver is set to True, the interpreter will not wait for the server GUI before showing the controller window.

property list

list. List of tuples indicating location and value of each points in the table.

CosTable

class CosTable(list=[(0, 0.0), (8191, 1.0)], size=8192)[source]

Construct a table from cosine interpolated segments.

Parent

PyoTableObject

Args
list: list, optional

List of tuples indicating location and value of each points in the table. The default, [(0,0.), (8191, 1.)], creates a cosine line from 0.0 at location 0 to 1.0 at the end of the table (size - 1). Location must be an integer.

size: int, optional

Table size in samples. Defaults to 8192.

Note

Locations in the list must be in increasing order. If the last value is less than size, the rest of the table will be filled with zeros.

>>> s = Server().boot()
>>> s.start()
>>> # Sharp attack envelope
>>> t = CosTable([(0,0), (100,1), (1000,.25), (8191,0)])
>>> a = Osc(table=t, freq=2, mul=.25)
>>> b = SineLoop(freq=[299,300], feedback=0.05, mul=a).out()

Public Methods:

__init__([list, size])

Initialize self.

replace(list)

Draw a new envelope according to the new list parameter.

loadRecFile(filename[, tolerance])

Import an automation recording file in the table.

getPoints()

Returns list of points of the current table.

graph([yrange, title, wxnoserver])

Opens a grapher window to control the shape of the envelope.

list

list.

Inherited from PyoTableObject

__init__([list, size])

Initialize self.

save(path[, format, sampletype, quality])

Writes the content of the table in an audio file.

write(path[, oneline])

Writes the content of the table in a text file.

read(path)

Reads the content of a text file and replaces the table data with the values stored in the file.

getBuffer([chnl])

Return a reference to the underlying object implementing the buffer protocol.

setSize(size)

Change the size of the table.

getSize([all])

Return table size in samples.

put(value[, pos])

Puts a value at specified sample position in the table.

get(pos)

Returns the value, as float, stored at a specific position in the table.

getTable([all])

Returns the content of the table as list of floats.

normalize([level])

Normalizes table samples to a given level.

reset()

Resets table samples to 0.0.

removeDC()

Filter out DC offset from the table’s data.

reverse()

Reverse the table’s data in time.

invert()

Reverse the table’s data in amplitude.

rectify()

Positive rectification of the table’s data.

pow([exp])

Apply a power function on each sample in the table.

bipolarGain([gpos, gneg])

Apply different gain factor for positive and negative samples.

lowpass([freq])

Apply a one-pole lowpass filter on table’s samples.

fadein([dur, shape])

Apply a gradual increase in the level of the table’s samples.

fadeout([dur, shape])

Apply a gradual decrease in the level of the table’s samples.

add(x)

Performs addition on the table values.

sub(x)

Performs substraction on the table values.

mul(x)

Performs multiplication on the table values.

div(x)

Performs division on the table values.

copyData(table[, srcpos, destpos, length])

Copy samples from a source table.

rotate(pos)

Rotate the table content to the left around the position given as argument.

copy()

Returns a deep copy of the object.

view([title, wxnoserver])

Opens a window showing the contents of the table.

refreshView()

Updates the graphical display of the table, if applicable.

size

int.

Inherited from PyoObjectBase

__init__([list, size])

Initialize self.

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Methods:

Inherited from PyoTableObject

_setViewFrame(frame)

_setGraphFrame(frame)

_get_current_data()

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])

replace(list)[source]

Draw a new envelope according to the new list parameter.

Args
list: list

List of tuples indicating location and value of each points in the table. Location must be integer.

loadRecFile(filename, tolerance=0.02)[source]

Import an automation recording file in the table.

loadRecFile takes a recording file, usually from a ControlRec object, as filename parameter, applies a filtering pre-processing to eliminate redundancies and loads the result in the table as a list of points. Filtering process can be controled with the tolerance parameter.

Args
filename: string

Full path of an automation recording file.

tolerance: float, optional

Tolerance of the filter. A higher value will eliminate more points. Defaults to 0.02.

getPoints()[source]

Returns list of points of the current table.

graph(yrange=(0.0, 1.0), title=None, wxnoserver=False)[source]

Opens a grapher window to control the shape of the envelope.

When editing the grapher with the mouse, the new set of points will be send to the object on mouse up.

Ctrl+C with focus on the grapher will copy the list of points to the clipboard, giving an easy way to insert the new shape in a script.

Args
yrange: tuple, optional

Set the min and max values of the Y axis of the graph. Defaults to (0.0, 1.0).

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.

If wxnoserver is set to True, the interpreter will not wait for the server GUI before showing the controller window.

property list

list. List of tuples indicating location and value of each points in the table.

CurveTable

class CurveTable(list=[(0, 0.0), (8191, 1.0)], tension=0, bias=0, size=8192)[source]

Construct a table from curve interpolated segments.

CurveTable uses Hermite interpolation (sort of cubic interpolation) to calculate each points of the curve. This algorithm allows tension and biasing controls. Tension can be used to tighten up the curvature at the known points. The bias is used to twist the curve about the known points.

Parent

PyoTableObject

Args
list: list, optional

List of tuples indicating location and value of each points in the table. The default, [(0,0.), (8191, 1.)], creates a curved line from 0.0 at location 0 to 1.0 at the end of the table (size - 1). Location must be an integer.

tension: float, optional

Curvature at the known points. 1 is high, 0 normal, -1 is low. Defaults to 0.

bias: float, optional

Curve attraction (for each segments) toward bundary points. 0 is even, positive is towards first point, negative is towards the second point. Defaults to 0.

size: int, optional

Table size in samples. Defaults to 8192.

Note

Locations in the list must be in increasing order. If the last value is less than size, the rest of the table will be filled with zeros.

High tension or bias values can create unstable or very loud table, use normalize method to keep the curve between -1 and 1.

>>> s = Server().boot()
>>> s.start()
>>> t = CurveTable([(0,0),(2048,.5),(4096,.2),(6144,.5),(8192,0)], 0, 20)
>>> t.normalize()
>>> a = Osc(table=t, freq=2, mul=.25)
>>> b = SineLoop(freq=[299,300], feedback=0.05, mul=a).out()

Public Methods:

__init__([list, tension, bias, size])

Initialize self.

setTension(x)

Replace the tension attribute.

setBias(x)

Replace the bias attribute.

replace(list)

Draw a new envelope according to the new list parameter.

loadRecFile(filename[, tolerance])

Import an automation recording file in the table.

getPoints()

Returns list of points of the current table.

graph([yrange, title, wxnoserver])

Opens a grapher window to control the shape of the envelope.

tension

float.

bias

float.

list

list.

Inherited from PyoTableObject

__init__([list, tension, bias, size])

Initialize self.

save(path[, format, sampletype, quality])

Writes the content of the table in an audio file.

write(path[, oneline])

Writes the content of the table in a text file.

read(path)

Reads the content of a text file and replaces the table data with the values stored in the file.

getBuffer([chnl])

Return a reference to the underlying object implementing the buffer protocol.

setSize(size)

Change the size of the table.

getSize([all])

Return table size in samples.

put(value[, pos])

Puts a value at specified sample position in the table.

get(pos)

Returns the value, as float, stored at a specific position in the table.

getTable([all])

Returns the content of the table as list of floats.

normalize([level])

Normalizes table samples to a given level.

reset()

Resets table samples to 0.0.

removeDC()

Filter out DC offset from the table’s data.

reverse()

Reverse the table’s data in time.

invert()

Reverse the table’s data in amplitude.

rectify()

Positive rectification of the table’s data.

pow([exp])

Apply a power function on each sample in the table.

bipolarGain([gpos, gneg])

Apply different gain factor for positive and negative samples.

lowpass([freq])

Apply a one-pole lowpass filter on table’s samples.

fadein([dur, shape])

Apply a gradual increase in the level of the table’s samples.

fadeout([dur, shape])

Apply a gradual decrease in the level of the table’s samples.

add(x)

Performs addition on the table values.

sub(x)

Performs substraction on the table values.

mul(x)

Performs multiplication on the table values.

div(x)

Performs division on the table values.

copyData(table[, srcpos, destpos, length])

Copy samples from a source table.

rotate(pos)

Rotate the table content to the left around the position given as argument.

copy()

Returns a deep copy of the object.

view([title, wxnoserver])

Opens a window showing the contents of the table.

refreshView()

Updates the graphical display of the table, if applicable.

size

int.

Inherited from PyoObjectBase

__init__([list, tension, bias, size])

Initialize self.

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Methods:

Inherited from PyoTableObject

_setViewFrame(frame)

_setGraphFrame(frame)

_get_current_data()

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])

setTension(x)[source]

Replace the tension attribute.

1 is high, 0 normal, -1 is low.

Args
x: float

New tension attribute.

setBias(x)[source]

Replace the bias attribute.

0 is even, positive is towards first point, negative is towards the second point.

Args
x: float

New bias attribute.

replace(list)[source]

Draw a new envelope according to the new list parameter.

Args
list: list

List of tuples indicating location and value of each points in the table. Location must be integer.

loadRecFile(filename, tolerance=0.02)[source]

Import an automation recording file in the table.

loadRecFile takes a recording file, usually from a ControlRec object, as filename parameter, applies a filtering pre-processing to eliminate redundancies and loads the result in the table as a list of points. Filtering process can be controled with the tolerance parameter.

Args
filename: string

Full path of an automation recording file.

tolerance: float, optional

Tolerance of the filter. A higher value will eliminate more points. Defaults to 0.02.

getPoints()[source]

Returns list of points of the current table.

graph(yrange=(0.0, 1.0), title=None, wxnoserver=False)[source]

Opens a grapher window to control the shape of the envelope.

When editing the grapher with the mouse, the new set of points will be send to the object on mouse up.

Ctrl+C with focus on the grapher will copy the list of points to the clipboard, giving an easy way to insert the new shape in a script.

Args
yrange: tuple, optional

Set the min and max values of the Y axis of the graph. Defaults to (0.0, 1.0).

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.

If wxnoserver is set to True, the interpreter will not wait for the server GUI before showing the controller window.

property tension

float. Curvature tension.

property bias

float. Curve Attraction.

property list

list. List of tuples indicating location and value of each points in the table.

DataTable

class DataTable(size, chnls=1, init=None)[source]

Create an empty table ready for data recording.

See TableRec to write samples in the table.

Parent

PyoTableObject

Args
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.

See also

NewTable, TableRec

>>> s = Server().boot()
>>> s.start()
>>> import random
>>> notes = [midiToHz(random.randint(48,72)) for i in range(10)]
>>> tab = DataTable(size=10, init=notes)
>>> ind = RandInt(10, 8)
>>> pit = TableIndex(tab, ind)
>>> a = SineLoop(freq=[pit,pit*0.99], feedback = 0.07, mul=.2).out()

Public Methods:

__init__(size[, chnls, init])

Initialize self.

replace(x)

Replaces the actual table.

getRate()

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

graph([yrange, title, wxnoserver])

Opens a multislider window to control the data values.

size

int.

chnls

int.

init

list of floats.

Inherited from PyoTableObject

__init__(size[, chnls, init])

Initialize self.

save(path[, format, sampletype, quality])

Writes the content of the table in an audio file.

write(path[, oneline])

Writes the content of the table in a text file.

read(path)

Reads the content of a text file and replaces the table data with the values stored in the file.

getBuffer([chnl])

Return a reference to the underlying object implementing the buffer protocol.

setSize(size)

Change the size of the table.

getSize([all])

Return table size in samples.

put(value[, pos])

Puts a value at specified sample position in the table.

get(pos)

Returns the value, as float, stored at a specific position in the table.

getTable([all])

Returns the content of the table as list of floats.

normalize([level])

Normalizes table samples to a given level.

reset()

Resets table samples to 0.0.

removeDC()

Filter out DC offset from the table’s data.

reverse()

Reverse the table’s data in time.

invert()

Reverse the table’s data in amplitude.

rectify()

Positive rectification of the table’s data.

pow([exp])

Apply a power function on each sample in the table.

bipolarGain([gpos, gneg])

Apply different gain factor for positive and negative samples.

lowpass([freq])

Apply a one-pole lowpass filter on table’s samples.

fadein([dur, shape])

Apply a gradual increase in the level of the table’s samples.

fadeout([dur, shape])

Apply a gradual decrease in the level of the table’s samples.

add(x)

Performs addition on the table values.

sub(x)

Performs substraction on the table values.

mul(x)

Performs multiplication on the table values.

div(x)

Performs division on the table values.

copyData(table[, srcpos, destpos, length])

Copy samples from a source table.

rotate(pos)

Rotate the table content to the left around the position given as argument.

copy()

Returns a deep copy of the object.

view([title, wxnoserver])

Opens a window showing the contents of the table.

refreshView()

Updates the graphical display of the table, if applicable.

size

int.

Inherited from PyoObjectBase

__init__(size[, chnls, init])

Initialize self.

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Methods:

_check_data_size(lst)

_get_current_data()

Inherited from PyoTableObject

_setViewFrame(frame)

_setGraphFrame(frame)

_get_current_data()

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])

replace(x)[source]

Replaces the actual table.

Args
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.

getRate()[source]

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

graph(yrange=(0.0, 1.0), title=None, wxnoserver=False)[source]

Opens a multislider window to control the data values.

When editing the grapher with the mouse, the new values are sent to the object to replace the table content.

Args
yrange: tuple, optional

Set the min and max values of the Y axis of the multislider. Defaults to (0.0, 1.0).

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.

If wxnoserver is set to True, the interpreter will not wait for the server GUI before showing the controller window.

property size

int. Length of the table in samples.

property chnls

int. Number of channels that will be handled by the table.

property init

list of floats. Initial table.

ExpTable

class ExpTable(list=[(0, 0.0), (8192, 1.0)], exp=10, inverse=True, size=8192)[source]

Construct a table from exponential interpolated segments.

Parent

PyoTableObject

Args
list: list, optional

List of tuples indicating location and value of each points in the table. The default, [(0,0.), (8192, 1.)], creates a exponential line from 0.0 at location 0 to 1.0 at the end of the table. Location must be an integer.

exp: float, optional

Exponent factor. Used to control the slope of the curve. Defaults to 10.

inverse: boolean, optional

If True, downward slope will be inversed. Useful to create biexponential curves. Defaults to True.

size: int, optional

Table size in samples. Defaults to 8192.

Note

Locations in the list must be in increasing order. If the last value is less than size, the rest of the table will be filled with zeros.

>>> s = Server().boot()
>>> s.start()
>>> t = ExpTable([(0,0),(4096,1),(8192,0)], exp=5, inverse=True)
>>> a = Osc(table=t, freq=2, mul=.3)
>>> b = Sine(freq=[299,300], mul=a).out()

Public Methods:

__init__([list, exp, inverse, size])

Initialize self.

setExp(x)

Replace the exp attribute.

setInverse(x)

Replace the inverse attribute.

replace(list)

Draw a new envelope according to the new list parameter.

loadRecFile(filename[, tolerance])

Import an automation recording file in the table.

getPoints()

Returns list of points of the current table.

graph([yrange, title, wxnoserver])

Opens a grapher window to control the shape of the envelope.

exp

float.

inverse

boolean.

list

list.

Inherited from PyoTableObject

__init__([list, exp, inverse, size])

Initialize self.

save(path[, format, sampletype, quality])

Writes the content of the table in an audio file.

write(path[, oneline])

Writes the content of the table in a text file.

read(path)

Reads the content of a text file and replaces the table data with the values stored in the file.

getBuffer([chnl])

Return a reference to the underlying object implementing the buffer protocol.

setSize(size)

Change the size of the table.

getSize([all])

Return table size in samples.

put(value[, pos])

Puts a value at specified sample position in the table.

get(pos)

Returns the value, as float, stored at a specific position in the table.

getTable([all])

Returns the content of the table as list of floats.

normalize([level])

Normalizes table samples to a given level.

reset()

Resets table samples to 0.0.

removeDC()

Filter out DC offset from the table’s data.

reverse()

Reverse the table’s data in time.

invert()

Reverse the table’s data in amplitude.

rectify()

Positive rectification of the table’s data.

pow([exp])

Apply a power function on each sample in the table.

bipolarGain([gpos, gneg])

Apply different gain factor for positive and negative samples.

lowpass([freq])

Apply a one-pole lowpass filter on table’s samples.

fadein([dur, shape])

Apply a gradual increase in the level of the table’s samples.

fadeout([dur, shape])

Apply a gradual decrease in the level of the table’s samples.

add(x)

Performs addition on the table values.

sub(x)

Performs substraction on the table values.

mul(x)

Performs multiplication on the table values.

div(x)

Performs division on the table values.

copyData(table[, srcpos, destpos, length])

Copy samples from a source table.

rotate(pos)

Rotate the table content to the left around the position given as argument.

copy()

Returns a deep copy of the object.

view([title, wxnoserver])

Opens a window showing the contents of the table.

refreshView()

Updates the graphical display of the table, if applicable.

size

int.

Inherited from PyoObjectBase

__init__([list, exp, inverse, size])

Initialize self.

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Methods:

Inherited from PyoTableObject

_setViewFrame(frame)

_setGraphFrame(frame)

_get_current_data()

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])

setExp(x)[source]

Replace the exp attribute.

Args
x: float

New exp attribute.

setInverse(x)[source]

Replace the inverse attribute.

Args
x: boolean

New inverse attribute.

replace(list)[source]

Draw a new envelope according to the new list parameter.

Args
list: list

List of tuples indicating location and value of each points in the table. Location must be integer.

loadRecFile(filename, tolerance=0.02)[source]

Import an automation recording file in the table.

loadRecFile takes a recording file, usually from a ControlRec object, as filename parameter, applies a filtering pre-processing to eliminate redundancies and loads the result in the table as a list of points. Filtering process can be controled with the tolerance parameter.

Args
filename: string

Full path of an automation recording file.

tolerance: float, optional

Tolerance of the filter. A higher value will eliminate more points. Defaults to 0.02.

getPoints()[source]

Returns list of points of the current table.

graph(yrange=(0.0, 1.0), title=None, wxnoserver=False)[source]

Opens a grapher window to control the shape of the envelope.

When editing the grapher with the mouse, the new set of points will be send to the object on mouse up.

Ctrl+C with focus on the grapher will copy the list of points to the clipboard, giving an easy way to insert the new shape in a script.

Args
yrange: tuple, optional

Set the min and max values of the Y axis of the graph. Defaults to (0.0, 1.0).

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.

If wxnoserver is set to True, the interpreter will not wait for the server GUI before showing the controller window.

property exp

float. Exponent factor.

property inverse

boolean. Inverse factor.

property list

list. List of tuples indicating location and value of each points in the table.

HannTable

class HannTable(size=8192)[source]

Generates Hanning window function.

Parent

PyoTableObject

Args
size: int, optional

Table size in samples. Defaults to 8192.

>>> s = Server().boot()
>>> s.start()
>>> # Hanning envelope
>>> t = HannTable()
>>> a = Osc(table=t, freq=2, mul=.2)
>>> b = Sine(freq=[299,300], mul=a).out()

Public Methods:

__init__([size])

Initialize self.

Inherited from PyoTableObject

__init__([size])

Initialize self.

save(path[, format, sampletype, quality])

Writes the content of the table in an audio file.

write(path[, oneline])

Writes the content of the table in a text file.

read(path)

Reads the content of a text file and replaces the table data with the values stored in the file.

getBuffer([chnl])

Return a reference to the underlying object implementing the buffer protocol.

setSize(size)

Change the size of the table.

getSize([all])

Return table size in samples.

put(value[, pos])

Puts a value at specified sample position in the table.

get(pos)

Returns the value, as float, stored at a specific position in the table.

getTable([all])

Returns the content of the table as list of floats.

normalize([level])

Normalizes table samples to a given level.

reset()

Resets table samples to 0.0.

removeDC()

Filter out DC offset from the table’s data.

reverse()

Reverse the table’s data in time.

invert()

Reverse the table’s data in amplitude.

rectify()

Positive rectification of the table’s data.

pow([exp])

Apply a power function on each sample in the table.

bipolarGain([gpos, gneg])

Apply different gain factor for positive and negative samples.

lowpass([freq])

Apply a one-pole lowpass filter on table’s samples.

fadein([dur, shape])

Apply a gradual increase in the level of the table’s samples.

fadeout([dur, shape])

Apply a gradual decrease in the level of the table’s samples.

add(x)

Performs addition on the table values.

sub(x)

Performs substraction on the table values.

mul(x)

Performs multiplication on the table values.

div(x)

Performs division on the table values.

copyData(table[, srcpos, destpos, length])

Copy samples from a source table.

rotate(pos)

Rotate the table content to the left around the position given as argument.

copy()

Returns a deep copy of the object.

view([title, wxnoserver])

Opens a window showing the contents of the table.

refreshView()

Updates the graphical display of the table, if applicable.

size

int.

Inherited from PyoObjectBase

__init__([size])

Initialize self.

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Methods:

Inherited from PyoTableObject

_setViewFrame(frame)

_setGraphFrame(frame)

_get_current_data()

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])

HarmTable

class HarmTable(list=[1.0, 0.0], size=8192)[source]

Harmonic waveform generator.

Generates composite waveforms made up of weighted sums of simple sinusoids.

Parent

PyoTableObject

Args
list: list, optional

Relative strengths of the fixed harmonic partial numbers 1,2,3, etc. Defaults to [1].

size: int, optional

Table size in samples. Defaults to 8192.

>>> s = Server().boot()
>>> s.start()
>>> # Square wave up to 9th harmonic
>>> t = HarmTable([1,0,.33,0,.2,0,.143,0,.111])
>>> a = Osc(table=t, freq=[199,200], mul=.2).out()

Public Methods:

__init__([list, size])

Initialize self.

autoNormalize(x)

Activate/deactivate automatic normalization when harmonics changed.

replace(list)

Redraw the waveform according to a new set of harmonics relative strengths.

graph([yrange, title, wxnoserver])

Opens a multislider window to control the data values.

list

list.

Inherited from PyoTableObject

__init__([list, size])

Initialize self.

save(path[, format, sampletype, quality])

Writes the content of the table in an audio file.

write(path[, oneline])

Writes the content of the table in a text file.

read(path)

Reads the content of a text file and replaces the table data with the values stored in the file.

getBuffer([chnl])

Return a reference to the underlying object implementing the buffer protocol.

setSize(size)

Change the size of the table.

getSize([all])

Return table size in samples.

put(value[, pos])

Puts a value at specified sample position in the table.

get(pos)

Returns the value, as float, stored at a specific position in the table.

getTable([all])

Returns the content of the table as list of floats.

normalize([level])

Normalizes table samples to a given level.

reset()

Resets table samples to 0.0.

removeDC()

Filter out DC offset from the table’s data.

reverse()

Reverse the table’s data in time.

invert()

Reverse the table’s data in amplitude.

rectify()

Positive rectification of the table’s data.

pow([exp])

Apply a power function on each sample in the table.

bipolarGain([gpos, gneg])

Apply different gain factor for positive and negative samples.

lowpass([freq])

Apply a one-pole lowpass filter on table’s samples.

fadein([dur, shape])

Apply a gradual increase in the level of the table’s samples.

fadeout([dur, shape])

Apply a gradual decrease in the level of the table’s samples.

add(x)

Performs addition on the table values.

sub(x)

Performs substraction on the table values.

mul(x)

Performs multiplication on the table values.

div(x)

Performs division on the table values.

copyData(table[, srcpos, destpos, length])

Copy samples from a source table.

rotate(pos)

Rotate the table content to the left around the position given as argument.

copy()

Returns a deep copy of the object.

view([title, wxnoserver])

Opens a window showing the contents of the table.

refreshView()

Updates the graphical display of the table, if applicable.

size

int.

Inherited from PyoObjectBase

__init__([list, size])

Initialize self.

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Methods:

_get_current_data()

Inherited from PyoTableObject

_setViewFrame(frame)

_setGraphFrame(frame)

_get_current_data()

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])

autoNormalize(x)[source]

Activate/deactivate automatic normalization when harmonics changed.

Args
x: boolean

True for activating automatic normalization, False for deactivating it.

replace(list)[source]

Redraw the waveform according to a new set of harmonics relative strengths.

Args
list: list

Relative strengths of the fixed harmonic partial numbers 1,2,3, etc.

graph(yrange=(-1.0, 1.0), title=None, wxnoserver=False)[source]

Opens a multislider window to control the data values.

When editing the grapher with the mouse, the new values are sent to the object to replace the table content.

Args
yrange: tuple, optional

Set the min and max values of the Y axis of the multislider. Defaults to (0.0, 1.0).

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.

If wxnoserver is set to True, the interpreter will not wait for the server GUI before showing the controller window.

Note

The number of bars in the graph is initialized to the length of the list of relative strentghs at the time the graph is created.

property list

list. Relative strengths of the fixed harmonic partial numbers.

LinTable

class LinTable(list=[(0, 0.0), (8191, 1.0)], size=8192)[source]

Construct a table from segments of straight lines in breakpoint fashion.

Parent

PyoTableObject

Args
list: list, optional

List of tuples indicating location and value of each points in the table. The default, [(0,0.), (8191, 1.)], creates a straight line from 0.0 at location 0 to 1.0 at the end of the table (size - 1). Location must be an integer.

size: int, optional

Table size in samples. Defaults to 8192.

Note

Locations in the list must be in increasing order. If the last value is less than size, the rest of the table will be filled with zeros.

>>> s = Server().boot()
>>> s.start()
>>> # Sharp attack envelope
>>> t = LinTable([(0,0), (100,1), (1000,.25), (8191,0)])
>>> a = Osc(table=t, freq=2, mul=.25)
>>> b = SineLoop(freq=[299,300], feedback=0.05, mul=a).out()

Public Methods:

__init__([list, size])

Initialize self.

replace(list)

Draw a new envelope according to the new list parameter.

loadRecFile(filename[, tolerance])

Import an automation recording file in the table.

getPoints()

Returns list of points of the current table.

graph([yrange, title, wxnoserver])

Opens a grapher window to control the shape of the envelope.

list

list.

Inherited from PyoTableObject

__init__([list, size])

Initialize self.

save(path[, format, sampletype, quality])

Writes the content of the table in an audio file.

write(path[, oneline])

Writes the content of the table in a text file.

read(path)

Reads the content of a text file and replaces the table data with the values stored in the file.

getBuffer([chnl])

Return a reference to the underlying object implementing the buffer protocol.

setSize(size)

Change the size of the table.

getSize([all])

Return table size in samples.

put(value[, pos])

Puts a value at specified sample position in the table.

get(pos)

Returns the value, as float, stored at a specific position in the table.

getTable([all])

Returns the content of the table as list of floats.

normalize([level])

Normalizes table samples to a given level.

reset()

Resets table samples to 0.0.

removeDC()

Filter out DC offset from the table’s data.

reverse()

Reverse the table’s data in time.

invert()

Reverse the table’s data in amplitude.

rectify()

Positive rectification of the table’s data.

pow([exp])

Apply a power function on each sample in the table.

bipolarGain([gpos, gneg])

Apply different gain factor for positive and negative samples.

lowpass([freq])

Apply a one-pole lowpass filter on table’s samples.

fadein([dur, shape])

Apply a gradual increase in the level of the table’s samples.

fadeout([dur, shape])

Apply a gradual decrease in the level of the table’s samples.

add(x)

Performs addition on the table values.

sub(x)

Performs substraction on the table values.

mul(x)

Performs multiplication on the table values.

div(x)

Performs division on the table values.

copyData(table[, srcpos, destpos, length])

Copy samples from a source table.

rotate(pos)

Rotate the table content to the left around the position given as argument.

copy()

Returns a deep copy of the object.

view([title, wxnoserver])

Opens a window showing the contents of the table.

refreshView()

Updates the graphical display of the table, if applicable.

size

int.

Inherited from PyoObjectBase

__init__([list, size])

Initialize self.

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Methods:

Inherited from PyoTableObject

_setViewFrame(frame)

_setGraphFrame(frame)

_get_current_data()

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])

replace(list)[source]

Draw a new envelope according to the new list parameter.

Args
list: list

List of tuples indicating location and value of each points in the table. Location must be integer.

loadRecFile(filename, tolerance=0.02)[source]

Import an automation recording file in the table.

loadRecFile takes a recording file, usually from a ControlRec object, as filename parameter, applies a filtering pre-processing to eliminate redundancies and loads the result in the table as a list of points. Filtering process can be controled with the tolerance parameter.

Args
filename: string

Full path of an automation recording file.

tolerance: float, optional

Tolerance of the filter. A higher value will eliminate more points. Defaults to 0.02.

getPoints()[source]

Returns list of points of the current table.

graph(yrange=(0.0, 1.0), title=None, wxnoserver=False)[source]

Opens a grapher window to control the shape of the envelope.

When editing the grapher with the mouse, the new set of points will be send to the object on mouse up.

Ctrl+C with focus on the grapher will copy the list of points to the clipboard, giving an easy way to insert the new shape in a script.

Args
yrange: tuple, optional

Set the min and max values of the Y axis of the graph. Defaults to (0.0, 1.0).

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.

If wxnoserver is set to True, the interpreter will not wait for the server GUI before showing the controller window.

property list

list. List of tuples indicating location and value of each points in the table.

LogTable

class LogTable(list=[(0, 0.0), (8191, 1.0)], size=8192)[source]

Construct a table from logarithmic segments in breakpoint fashion.

Parent

PyoTableObject

Args
list: list, optional

List of tuples indicating location and value of each points in the table. The default, [(0,0.), (8191, 1.)], creates a logarithmic line from 0.0 at location 0 to 1.0 at the end of the table (size - 1). Location must be an integer.

size: int, optional

Table size in samples. Defaults to 8192.

Note

Locations in the list must be in increasing order. If the last value is less than size, the rest of the table will be filled with zeros.

Values must be greater than 0.0.

>>> s = Server().boot()
>>> s.start()
>>> t = LogTable([(0,0), (4095,1), (8192,0)])
>>> a = Osc(table=t, freq=2, mul=.25)
>>> b = SineLoop(freq=[599,600], feedback=0.05, mul=a).out()

Public Methods:

__init__([list, size])

Initialize self.

replace(list)

Draw a new envelope according to the new list parameter.

loadRecFile(filename[, tolerance])

Import an automation recording file in the table.

getPoints()

Returns list of points of the current table.

graph([yrange, title, wxnoserver])

Opens a grapher window to control the shape of the envelope.

list

list.

Inherited from PyoTableObject

__init__([list, size])

Initialize self.

save(path[, format, sampletype, quality])

Writes the content of the table in an audio file.

write(path[, oneline])

Writes the content of the table in a text file.

read(path)

Reads the content of a text file and replaces the table data with the values stored in the file.

getBuffer([chnl])

Return a reference to the underlying object implementing the buffer protocol.

setSize(size)

Change the size of the table.

getSize([all])

Return table size in samples.

put(value[, pos])

Puts a value at specified sample position in the table.

get(pos)

Returns the value, as float, stored at a specific position in the table.

getTable([all])

Returns the content of the table as list of floats.

normalize([level])

Normalizes table samples to a given level.

reset()

Resets table samples to 0.0.

removeDC()

Filter out DC offset from the table’s data.

reverse()

Reverse the table’s data in time.

invert()

Reverse the table’s data in amplitude.

rectify()

Positive rectification of the table’s data.

pow([exp])

Apply a power function on each sample in the table.

bipolarGain([gpos, gneg])

Apply different gain factor for positive and negative samples.

lowpass([freq])

Apply a one-pole lowpass filter on table’s samples.

fadein([dur, shape])

Apply a gradual increase in the level of the table’s samples.

fadeout([dur, shape])

Apply a gradual decrease in the level of the table’s samples.

add(x)

Performs addition on the table values.

sub(x)

Performs substraction on the table values.

mul(x)

Performs multiplication on the table values.

div(x)

Performs division on the table values.

copyData(table[, srcpos, destpos, length])

Copy samples from a source table.

rotate(pos)

Rotate the table content to the left around the position given as argument.

copy()

Returns a deep copy of the object.

view([title, wxnoserver])

Opens a window showing the contents of the table.

refreshView()

Updates the graphical display of the table, if applicable.

size

int.

Inherited from PyoObjectBase

__init__([list, size])

Initialize self.

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Methods:

Inherited from PyoTableObject

_setViewFrame(frame)

_setGraphFrame(frame)

_get_current_data()

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])

replace(list)[source]

Draw a new envelope according to the new list parameter.

Args
list: list

List of tuples indicating location and value of each points in the table. Location must be integer.

loadRecFile(filename, tolerance=0.02)[source]

Import an automation recording file in the table.

loadRecFile takes a recording file, usually from a ControlRec object, as filename parameter, applies a filtering pre-processing to eliminate redundancies and loads the result in the table as a list of points. Filtering process can be controled with the tolerance parameter.

Args
filename: string

Full path of an automation recording file.

tolerance: float, optional

Tolerance of the filter. A higher value will eliminate more points. Defaults to 0.02.

getPoints()[source]

Returns list of points of the current table.

graph(yrange=(0.0, 1.0), title=None, wxnoserver=False)[source]

Opens a grapher window to control the shape of the envelope.

When editing the grapher with the mouse, the new set of points will be send to the object on mouse up.

Ctrl+C with focus on the grapher will copy the list of points to the clipboard, giving an easy way to insert the new shape in a script.

Args
yrange: tuple, optional

Set the min and max values of the Y axis of the graph. Defaults to (0.0, 1.0).

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.

If wxnoserver is set to True, the interpreter will not wait for the server GUI before showing the controller window.

property list

list. List of tuples indicating location and value of each points in the table.

NewTable

class NewTable(length, chnls=1, init=None, feedback=0.0)[source]

Create an empty table ready for recording.

See TableRec to write samples in the table.

Parent

PyoTableObject

Args
length: float

Length of the table in seconds.

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.

feedback: float, optional

Amount of old data to mix with a new recording. Defaults to 0.0.

See also

DataTable, TableRec

>>> s = Server(duplex=1).boot()
>>> s.start()
>>> t = NewTable(length=2, chnls=1)
>>> a = Input(0)
>>> b = TableRec(a, t, .01)
>>> amp = Iter(b["trig"], [.5])
>>> freq = t.getRate()
>>> c = Osc(table=t, freq=[freq, freq*.99], mul=amp).out()
>>> # to record in the empty table, call:
>>> # b.play()

Public Methods:

__init__(length[, chnls, init, feedback])

Initialize self.

replace(x)

Replaces the actual table.

setFeedback(x)

Replaces the`feedback` attribute.

getLength()

Returns the length of the table in seconds.

getDur([all])

Returns the length of the table in seconds.

getRate()

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

getViewTable(size[, begin, end])

Return a list of points (in X, Y pixel values) for each channel in the table.

view([title, wxnoserver, mouse_callback])

Opens a window showing the contents of the table.

refreshView()

Updates the graphical display of the table, if applicable.

length

float.

chnls

int.

init

list of floats.

feedback

float.

size

int.

Inherited from PyoTableObject

__init__(length[, chnls, init, feedback])

Initialize self.

save(path[, format, sampletype, quality])

Writes the content of the table in an audio file.

write(path[, oneline])

Writes the content of the table in a text file.

read(path)

Reads the content of a text file and replaces the table data with the values stored in the file.

getBuffer([chnl])

Return a reference to the underlying object implementing the buffer protocol.

setSize(size)

Change the size of the table.

getSize([all])

Return table size in samples.

put(value[, pos])

Puts a value at specified sample position in the table.

get(pos)

Returns the value, as float, stored at a specific position in the table.

getTable([all])

Returns the content of the table as list of floats.

normalize([level])

Normalizes table samples to a given level.

reset()

Resets table samples to 0.0.

removeDC()

Filter out DC offset from the table’s data.

reverse()

Reverse the table’s data in time.

invert()

Reverse the table’s data in amplitude.

rectify()

Positive rectification of the table’s data.

pow([exp])

Apply a power function on each sample in the table.

bipolarGain([gpos, gneg])

Apply different gain factor for positive and negative samples.

lowpass([freq])

Apply a one-pole lowpass filter on table’s samples.

fadein([dur, shape])

Apply a gradual increase in the level of the table’s samples.

fadeout([dur, shape])

Apply a gradual decrease in the level of the table’s samples.

add(x)

Performs addition on the table values.

sub(x)

Performs substraction on the table values.

mul(x)

Performs multiplication on the table values.

div(x)

Performs division on the table values.

copyData(table[, srcpos, destpos, length])

Copy samples from a source table.

rotate(pos)

Rotate the table content to the left around the position given as argument.

copy()

Returns a deep copy of the object.

view([title, wxnoserver, mouse_callback])

Opens a window showing the contents of the table.

refreshView()

Updates the graphical display of the table, if applicable.

size

int.

Inherited from PyoObjectBase

__init__(length[, chnls, init, feedback])

Initialize self.

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Methods:

_check_data_size(lst)

Inherited from PyoTableObject

_setViewFrame(frame)

_setGraphFrame(frame)

_get_current_data()

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])

replace(x)[source]

Replaces the actual table.

Args
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.

setFeedback(x)[source]

Replaces the`feedback` attribute.

Args
x: float

New feedback value.

getLength()[source]

Returns the length of the table in seconds.

getDur(all=True)[source]

Returns the length of the table in seconds.

The all argument is there for compatibility with SndTable but is not used for now.

getRate()[source]

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

getViewTable(size, begin=0, end=0)[source]

Return a list of points (in X, Y pixel values) for each channel in the table. These lists can be draw on a DC (WxPython) with a DrawLines method.

Args
size: tuple

Size, (X, Y) pixel values, of the waveform container window.

begin: float, optional

First position in the the table, in seconds, where to get samples. Defaults to 0.

end: float, optional

Last position in the table, in seconds, where to get samples.

if this value is set to 0, that means the end of the table. Defaults to 0.

view(title='Sound waveform', wxnoserver=False, mouse_callback=None)[source]

Opens a window showing the contents of the table.

Args
title: string, optional

Window title. Defaults to “Table waveform”.

wxnoserver: boolean, optional

With wxPython graphical toolkit, if True, tells the interpreter that there will be no server window.

mouse_callback: callable

If provided, this function will be called with the mouse position, inside the frame, as argument. Defaults to None.

If wxnoserver is set to True, the interpreter will not wait for the server GUI before showing the controller window.

refreshView()[source]

Updates the graphical display of the table, if applicable.

property length

float. Length of the table in seconds.

property chnls

int. Number of channels that will be handled by the table.

property init

list of floats. Initial table.

property feedback

float. Amount of old data to mix with a new recording.

property size

int. Table size in samples.

ParaTable

class ParaTable(size=8192)[source]

Generates parabola window function.

The parabola is a conic section, the intersection of a right circular conical surface and a plane parallel to a generating straight line of that surface.

Parent

PyoTableObject

Args
size: int, optional

Table size in samples. Defaults to 8192.

>>> s = Server().boot()
>>> s.start()
>>> # Parabola envelope
>>> t = ParaTable()
>>> a = Osc(table=t, freq=2, mul=.2)
>>> b = SineLoop(freq=[299,300], feedback=0.05, mul=a).out()

Public Methods:

__init__([size])

Initialize self.

Inherited from PyoTableObject

__init__([size])

Initialize self.

save(path[, format, sampletype, quality])

Writes the content of the table in an audio file.

write(path[, oneline])

Writes the content of the table in a text file.

read(path)

Reads the content of a text file and replaces the table data with the values stored in the file.

getBuffer([chnl])

Return a reference to the underlying object implementing the buffer protocol.

setSize(size)

Change the size of the table.

getSize([all])

Return table size in samples.

put(value[, pos])

Puts a value at specified sample position in the table.

get(pos)

Returns the value, as float, stored at a specific position in the table.

getTable([all])

Returns the content of the table as list of floats.

normalize([level])

Normalizes table samples to a given level.

reset()

Resets table samples to 0.0.

removeDC()

Filter out DC offset from the table’s data.

reverse()

Reverse the table’s data in time.

invert()

Reverse the table’s data in amplitude.

rectify()

Positive rectification of the table’s data.

pow([exp])

Apply a power function on each sample in the table.

bipolarGain([gpos, gneg])

Apply different gain factor for positive and negative samples.

lowpass([freq])

Apply a one-pole lowpass filter on table’s samples.

fadein([dur, shape])

Apply a gradual increase in the level of the table’s samples.

fadeout([dur, shape])

Apply a gradual decrease in the level of the table’s samples.

add(x)

Performs addition on the table values.

sub(x)

Performs substraction on the table values.

mul(x)

Performs multiplication on the table values.

div(x)

Performs division on the table values.

copyData(table[, srcpos, destpos, length])

Copy samples from a source table.

rotate(pos)

Rotate the table content to the left around the position given as argument.

copy()

Returns a deep copy of the object.

view([title, wxnoserver])

Opens a window showing the contents of the table.

refreshView()

Updates the graphical display of the table, if applicable.

size

int.

Inherited from PyoObjectBase

__init__([size])

Initialize self.

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Methods:

Inherited from PyoTableObject

_setViewFrame(frame)

_setGraphFrame(frame)

_get_current_data()

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])

PartialTable

class PartialTable(list=[(1, 1), (1.33, 0.5), (1.67, 0.3)], size=65536)[source]

Inharmonic waveform generator.

Generates waveforms made of inharmonic components. Partials are given as a list of 2-values tuple, where the first one is the partial number (can be float) and the second one is the strength of the partial.

The object uses the first two decimal values of each partial to compute a higher harmonic at a multiple of 100 (so each component is in reality truly harmonic). If the oscillator has a frequency divided by 100, the real desired partials will be restituted.

The list:

[(1, 1), (1.1, 0.7), (1.15, 0.5)] will draw a table with:

harmonic 100: amplitude = 1 harmonic 110: amplitude = 0.7 harmonic 115: amplitude = 0.5

To listen to a signal composed of 200, 220 and 230 Hz, one should declared an oscillator like this (frequency of 200Hz divided by 100):

a = Osc(t, freq=2, mul=0.5).out()

Parent

PyoTableObject

Args
list: list of tuple, optional

List of 2-values tuples. First value is the partial number (float up to two decimal values) and second value is its amplitude (relative to the other harmonics). Defaults to [(1,1), (1.33,0.5),(1.67,0.3)].

size: int, optional

Table size in samples. Because computed harmonics are very high in frequency, the table size must be bigger than a classic HarmTable. Defaults to 65536.

>>> s = Server().boot()
>>> s.start()
>>> t = PartialTable([(1,1), (2.37, 0.5), (4.55, 0.3)]).normalize()
>>> # Play with fundamentals 199 and 200 Hz
>>> a = Osc(table=t, freq=[1.99,2], mul=.2).out()

Public Methods:

__init__([list, size])

Initialize self.

replace(list)

Redraw the waveform according to a new set of harmonics relative strengths.

list

list.

Inherited from PyoTableObject

__init__([list, size])

Initialize self.

save(path[, format, sampletype, quality])

Writes the content of the table in an audio file.

write(path[, oneline])

Writes the content of the table in a text file.

read(path)

Reads the content of a text file and replaces the table data with the values stored in the file.

getBuffer([chnl])

Return a reference to the underlying object implementing the buffer protocol.

setSize(size)

Change the size of the table.

getSize([all])

Return table size in samples.

put(value[, pos])

Puts a value at specified sample position in the table.

get(pos)

Returns the value, as float, stored at a specific position in the table.

getTable([all])

Returns the content of the table as list of floats.

normalize([level])

Normalizes table samples to a given level.

reset()

Resets table samples to 0.0.

removeDC()

Filter out DC offset from the table’s data.

reverse()

Reverse the table’s data in time.

invert()

Reverse the table’s data in amplitude.

rectify()

Positive rectification of the table’s data.

pow([exp])

Apply a power function on each sample in the table.

bipolarGain([gpos, gneg])

Apply different gain factor for positive and negative samples.

lowpass([freq])

Apply a one-pole lowpass filter on table’s samples.

fadein([dur, shape])

Apply a gradual increase in the level of the table’s samples.

fadeout([dur, shape])

Apply a gradual decrease in the level of the table’s samples.

add(x)

Performs addition on the table values.

sub(x)

Performs substraction on the table values.

mul(x)

Performs multiplication on the table values.

div(x)

Performs division on the table values.

copyData(table[, srcpos, destpos, length])

Copy samples from a source table.

rotate(pos)

Rotate the table content to the left around the position given as argument.

copy()

Returns a deep copy of the object.

view([title, wxnoserver])

Opens a window showing the contents of the table.

refreshView()

Updates the graphical display of the table, if applicable.

size

int.

Inherited from PyoObjectBase

__init__([list, size])

Initialize self.

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Methods:

_create_list()

Inherited from PyoTableObject

_setViewFrame(frame)

_setGraphFrame(frame)

_get_current_data()

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])

replace(list)[source]

Redraw the waveform according to a new set of harmonics relative strengths.

Args
list: list of tuples

Each tuple contains the partial number, as a float, and its strength.

property list

list. List of partial numbers and strength.

SawTable

class SawTable(order=10, size=8192)[source]

Sawtooth waveform generator.

Generates sawtooth waveforms made up of fixed number of harmonics.

Parent

PyoTableObject

Args
order: int, optional

Number of harmonics sawtooth is made of. Defaults to 10.

size: int, optional

Table size in samples. Defaults to 8192.

>>> s = Server().boot()
>>> s.start()
>>> t = SawTable(order=12).normalize()
>>> a = Osc(table=t, freq=[199,200], mul=.2).out()

Public Methods:

__init__([order, size])

Initialize self.

setOrder(x)

Change the order attribute and redraw the waveform.

order

int.

Inherited from PyoTableObject

__init__([order, size])

Initialize self.

save(path[, format, sampletype, quality])

Writes the content of the table in an audio file.

write(path[, oneline])

Writes the content of the table in a text file.

read(path)

Reads the content of a text file and replaces the table data with the values stored in the file.

getBuffer([chnl])

Return a reference to the underlying object implementing the buffer protocol.

setSize(size)

Change the size of the table.

getSize([all])

Return table size in samples.

put(value[, pos])

Puts a value at specified sample position in the table.

get(pos)

Returns the value, as float, stored at a specific position in the table.

getTable([all])

Returns the content of the table as list of floats.

normalize([level])

Normalizes table samples to a given level.

reset()

Resets table samples to 0.0.

removeDC()

Filter out DC offset from the table’s data.

reverse()

Reverse the table’s data in time.

invert()

Reverse the table’s data in amplitude.

rectify()

Positive rectification of the table’s data.

pow([exp])

Apply a power function on each sample in the table.

bipolarGain([gpos, gneg])

Apply different gain factor for positive and negative samples.

lowpass([freq])

Apply a one-pole lowpass filter on table’s samples.

fadein([dur, shape])

Apply a gradual increase in the level of the table’s samples.

fadeout([dur, shape])

Apply a gradual decrease in the level of the table’s samples.

add(x)

Performs addition on the table values.

sub(x)

Performs substraction on the table values.

mul(x)

Performs multiplication on the table values.

div(x)

Performs division on the table values.

copyData(table[, srcpos, destpos, length])

Copy samples from a source table.

rotate(pos)

Rotate the table content to the left around the position given as argument.

copy()

Returns a deep copy of the object.

view([title, wxnoserver])

Opens a window showing the contents of the table.

refreshView()

Updates the graphical display of the table, if applicable.

size

int.

Inherited from PyoObjectBase

__init__([order, size])

Initialize self.

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Methods:

Inherited from PyoTableObject

_setViewFrame(frame)

_setGraphFrame(frame)

_get_current_data()

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])

setOrder(x)[source]

Change the order attribute and redraw the waveform.

Args
x: int

New number of harmonics

property order

int. Number of harmonics sawtooth is made of.

SincTable

class SincTable(freq=6.283185307179586, windowed=False, size=8192)[source]

Generates sinc window function.

Parent

PyoTableObject

Args
freq: float, optional

Frequency, in radians, of the sinc function. Defaults to pi*2.

windowed: boolean, optional

If True, an hanning window is applied on the sinc function. Defaults to False.

size: int, optional

Table size in samples. Defaults to 8192.

>>> import math
>>> s = Server().boot()
>>> s.start()
>>> t = SincTable(freq=math.pi*6, windowed=True)
>>> a = Osc(t, freq=[199,200], mul=.2).out()

Public Methods:

__init__([freq, windowed, size])

Initialize self.

setFreq(x)

Change the frequency of the sinc function.

setWindowed(x)

Change the windowed flag.

freq

float.

windowed

boolean.

Inherited from PyoTableObject

__init__([freq, windowed, size])

Initialize self.

save(path[, format, sampletype, quality])

Writes the content of the table in an audio file.

write(path[, oneline])

Writes the content of the table in a text file.

read(path)

Reads the content of a text file and replaces the table data with the values stored in the file.

getBuffer([chnl])

Return a reference to the underlying object implementing the buffer protocol.

setSize(size)

Change the size of the table.

getSize([all])

Return table size in samples.

put(value[, pos])

Puts a value at specified sample position in the table.

get(pos)

Returns the value, as float, stored at a specific position in the table.

getTable([all])

Returns the content of the table as list of floats.

normalize([level])

Normalizes table samples to a given level.

reset()

Resets table samples to 0.0.

removeDC()

Filter out DC offset from the table’s data.

reverse()

Reverse the table’s data in time.

invert()

Reverse the table’s data in amplitude.

rectify()

Positive rectification of the table’s data.

pow([exp])

Apply a power function on each sample in the table.

bipolarGain([gpos, gneg])

Apply different gain factor for positive and negative samples.

lowpass([freq])

Apply a one-pole lowpass filter on table’s samples.

fadein([dur, shape])

Apply a gradual increase in the level of the table’s samples.

fadeout([dur, shape])

Apply a gradual decrease in the level of the table’s samples.

add(x)

Performs addition on the table values.

sub(x)

Performs substraction on the table values.

mul(x)

Performs multiplication on the table values.

div(x)

Performs division on the table values.

copyData(table[, srcpos, destpos, length])

Copy samples from a source table.

rotate(pos)

Rotate the table content to the left around the position given as argument.

copy()

Returns a deep copy of the object.

view([title, wxnoserver])

Opens a window showing the contents of the table.

refreshView()

Updates the graphical display of the table, if applicable.

size

int.

Inherited from PyoObjectBase

__init__([freq, windowed, size])

Initialize self.

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Methods:

Inherited from PyoTableObject

_setViewFrame(frame)

_setGraphFrame(frame)

_get_current_data()

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])

setFreq(x)[source]

Change the frequency of the sinc function. This will redraw the envelope.

Args
x: float

New frequency in radians.

setWindowed(x)[source]

Change the windowed flag. This will redraw the envelope.

Args
x: boolean

New windowed flag.

property freq

float. Frequency of the sinc function.

property windowed

boolean. Windowed flag.

SndTable

class SndTable(path=None, chnl=None, start=0, stop=None, initchnls=1)[source]

Transfers data from a soundfile into a function table.

If chnl is None, the table will contain as many table streams as necessary to read all channels of the loaded sound.

Parent

PyoTableObject

Args
path: string, optional

Full path name of the sound. The defaults, None, creates an empty table.

chnl: int, optional

Channel number to read in. The count starts at 0 (first channel is is 0, second is 1 and so on). Available at initialization time only. The default (None) reads all channels.

start: float, optional

Begins reading at start seconds into the file. Available at initialization time only. Defaults to 0.

stop: float, optional

Stops reading at stop seconds into the file. Available at initialization time only. The default (None) means the end of the file.

initchnls: int, optional

Number of channels for an empty table (path=None). Defaults to 1.

>>> s = Server().boot()
>>> s.start()
>>> snd_path = SNDS_PATH + '/transparent.aif'
>>> t = SndTable(snd_path)
>>> freq = t.getRate()
>>> a = Osc(table=t, freq=[freq, freq*.995], mul=.3).out()

Public Methods:

__init__([path, chnl, start, stop, initchnls])

Initialize self.

setSound(path[, start, stop])

Load a new sound in the table.

append(path[, crossfade, start, stop])

Append a sound to the one already in the table with crossfade.

insert(path[, pos, crossfade, start, stop])

Insert a sound into the one already in the table with crossfade.

getRate([all])

Return the frequency in cps at which the sound will be read at its original pitch.

getDur([all])

Return the duration of the sound in seconds.

setSize(x)

Change the size of the table.

getSize([all])

Return the size of the table in samples.

getViewTable(size[, begin, end])

Return a list of points (in X, Y pixel values) for each channel in the table.

getEnvelope(points)

Return the amplitude envelope of the table.

view([title, wxnoserver, mouse_callback])

Opens a window showing the contents of the table.

refreshView()

Updates the graphical display of the table, if applicable.

sound

string.

path

string.

chnl

int.

start

float.

stop

float.

size

int.

Inherited from PyoTableObject

__init__([path, chnl, start, stop, initchnls])

Initialize self.

save(path[, format, sampletype, quality])

Writes the content of the table in an audio file.

write(path[, oneline])

Writes the content of the table in a text file.

read(path)

Reads the content of a text file and replaces the table data with the values stored in the file.

getBuffer([chnl])

Return a reference to the underlying object implementing the buffer protocol.

setSize(x)

Change the size of the table.

getSize([all])

Return the size of the table in samples.

put(value[, pos])

Puts a value at specified sample position in the table.

get(pos)

Returns the value, as float, stored at a specific position in the table.

getTable([all])

Returns the content of the table as list of floats.

normalize([level])

Normalizes table samples to a given level.

reset()

Resets table samples to 0.0.

removeDC()

Filter out DC offset from the table’s data.

reverse()

Reverse the table’s data in time.

invert()

Reverse the table’s data in amplitude.

rectify()

Positive rectification of the table’s data.

pow([exp])

Apply a power function on each sample in the table.

bipolarGain([gpos, gneg])

Apply different gain factor for positive and negative samples.

lowpass([freq])

Apply a one-pole lowpass filter on table’s samples.

fadein([dur, shape])

Apply a gradual increase in the level of the table’s samples.

fadeout([dur, shape])

Apply a gradual decrease in the level of the table’s samples.

add(x)

Performs addition on the table values.

sub(x)

Performs substraction on the table values.

mul(x)

Performs multiplication on the table values.

div(x)

Performs division on the table values.

copyData(table[, srcpos, destpos, length])

Copy samples from a source table.

rotate(pos)

Rotate the table content to the left around the position given as argument.

copy()

Returns a deep copy of the object.

view([title, wxnoserver, mouse_callback])

Opens a window showing the contents of the table.

refreshView()

Updates the graphical display of the table, if applicable.

size

int.

Inherited from PyoObjectBase

__init__([path, chnl, start, stop, initchnls])

Initialize self.

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Methods:

_resetView()

Inherited from PyoTableObject

_setViewFrame(frame)

_setGraphFrame(frame)

_get_current_data()

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])

setSound(path, start=0, stop=None)[source]

Load a new sound in the table.

Keeps the number of channels of the sound loaded at initialization. If the new sound has less channels, it will wrap around and load the same channels many times. If the new sound has more channels, the extra channels will be skipped.

Args
path: string

Full path of the new sound.

start: float, optional

Begins reading at start seconds into the file. Defaults to 0.

stop: float, optional

Stops reading at stop seconds into the file. The default (None) means the end of the file.

append(path, crossfade=0, start=0, stop=None)[source]

Append a sound to the one already in the table with crossfade.

Keeps the number of channels of the sound loaded at initialization. If the new sound has less channels, it will wrap around and load the same channels many times. If the new sound has more channels, the extra channels will be skipped.

Args
path: string

Full path of the new sound.

crossfade: float, optional

Crossfade time, in seconds, between the sound already in the table and the new one. Defaults to 0.

start: float, optional

Begins reading at start seconds into the file. Defaults to 0.

stop: float, optional

Stops reading at stop seconds into the file. The default, None, means the end of the file.

insert(path, pos=0, crossfade=0, start=0, stop=None)[source]

Insert a sound into the one already in the table with crossfade.

Insert a sound at position pos, specified in seconds, with crossfading at the beginning and the end of the insertion.

Keeps the number of channels of the sound loaded at initialization. If the new sound has less channels, it will wrap around and load the same channels many times. If the new sound has more channels, the extra channels will be skipped.

Args
path: string

Full path of the new sound.

pos: float, optional

Position in the table, in seconds, where to insert the new sound. Defaults to 0.

crossfade: float, optional

Crossfade time, in seconds, between the sound already in the table and the new one. Defaults to 0.

start: float, optional

Begins reading at start seconds into the file. Defaults to 0.

stop: float, optional

Stops reading at stop seconds into the file. The default, None, means the end of the file.

getRate(all=True)[source]

Return the frequency in cps at which the sound will be read at its original pitch.

Args
all: boolean

If the table contains more than one sound and all is True, returns a list of all durations. Otherwise, returns only the first duration as a float.

getDur(all=True)[source]

Return the duration of the sound in seconds.

Args
all: boolean

If the table contains more than one sound and all is True, returns a list of all durations. Otherwise, returns only the first duration as a float.

setSize(x)[source]

Change the size of the table.

This will erase the previously drawn waveform.

Args
size: int

New table size in samples.

getSize(all=True)[source]

Return the size of the table in samples.

Args
all: boolean

If the table contains more than one sound and all is True, returns a list of all sizes. Otherwise, returns only the first size as an int.

getViewTable(size, begin=0, end=0)[source]

Return a list of points (in X, Y pixel values) for each channel in the table. These lists can be draw on a DC (WxPython) with a DrawLines method.

Args
size: tuple

Size, (X, Y) pixel values, of the waveform container window.

begin: float, optional

First position in the the table, in seconds, where to get samples. Defaults to 0.

end: float, optional

Last position in the table, in seconds, where to get samples.

if this value is set to 0, that means the end of the table. Defaults to 0.

getEnvelope(points)[source]

Return the amplitude envelope of the table.

Return a list, of length chnl, of lists of length points filled with the amplitude envelope of the table.

Args
points: int

Number of points of the amplitude analysis.

view(title='Sound waveform', wxnoserver=False, mouse_callback=None)[source]

Opens a window showing the contents of the table.

Args
title: string, optional

Window title. Defaults to “Table waveform”.

wxnoserver: boolean, optional

With wxPython graphical toolkit, if True, tells the interpreter that there will be no server window.

mouse_callback: callable

If provided, this function will be called with the mouse position, inside the frame, as argument. Defaults to None.

If wxnoserver is set to True, the interpreter will not wait for the server GUI before showing the controller window.

refreshView()[source]

Updates the graphical display of the table, if applicable.

property sound

string. Full path of the sound.

property path

string. Full path of the sound.

property chnl

int. Channel to read in.

property start

float. Start point, in seconds, to read into the file.

property stop

float. Stop point, in seconds, to read into the file.

property size

int. Table size in samples.

SquareTable

class SquareTable(order=10, size=8192)[source]

Square waveform generator.

Generates square waveforms made up of fixed number of harmonics.

Parent

PyoTableObject

Args
order: int, optional

Number of harmonics square waveform is made of. The waveform will contains order odd harmonics. Defaults to 10.

size: int, optional

Table size in samples. Defaults to 8192.

>>> s = Server().boot()
>>> s.start()
>>> t = SquareTable(order=15).normalize()
>>> a = Osc(table=t, freq=[199,200], mul=.2).out()

Public Methods:

__init__([order, size])

Initialize self.

setOrder(x)

Change the order attribute and redraw the waveform.

order

int.

Inherited from PyoTableObject

__init__([order, size])

Initialize self.

save(path[, format, sampletype, quality])

Writes the content of the table in an audio file.

write(path[, oneline])

Writes the content of the table in a text file.

read(path)

Reads the content of a text file and replaces the table data with the values stored in the file.

getBuffer([chnl])

Return a reference to the underlying object implementing the buffer protocol.

setSize(size)

Change the size of the table.

getSize([all])

Return table size in samples.

put(value[, pos])

Puts a value at specified sample position in the table.

get(pos)

Returns the value, as float, stored at a specific position in the table.

getTable([all])

Returns the content of the table as list of floats.

normalize([level])

Normalizes table samples to a given level.

reset()

Resets table samples to 0.0.

removeDC()

Filter out DC offset from the table’s data.

reverse()

Reverse the table’s data in time.

invert()

Reverse the table’s data in amplitude.

rectify()

Positive rectification of the table’s data.

pow([exp])

Apply a power function on each sample in the table.

bipolarGain([gpos, gneg])

Apply different gain factor for positive and negative samples.

lowpass([freq])

Apply a one-pole lowpass filter on table’s samples.

fadein([dur, shape])

Apply a gradual increase in the level of the table’s samples.

fadeout([dur, shape])

Apply a gradual decrease in the level of the table’s samples.

add(x)

Performs addition on the table values.

sub(x)

Performs substraction on the table values.

mul(x)

Performs multiplication on the table values.

div(x)

Performs division on the table values.

copyData(table[, srcpos, destpos, length])

Copy samples from a source table.

rotate(pos)

Rotate the table content to the left around the position given as argument.

copy()

Returns a deep copy of the object.

view([title, wxnoserver])

Opens a window showing the contents of the table.

refreshView()

Updates the graphical display of the table, if applicable.

size

int.

Inherited from PyoObjectBase

__init__([order, size])

Initialize self.

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Methods:

Inherited from PyoTableObject

_setViewFrame(frame)

_setGraphFrame(frame)

_get_current_data()

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])

setOrder(x)[source]

Change the order attribute and redraw the waveform.

Args
x: int

New number of harmonics

property order

int. Number of harmonics square waveform is made of.

TriangleTable

class TriangleTable(order=10, size=8192)[source]

Triangle waveform generator.

Generates triangle waveforms made up of fixed number of harmonics.

Parent

PyoTableObject

Args
order: int, optional

Number of harmonics triangle waveform is made of. The waveform will contains order odd harmonics. Defaults to 10.

size: int, optional

Table size in samples. Defaults to 8192.

>>> s = Server().boot()
>>> s.start()
>>> t = TriangleTable(order=15).normalize()
>>> a = Osc(table=t, freq=[199,200], mul=.2).out()

Public Methods:

__init__([order, size])

Initialize self.

setOrder(x)

Change the order attribute and redraw the waveform.

order

int.

Inherited from PyoTableObject

__init__([order, size])

Initialize self.

save(path[, format, sampletype, quality])

Writes the content of the table in an audio file.

write(path[, oneline])

Writes the content of the table in a text file.

read(path)

Reads the content of a text file and replaces the table data with the values stored in the file.

getBuffer([chnl])

Return a reference to the underlying object implementing the buffer protocol.

setSize(size)

Change the size of the table.

getSize([all])

Return table size in samples.

put(value[, pos])

Puts a value at specified sample position in the table.

get(pos)

Returns the value, as float, stored at a specific position in the table.

getTable([all])

Returns the content of the table as list of floats.

normalize([level])

Normalizes table samples to a given level.

reset()

Resets table samples to 0.0.

removeDC()

Filter out DC offset from the table’s data.

reverse()

Reverse the table’s data in time.

invert()

Reverse the table’s data in amplitude.

rectify()

Positive rectification of the table’s data.

pow([exp])

Apply a power function on each sample in the table.

bipolarGain([gpos, gneg])

Apply different gain factor for positive and negative samples.

lowpass([freq])

Apply a one-pole lowpass filter on table’s samples.

fadein([dur, shape])

Apply a gradual increase in the level of the table’s samples.

fadeout([dur, shape])

Apply a gradual decrease in the level of the table’s samples.

add(x)

Performs addition on the table values.

sub(x)

Performs substraction on the table values.

mul(x)

Performs multiplication on the table values.

div(x)

Performs division on the table values.

copyData(table[, srcpos, destpos, length])

Copy samples from a source table.

rotate(pos)

Rotate the table content to the left around the position given as argument.

copy()

Returns a deep copy of the object.

view([title, wxnoserver])

Opens a window showing the contents of the table.

refreshView()

Updates the graphical display of the table, if applicable.

size

int.

Inherited from PyoObjectBase

__init__([order, size])

Initialize self.

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Methods:

Inherited from PyoTableObject

_setViewFrame(frame)

_setGraphFrame(frame)

_get_current_data()

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])

setOrder(x)[source]

Change the order attribute and redraw the waveform.

Args
x: int

New number of harmonics

property order

int. Number of harmonics triangle waveform is made of.

WinTable

class WinTable(type=2, size=8192)[source]

Generates different kind of windowing functions.

Parent

PyoTableObject

Args
type: int, optional
Windowing function. Possible choices are:
  1. Rectangular (no window)

  2. Hamming

  3. Hanning (default)

  4. Bartlett (triangular)

  5. Blackman 3-term

  6. Blackman-Harris 4-term

  7. Blackman-Harris 7-term

  8. Tuckey (alpha = 0.66)

  9. Sine (half-sine window)

size: int, optional

Table size in samples. Defaults to 8192.

>>> s = Server().boot()
>>> s.start()
>>> # Triangular envelope
>>> t = WinTable(type=3)
>>> a = Osc(table=t, freq=2, mul=.2)
>>> b = SineLoop(freq=[199,200], feedback=0.05, mul=a).out()

Public Methods:

__init__([type, size])

Initialize self.

setType(type)

Sets the windowing function.

type

int.

Inherited from PyoTableObject

__init__([type, size])

Initialize self.

save(path[, format, sampletype, quality])

Writes the content of the table in an audio file.

write(path[, oneline])

Writes the content of the table in a text file.

read(path)

Reads the content of a text file and replaces the table data with the values stored in the file.

getBuffer([chnl])

Return a reference to the underlying object implementing the buffer protocol.

setSize(size)

Change the size of the table.

getSize([all])

Return table size in samples.

put(value[, pos])

Puts a value at specified sample position in the table.

get(pos)

Returns the value, as float, stored at a specific position in the table.

getTable([all])

Returns the content of the table as list of floats.

normalize([level])

Normalizes table samples to a given level.

reset()

Resets table samples to 0.0.

removeDC()

Filter out DC offset from the table’s data.

reverse()

Reverse the table’s data in time.

invert()

Reverse the table’s data in amplitude.

rectify()

Positive rectification of the table’s data.

pow([exp])

Apply a power function on each sample in the table.

bipolarGain([gpos, gneg])

Apply different gain factor for positive and negative samples.

lowpass([freq])

Apply a one-pole lowpass filter on table’s samples.

fadein([dur, shape])

Apply a gradual increase in the level of the table’s samples.

fadeout([dur, shape])

Apply a gradual decrease in the level of the table’s samples.

add(x)

Performs addition on the table values.

sub(x)

Performs substraction on the table values.

mul(x)

Performs multiplication on the table values.

div(x)

Performs division on the table values.

copyData(table[, srcpos, destpos, length])

Copy samples from a source table.

rotate(pos)

Rotate the table content to the left around the position given as argument.

copy()

Returns a deep copy of the object.

view([title, wxnoserver])

Opens a window showing the contents of the table.

refreshView()

Updates the graphical display of the table, if applicable.

size

int.

Inherited from PyoObjectBase

__init__([type, size])

Initialize self.

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Methods:

Inherited from PyoTableObject

_setViewFrame(frame)

_setGraphFrame(frame)

_get_current_data()

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])

setType(type)[source]

Sets the windowing function.

Args
type: int {0 -> 8}

Windowing function.

property type

int. Windowing function.

AtanTable

class AtanTable(slope=0.5, size=8192)[source]

Generates an arctangent transfert function.

This table allow the creation of the classic arctangent transfert function, useful in distortion design. See Lookup object for a simple table lookup process.

Parent

PyoTableObject

Args
slope: float, optional

Slope of the arctangent function, between 0 and 1. Defaults to 0.5.

size: int, optional

Table size in samples. Defaults to 8192.

>>> import math
>>> s = Server().boot()
>>> s.start()
>>> t = AtanTable(slope=0.8)
>>> a = Sine(freq=[149,150])
>>> l = Lookup(table=t, index=a, mul=0.3).out()

Public Methods:

__init__([slope, size])

Initialize self.

setSlope(x)

Change the slope of the arctangent function.

slope

float.

Inherited from PyoTableObject

__init__([slope, size])

Initialize self.

save(path[, format, sampletype, quality])

Writes the content of the table in an audio file.

write(path[, oneline])

Writes the content of the table in a text file.

read(path)

Reads the content of a text file and replaces the table data with the values stored in the file.

getBuffer([chnl])

Return a reference to the underlying object implementing the buffer protocol.

setSize(size)

Change the size of the table.

getSize([all])

Return table size in samples.

put(value[, pos])

Puts a value at specified sample position in the table.

get(pos)

Returns the value, as float, stored at a specific position in the table.

getTable([all])

Returns the content of the table as list of floats.

normalize([level])

Normalizes table samples to a given level.

reset()

Resets table samples to 0.0.

removeDC()

Filter out DC offset from the table’s data.

reverse()

Reverse the table’s data in time.

invert()

Reverse the table’s data in amplitude.

rectify()

Positive rectification of the table’s data.

pow([exp])

Apply a power function on each sample in the table.

bipolarGain([gpos, gneg])

Apply different gain factor for positive and negative samples.

lowpass([freq])

Apply a one-pole lowpass filter on table’s samples.

fadein([dur, shape])

Apply a gradual increase in the level of the table’s samples.

fadeout([dur, shape])

Apply a gradual decrease in the level of the table’s samples.

add(x)

Performs addition on the table values.

sub(x)

Performs substraction on the table values.

mul(x)

Performs multiplication on the table values.

div(x)

Performs division on the table values.

copyData(table[, srcpos, destpos, length])

Copy samples from a source table.

rotate(pos)

Rotate the table content to the left around the position given as argument.

copy()

Returns a deep copy of the object.

view([title, wxnoserver])

Opens a window showing the contents of the table.

refreshView()

Updates the graphical display of the table, if applicable.

size

int.

Inherited from PyoObjectBase

__init__([slope, size])

Initialize self.

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Methods:

Inherited from PyoTableObject

_setViewFrame(frame)

_setGraphFrame(frame)

_get_current_data()

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])

setSlope(x)[source]

Change the slope of the arctangent function. This will redraw the table.

Args
x: float

New slope between 0 and 1.

property slope

float. slope of the arctangent function.

PadSynthTable

class PadSynthTable(basefreq=440, spread=1, bw=50, bwscl=1, nharms=64, damp=0.7, size=262144)[source]

Generates wavetable with the PadSynth algorithm from Nasca Octavian Paul.

This object generates a wavetable with the PadSynth algorithm describe here:

http://zynaddsubfx.sourceforge.net/doc/PADsynth/PADsynth.htm

This algorithm generates some large wavetables that can be played at different speeds to get the desired sound. This algorithm describes only how these wavetables are generated. The result is a perfectly looped wavetable.

To get the desired pitch from the table, the playback speed must be sr / table size. This speed can be transposed to obtain different pitches from a single wavetable.

Parent

PyoTableObject

Args
basefreq: float, optional

The base frequency of the algorithm in Hz. If the spreading factor is near 1.0, this frequency is the fundamental of the spectrum. Defaults to 440.

spread: float, optional

The spreading factor for the harmonics. Each harmonic real frequency is computed as basefreq * pow(n, spread) where n is the harmonic order. Defaults to 1.

bw: float, optional

The bandwidth of the first harmonic in cents. The bandwidth allows to control the harmonic profile using a gaussian distribution (bell shape). Defaults to 50.

bwscl: float, optional

The bandswidth scale specifies how much the bandwidth of the harmonic increase according to its frequency. Defaults to 1.

nharms: int, optional

The number of harmonics in the generated wavetable. Higher numbers of harmonics take more time to generate the wavetable. Defaults to 64.

damp: float, optional

The amplitude damping factor specifies how much the amplitude of the harmonic decrease according to its order. It uses a simple power serie, amp = pow(damp, n) where n is the harmonic order. Defaults to 0.7.

size: int, optional

Table size in samples. Must be a power-of-two, usually a big one! Defaults to 262144.

Note

Many thanks to Nasca Octavian Paul for making this beautiful algorithm and releasing it under Public Domain.

>>> s = Server().boot()
>>> s.start()
>>> f = s.getSamplingRate() / 262144
>>> t = PadSynthTable(basefreq=midiToHz(48), spread=1.205, bw=10, bwscl=1.5)
>>> a = Osc(table=t, freq=f, phase=[0, 0.5], mul=0.5).out()

Public Methods:

__init__([basefreq, spread, bw, bwscl, …])

Initialize self.

setBaseFreq(x[, generate])

Change the base frequency of the algorithm.

setSpread(x[, generate])

Change the frequency spreading factor of the algorithm.

setBw(x[, generate])

Change the bandwidth of the first harmonic.

setBwScl(x[, generate])

Change the bandwidth scaling factor.

setNharms(x[, generate])

Change the number of harmonics.

setDamp(x[, generate])

Change the amplitude damping factor.

setSize(size[, generate])

Change the size of the table.

basefreq

float.

spread

float.

bw

float.

bwscl

float.

nharms

int.

damp

float.

Inherited from PyoTableObject

__init__([basefreq, spread, bw, bwscl, …])

Initialize self.

save(path[, format, sampletype, quality])

Writes the content of the table in an audio file.

write(path[, oneline])

Writes the content of the table in a text file.

read(path)

Reads the content of a text file and replaces the table data with the values stored in the file.

getBuffer([chnl])

Return a reference to the underlying object implementing the buffer protocol.

setSize(size[, generate])

Change the size of the table.

getSize([all])

Return table size in samples.

put(value[, pos])

Puts a value at specified sample position in the table.

get(pos)

Returns the value, as float, stored at a specific position in the table.

getTable([all])

Returns the content of the table as list of floats.

normalize([level])

Normalizes table samples to a given level.

reset()

Resets table samples to 0.0.

removeDC()

Filter out DC offset from the table’s data.

reverse()

Reverse the table’s data in time.

invert()

Reverse the table’s data in amplitude.

rectify()

Positive rectification of the table’s data.

pow([exp])

Apply a power function on each sample in the table.

bipolarGain([gpos, gneg])

Apply different gain factor for positive and negative samples.

lowpass([freq])

Apply a one-pole lowpass filter on table’s samples.

fadein([dur, shape])

Apply a gradual increase in the level of the table’s samples.

fadeout([dur, shape])

Apply a gradual decrease in the level of the table’s samples.

add(x)

Performs addition on the table values.

sub(x)

Performs substraction on the table values.

mul(x)

Performs multiplication on the table values.

div(x)

Performs division on the table values.

copyData(table[, srcpos, destpos, length])

Copy samples from a source table.

rotate(pos)

Rotate the table content to the left around the position given as argument.

copy()

Returns a deep copy of the object.

view([title, wxnoserver])

Opens a window showing the contents of the table.

refreshView()

Updates the graphical display of the table, if applicable.

size

int.

Inherited from PyoObjectBase

__init__([basefreq, spread, bw, bwscl, …])

Initialize self.

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Methods:

Inherited from PyoTableObject

_setViewFrame(frame)

_setGraphFrame(frame)

_get_current_data()

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])

setBaseFreq(x, generate=True)[source]

Change the base frequency of the algorithm.

Args
x: float

New base frequency in Hz.

generate: boolean, optional

If True, a new table will be computed with changed value.

setSpread(x, generate=True)[source]

Change the frequency spreading factor of the algorithm.

Args
x: float

New spread factor.

generate: boolean, optional

If True, a new table will be computed with changed value.

setBw(x, generate=True)[source]

Change the bandwidth of the first harmonic.

Args
x: float

New bandwidth in cents.

generate: boolean, optional

If True, a new table will be computed with changed value.

setBwScl(x, generate=True)[source]

Change the bandwidth scaling factor.

Args
x: float

New bandwidth scaling factor.

generate: boolean, optional

If True, a new table will be computed with changed value.

setNharms(x, generate=True)[source]

Change the number of harmonics.

Args
x: int

New number of harmonics.

generate: boolean, optional

If True, a new table will be computed with changed value.

setDamp(x, generate=True)[source]

Change the amplitude damping factor.

Args
x: float

New amplitude damping factor.

generate: boolean, optional

If True, a new table will be computed with changed value.

setSize(size, generate=True)[source]

Change the size of the table.

This will erase the previously drawn waveform.

Args
size: int

New table size in samples. Must be a power-of-two.

generate: boolean, optional

If True, a new table will be computed with changed value.

property basefreq

float. Base frequency in Hz.

property spread

float. Frequency spreading factor.

property bw

float. Bandwitdh of the first harmonic in cents.

property bwscl

float. Bandwitdh scaling factor.

property nharms

int. Number of harmonics.

property damp

float. Amplitude damping factor.

SharedTable

class SharedTable(name, create, size)[source]

Create an inter-process shared memory table.

This table uses the given name to open an internal shared memory object, used as the data memory of the table. Two or more tables from different processes, if they use the same name, can read and write to the same memory space.

Note

SharedTable is not implemented yet for Windows (unix only).

Parent

PyoTableObject

Args
name: string

Unique name in the system shared memory. Two or more tables created with the same name will shared the same memory space. The name must conform to the construction rules for a unix pathname (ie. it must begin with a slash). Available at initialization time only.

create: boolean

If True, an entry will be create in the system shared memory. If False, the object will use an already created shared memory. Can’t be a list. Available at initialization time only.

size: int

Size of the table in samples. Can’t be a list. Available at initialization time only.

>>> s = Server().boot()
>>> s.start()
>>> # Creating parent table.
>>> table = SharedTable(["/sharedl", "/sharedr"], True, s.getBufferSize())
>>> # Creating child table.
>>> shared = SharedTable(["/sharedl", "/sharedr"], False, s.getBufferSize())
>>> # Read and output the content of the parent table.
>>> tabread = TableRead(table, table.getRate(), True).out()
>>> # Record some signal signal in the child table.
>>> lfo = Sine(freq=[0.2, 0.25]).range(98, 102)
>>> wave = LFO(freq=lfo, type=4, sharp=0.7, mul=0.3)
>>> pos = Phasor(shared.getRate())
>>> record = TableWrite(wave, pos, shared)

Public Methods:

__init__(name, create, size)

Initialize self.

getRate()

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

size

int.

Inherited from PyoTableObject

__init__(name, create, size)

Initialize self.

save(path[, format, sampletype, quality])

Writes the content of the table in an audio file.

write(path[, oneline])

Writes the content of the table in a text file.

read(path)

Reads the content of a text file and replaces the table data with the values stored in the file.

getBuffer([chnl])

Return a reference to the underlying object implementing the buffer protocol.

setSize(size)

Change the size of the table.

getSize([all])

Return table size in samples.

put(value[, pos])

Puts a value at specified sample position in the table.

get(pos)

Returns the value, as float, stored at a specific position in the table.

getTable([all])

Returns the content of the table as list of floats.

normalize([level])

Normalizes table samples to a given level.

reset()

Resets table samples to 0.0.

removeDC()

Filter out DC offset from the table’s data.

reverse()

Reverse the table’s data in time.

invert()

Reverse the table’s data in amplitude.

rectify()

Positive rectification of the table’s data.

pow([exp])

Apply a power function on each sample in the table.

bipolarGain([gpos, gneg])

Apply different gain factor for positive and negative samples.

lowpass([freq])

Apply a one-pole lowpass filter on table’s samples.

fadein([dur, shape])

Apply a gradual increase in the level of the table’s samples.

fadeout([dur, shape])

Apply a gradual decrease in the level of the table’s samples.

add(x)

Performs addition on the table values.

sub(x)

Performs substraction on the table values.

mul(x)

Performs multiplication on the table values.

div(x)

Performs division on the table values.

copyData(table[, srcpos, destpos, length])

Copy samples from a source table.

rotate(pos)

Rotate the table content to the left around the position given as argument.

copy()

Returns a deep copy of the object.

view([title, wxnoserver])

Opens a window showing the contents of the table.

refreshView()

Updates the graphical display of the table, if applicable.

size

int.

Inherited from PyoObjectBase

__init__(name, create, size)

Initialize self.

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Methods:

Inherited from PyoTableObject

_setViewFrame(frame)

_setGraphFrame(frame)

_get_current_data()

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])

getRate()[source]

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

property size

int. Length of the table in samples.