Tables¶
Tables are one-dimension containers to keep samples (sounds, envelopes, algorithmic patterns, etc.) in memory and access them quickly.
Objects in this category¶
ChebyTable
: Chebyshev polynomials of the first kind.CosLogTable
: Construct a table from logarithmic-cosine segments in breakpoint fashion.CosTable
: Construct a table from cosine interpolated segments.CurveTable
: Construct a table from curve interpolated segments.DataTable
: Create an empty table ready for data recording.ExpTable
: Construct a table from exponential interpolated segments.HannTable
: Generates Hanning window function.HarmTable
: Harmonic waveform generator.LinTable
: Construct a table from segments of straight lines in breakpoint fashion.LogTable
: Construct a table from logarithmic segments in breakpoint fashion.NewTable
: Create an empty table ready for recording.ParaTable
: Generates parabola window function.PartialTable
: Inharmonic waveform generator.SawTable
: Sawtooth waveform generator.SincTable
: Generates sinc window function.SndTable
: Transfers data from a soundfile into a function table.SquareTable
: Square waveform generator.TriangleTable
: Triangle waveform generator.WinTable
: Generates different kind of windowing functions.AtanTable
: Generates an arctangent transfert function.PadSynthTable
: Generates wavetable with the PadSynth algorithm from Nasca Octavian Paul.SharedTable
: Create an inter-process shared memory table.
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
- 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.
Public Methods:
__init__
([list, size])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.
Inherited from
PyoTableObject
__init__
([size])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.
getRate
([all])Return the frequency in cps at which the table will be read at its original pitch.
getDur
([all])Return the duration of the table in seconds.
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.
Inherited from
PyoObjectBase
__init__
()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 Data Attributes:
Inherited from
PyoTableObject
_STREAM_TYPE
Inherited from
PyoObjectBase
_STREAM_TYPE
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
- 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.
Public Methods:
__init__
([list, size])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.
Inherited from
PyoTableObject
__init__
([size])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.
getRate
([all])Return the frequency in cps at which the table will be read at its original pitch.
getDur
([all])Return the duration of the table in seconds.
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.
Inherited from
PyoObjectBase
__init__
()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 Data Attributes:
Inherited from
PyoTableObject
_STREAM_TYPE
Inherited from
PyoObjectBase
_STREAM_TYPE
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.
- 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
- 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.
Public Methods:
__init__
([list, size])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.
Inherited from
PyoTableObject
__init__
([size])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.
getRate
([all])Return the frequency in cps at which the table will be read at its original pitch.
getDur
([all])Return the duration of the table in seconds.
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.
Inherited from
PyoObjectBase
__init__
()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 Data Attributes:
Inherited from
PyoTableObject
_STREAM_TYPE
Inherited from
PyoObjectBase
_STREAM_TYPE
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.
- 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
- 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.
Public Methods:
__init__
([list, tension, bias, size])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.
Inherited from
PyoTableObject
__init__
([size])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.
getRate
([all])Return the frequency in cps at which the table will be read at its original pitch.
getDur
([all])Return the duration of the table in seconds.
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.
Inherited from
PyoObjectBase
__init__
()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 Data Attributes:
Inherited from
PyoTableObject
_STREAM_TYPE
Inherited from
PyoObjectBase
_STREAM_TYPE
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.
- 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
- 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.
Public Methods:
__init__
(size[, chnls, init])replace
(x)Replaces the actual table.
graph
([yrange, title, wxnoserver])Opens a multislider window to control the data values.
Inherited from
PyoTableObject
__init__
([size])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.
getRate
([all])Return the frequency in cps at which the table will be read at its original pitch.
getDur
([all])Return the duration of the table in seconds.
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.
Inherited from
PyoObjectBase
__init__
()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 Data Attributes:
Inherited from
PyoTableObject
_STREAM_TYPE
Inherited from
PyoObjectBase
_STREAM_TYPE
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.
- 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
- 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.
Public Methods:
__init__
([list, exp, inverse, size])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.
Inherited from
PyoTableObject
__init__
([size])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.
getRate
([all])Return the frequency in cps at which the table will be read at its original pitch.
getDur
([all])Return the duration of the table in seconds.
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.
Inherited from
PyoObjectBase
__init__
()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 Data Attributes:
Inherited from
PyoTableObject
_STREAM_TYPE
Inherited from
PyoObjectBase
_STREAM_TYPE
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.
- 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
- Args
- size: int, optional
Table size in samples. Defaults to 8192.
Public Data Attributes:
Inherited from
PyoTableObject
size
int.
Public Methods:
__init__
([size])Inherited from
PyoTableObject
__init__
([size])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.
getRate
([all])Return the frequency in cps at which the table will be read at its original pitch.
getDur
([all])Return the duration of the table in seconds.
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.
Inherited from
PyoObjectBase
__init__
()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 Data Attributes:
Inherited from
PyoTableObject
_STREAM_TYPE
Inherited from
PyoObjectBase
_STREAM_TYPE
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
- 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.
Public Methods:
__init__
([list, size])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.
Inherited from
PyoTableObject
__init__
([size])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.
getRate
([all])Return the frequency in cps at which the table will be read at its original pitch.
getDur
([all])Return the duration of the table in seconds.
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.
Inherited from
PyoObjectBase
__init__
()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 Data Attributes:
Inherited from
PyoTableObject
_STREAM_TYPE
Inherited from
PyoObjectBase
_STREAM_TYPE
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
- 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.
Public Methods:
__init__
([list, size])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.
Inherited from
PyoTableObject
__init__
([size])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.
getRate
([all])Return the frequency in cps at which the table will be read at its original pitch.
getDur
([all])Return the duration of the table in seconds.
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.
Inherited from
PyoObjectBase
__init__
()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 Data Attributes:
Inherited from
PyoTableObject
_STREAM_TYPE
Inherited from
PyoObjectBase
_STREAM_TYPE
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.
- 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
- 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.
Public Methods:
__init__
([list, size])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.
Inherited from
PyoTableObject
__init__
([size])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.
getRate
([all])Return the frequency in cps at which the table will be read at its original pitch.
getDur
([all])Return the duration of the table in seconds.
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.
Inherited from
PyoObjectBase
__init__
()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 Data Attributes:
Inherited from
PyoTableObject
_STREAM_TYPE
Inherited from
PyoObjectBase
_STREAM_TYPE
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.
- 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
- 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.
Public Methods:
__init__
(length[, chnls, init, feedback])replace
(x)Replaces the actual table.
setFeedback
(x)Replaces the`feedback` attribute.
setLength
(length)Change the length of the table.
getFeedback
()Returns the current feedback value.
getLength
()Returns the length of the table in seconds.
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.
Inherited from
PyoTableObject
__init__
([size])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.
getRate
([all])Return the frequency in cps at which the table will be read at its original pitch.
getDur
([all])Return the duration of the table in seconds.
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.
Inherited from
PyoObjectBase
__init__
()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 Data Attributes:
Inherited from
PyoTableObject
_STREAM_TYPE
Inherited from
PyoObjectBase
_STREAM_TYPE
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.
- setLength(length)[source]¶
Change the length of the table.
If the new length is longer than the current one, new samples will be initialized to 0.
- Args
- length: float
New table length in seconds.
- 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.
- 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
- Args
- size: int, optional
Table size in samples. Defaults to 8192.
Public Data Attributes:
Inherited from
PyoTableObject
size
int.
Public Methods:
__init__
([size])Inherited from
PyoTableObject
__init__
([size])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.
getRate
([all])Return the frequency in cps at which the table will be read at its original pitch.
getDur
([all])Return the duration of the table in seconds.
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.
Inherited from
PyoObjectBase
__init__
()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 Data Attributes:
Inherited from
PyoTableObject
_STREAM_TYPE
Inherited from
PyoObjectBase
_STREAM_TYPE
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
- 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])replace
(list)Redraw the waveform according to a new set of harmonics relative strengths.
Inherited from
PyoTableObject
__init__
([size])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.
getRate
([all])Return the frequency in cps at which the table will be read at its original pitch.
getDur
([all])Return the duration of the table in seconds.
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.
Inherited from
PyoObjectBase
__init__
()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 Data Attributes:
Inherited from
PyoTableObject
_STREAM_TYPE
Inherited from
PyoObjectBase
_STREAM_TYPE
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
- Args
- order: int, optional
Number of harmonics sawtooth is made of. Defaults to 10.
- size: int, optional
Table size in samples. Defaults to 8192.
Public Methods:
__init__
([order, size])setOrder
(x)Change the order attribute and redraw the waveform.
Inherited from
PyoTableObject
__init__
([size])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.
getRate
([all])Return the frequency in cps at which the table will be read at its original pitch.
getDur
([all])Return the duration of the table in seconds.
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.
Inherited from
PyoObjectBase
__init__
()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 Data Attributes:
Inherited from
PyoTableObject
_STREAM_TYPE
Inherited from
PyoObjectBase
_STREAM_TYPE
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
- 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.
Public Methods:
__init__
([freq, windowed, size])setFreq
(x)Change the frequency of the sinc function.
setWindowed
(x)Change the windowed flag.
Inherited from
PyoTableObject
__init__
([size])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.
getRate
([all])Return the frequency in cps at which the table will be read at its original pitch.
getDur
([all])Return the duration of the table in seconds.
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.
Inherited from
PyoObjectBase
__init__
()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 Data Attributes:
Inherited from
PyoTableObject
_STREAM_TYPE
Inherited from
PyoObjectBase
_STREAM_TYPE
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
- 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.
Public Methods:
__init__
([path, chnl, start, stop, initchnls])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.
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.
Inherited from
PyoTableObject
__init__
([size])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.
getRate
([all])Return the frequency in cps at which the table will be read at its original pitch.
getDur
([all])Return the duration of the table in seconds.
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.
Inherited from
PyoObjectBase
__init__
()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 Data Attributes:
Inherited from
PyoTableObject
_STREAM_TYPE
Inherited from
PyoObjectBase
_STREAM_TYPE
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.
- 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.
- 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
- 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])setOrder
(x)Change the order attribute and redraw the waveform.
Inherited from
PyoTableObject
__init__
([size])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.
getRate
([all])Return the frequency in cps at which the table will be read at its original pitch.
getDur
([all])Return the duration of the table in seconds.
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.
Inherited from
PyoObjectBase
__init__
()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 Data Attributes:
Inherited from
PyoTableObject
_STREAM_TYPE
Inherited from
PyoObjectBase
_STREAM_TYPE
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
- 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])setOrder
(x)Change the order attribute and redraw the waveform.
Inherited from
PyoTableObject
__init__
([size])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.
getRate
([all])Return the frequency in cps at which the table will be read at its original pitch.
getDur
([all])Return the duration of the table in seconds.
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.
Inherited from
PyoObjectBase
__init__
()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 Data Attributes:
Inherited from
PyoTableObject
_STREAM_TYPE
Inherited from
PyoObjectBase
_STREAM_TYPE
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
- Args
- type: int, optional
- Windowing function. Possible choices are:
Rectangular (no window)
Hamming
Hanning (default)
Bartlett (triangular)
Blackman 3-term
Blackman-Harris 4-term
Blackman-Harris 7-term
Tuckey (alpha = 0.66)
Sine (half-sine window)
- size: int, optional
Table size in samples. Defaults to 8192.
Public Methods:
__init__
([type, size])setType
(type)Sets the windowing function.
Inherited from
PyoTableObject
__init__
([size])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.
getRate
([all])Return the frequency in cps at which the table will be read at its original pitch.
getDur
([all])Return the duration of the table in seconds.
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.
Inherited from
PyoObjectBase
__init__
()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 Data Attributes:
Inherited from
PyoTableObject
_STREAM_TYPE
Inherited from
PyoObjectBase
_STREAM_TYPE
Private Methods:
Inherited from
PyoTableObject
_setViewFrame
(frame)_setGraphFrame
(frame)_get_current_data
()Inherited from
PyoObjectBase
_autoplay
([dur, delay])_autostop
([wait])
- 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
- 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.
Public Methods:
__init__
([slope, size])setSlope
(x)Change the slope of the arctangent function.
Inherited from
PyoTableObject
__init__
([size])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.
getRate
([all])Return the frequency in cps at which the table will be read at its original pitch.
getDur
([all])Return the duration of the table in seconds.
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.
Inherited from
PyoObjectBase
__init__
()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 Data Attributes:
Inherited from
PyoTableObject
_STREAM_TYPE
Inherited from
PyoObjectBase
_STREAM_TYPE
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
- 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.
Public Data Attributes:
float.
float.
float.
float.
int.
float.
Inherited from
PyoTableObject
size
int.
Public Methods:
__init__
([basefreq, spread, bw, bwscl, ...])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.
Inherited from
PyoTableObject
__init__
([size])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.
getRate
([all])Return the frequency in cps at which the table will be read at its original pitch.
getDur
([all])Return the duration of the table in seconds.
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.
Inherited from
PyoObjectBase
__init__
()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 Data Attributes:
Inherited from
PyoTableObject
_STREAM_TYPE
Inherited from
PyoObjectBase
_STREAM_TYPE
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.