Control Signals¶
Objects designed to create parameter’s control at audio rate.
These objects can be used to create envelopes, line segments and conversion from python number to audio signal.
The audio streams of these objects can’t be sent to the output soundcard.
Objects in this category¶
Fader
: Fadein - fadeout envelope generator.Adsr
: Attack - Decay - Sustain - Release envelope generator.Linseg
: Draw a series of line segments between specified break-points.Expseg
: Draw a series of exponential segments between specified break-points.Sig
: Convert numeric value to PyoObject signal.SigTo
: Convert numeric value to PyoObject signal with portamento.
Fader¶
- class Fader(fadein=0.01, fadeout=0.1, dur=0, mul=1, add=0)[source]¶
Fadein - fadeout envelope generator.
Generate an amplitude envelope between 0 and 1 with control on fade times and total duration of the envelope.
The play() method starts the envelope and is not called at the object creation time.
- Parent
- Args
- fadein: float, optional
Rising time of the envelope in seconds. Defaults to 0.01.
- fadeout: float, optional
Falling time of the envelope in seconds. Defaults to 0.1.
- dur: float, optional
Total duration of the envelope in seocnds. Defaults to 0, which means wait for the stop() method to start the fadeout.
Note
The out() method is bypassed. Fader’s signal can not be sent to audio outs.
The play() method starts the envelope.
The stop() method calls the envelope’s release phase if dur = 0.
As of version 0.8.0, exponential or logarithmic envelopes can be created with the exponent factor (see setExp() method).
As of version 0.9.2, Fader will send a trigger signal at the end of the playback. User can retreive the trigger streams by calling obj[‘trig’]. Useful to synchronize other processes.
Public Data Attributes:
float.
float.
float.
float.
Inherited from
PyoObject
mul
float or PyoObject.
add
float or PyoObject.
Public Methods:
__init__
([fadein, fadeout, dur, mul, add])out
([chnl, inc, dur, delay])Start processing and send samples to audio output beginning at chnl.
stop
([wait])Stop processing.
setFadein
(x)Replace the fadein attribute.
setFadeout
(x)Replace the fadeout attribute.
setDur
(x)Replace the dur attribute.
setExp
(x)Sets an exponent factor to create exponential or logarithmic envelope.
ctrl
([map_list, title, wxnoserver])Opens a sliders window to control the parameters of the object.
Inherited from
PyoObject
__init__
([mul, add])__add__
(x)__radd__
(x)__iadd__
(x)__sub__
(x)__rsub__
(x)__isub__
(x)__mul__
(x)__rmul__
(x)__imul__
(x)__truediv__
(x)__rtruediv__
(x)__itruediv__
(x)__div__
(x)__rdiv__
(x)__idiv__
(x)__pow__
(x)__rpow__
(x)__mod__
(x)__neg__
()__lt__
(x)Return self<value.
__le__
(x)Return self<=value.
__eq__
(x)Return self==value.
__ne__
(x)Return self!=value.
__gt__
(x)Return self>value.
__ge__
(x)Return self>=value.
__do_comp__
(comp, mode[, default])isPlaying
([all])Returns True if the object is currently playing, otherwise, returns False.
isOutputting
([all])Returns True if the object is outputting.
get
([all])Return the first sample of the current buffer as a float.
play
([dur, delay])Start processing without sending samples to output.
out
([chnl, inc, dur, delay])Start processing and send samples to audio output beginning at chnl.
stop
([wait])Stop processing.
mix
([voices])Mix the object's audio streams into voices streams and return a Mix object.
range
(min, max)Adjust mul and add attributes according to a given range.
setMul
(x)Replace the mul attribute.
setAdd
(x)Replace the add attribute.
setSub
(x)Replace and inverse the add attribute.
setDiv
(x)Replace and inverse the mul attribute.
set
(attr, value[, port, callback])Replace any attribute with portamento.
ctrl
([map_list, title, wxnoserver])Opens a sliders window to control the parameters of the object.
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
PyoObject
_STREAM_TYPE
Inherited from
PyoObjectBase
_STREAM_TYPE
Private Methods:
Inherited from
PyoObject
_init_play
()_reset_from_set
([attr])Inherited from
PyoObjectBase
_autoplay
([dur, delay])_autostop
([wait])
- out(chnl=0, inc=1, dur=0, delay=0)[source]¶
Start processing and send samples to audio output beginning at chnl.
This method returns self, allowing it to be applied at the object creation.
- Args
- chnl: int, optional
Physical output assigned to the first audio stream of the object. Defaults to 0.
- inc: int, optional
Output channel increment value. Defaults to 1.
- dur: float, optional
Duration, in seconds, of the object’s activation. The default is 0 and means infinite duration.
- delay: float, optional
Delay, in seconds, before the object’s activation. Defaults to 0.
If chnl >= 0, successive streams increment the output number by inc and wrap around the global number of channels.
If chnl is negative, streams begin at 0, increment the output number by inc and wrap around the global number of channels. Then, the list of streams is scrambled.
If chnl is a list, successive values in the list will be assigned to successive streams.
- stop(wait=0)[source]¶
Stop processing.
This method returns self, allowing it to be applied at the object creation.
- Args
- wait: float, optional
Delay, in seconds, before the process is actually stopped. If autoStartChildren is activated in the Server, this value is propagated to the children objects. Defaults to 0.
Note
if the method setStopDelay(x) was called before calling stop(wait) with a positive wait value, the wait value won’t overwrite the value given to setStopDelay for the current object, but will be the one propagated to children objects. This allow to set a waiting time for a specific object with setStopDelay whithout changing the global delay time given to the stop method.
Fader and Adsr objects ignore waiting time given to the stop method because they already implement a delayed processing triggered by the stop call.
- setExp(x)[source]¶
Sets an exponent factor to create exponential or logarithmic envelope.
The default value is 1.0, which means linear segments. A value higher than 1.0 will produce exponential segments while a value between 0 and 1 will produce logarithmic segments. Must be > 0.0.
- Args
- x: float
new exp attribute.
- ctrl(map_list=None, title=None, wxnoserver=False)[source]¶
Opens a sliders window to control the parameters of the object. SLMap has a dataOnly attribute to identify parameters that don’t audio signal as control but only discrete values.
If a list of values are given to a parameter, a multisliders will be used to control each stream independently.
- Args
- map_list: list of SLMap objects, optional
Users defined set of parameters scaling. There is default scaling for each object that accept ctrl method.
- title: string, optional
Title of the window. If none is provided, the name of the class is used.
- wxnoserver: boolean, optional
With wxPython graphical toolkit, if True, tells the interpreter that there will be no server window.
If wxnoserver is set to True, the interpreter will not wait for the server GUI before showing the controller window.
- property fadein¶
float. Rising time of the envelope in seconds.
- property fadeout¶
float. Falling time of the envelope in seconds.
- property dur¶
float. Total duration of the envelope.
- property exp¶
float. Exponent factor of the envelope.
Adsr¶
- class Adsr(attack=0.01, decay=0.05, sustain=0.707, release=0.1, dur=0, mul=1, add=0)[source]¶
Attack - Decay - Sustain - Release envelope generator.
Calculates the classical ADSR envelope using linear segments. Duration can be set to 0 to give an infinite sustain. In this case, the stop() method calls the envelope release part.
The play() method starts the envelope and is not called at the object creation time.
- Parent
- Args
- attack: float, optional
Duration of the attack phase in seconds. Defaults to 0.01.
- decay: float, optional
Duration of the decay in seconds. Defaults to 0.05.
- sustain: float, optional
Amplitude of the sustain phase. Defaults to 0.707.
- release: float, optional
Duration of the release in seconds. Defaults to 0.1.
- dur: float, optional
Total duration of the envelope in seconds. Defaults to 0, which means wait for the stop() method to start the release phase.
Note
The out() method is bypassed. Adsr’s signal can not be sent to audio outs.
The play() method starts the envelope.
The stop() method calls the envelope’s release phase if dur = 0.
As of version 0.8.0, exponential or logarithmic envelopes can be created with the exponent factor (see setExp() method).
As of version 0.9.2, Adsr will send a trigger signal at the end of the playback. User can retreive the trigger streams by calling obj[‘trig’]. Useful to synchronize other processes.
Public Data Attributes:
float.
float.
float.
float.
float.
float.
Inherited from
PyoObject
mul
float or PyoObject.
add
float or PyoObject.
Public Methods:
__init__
([attack, decay, sustain, release, ...])out
([chnl, inc, dur, delay])Start processing and send samples to audio output beginning at chnl.
stop
([wait])Stop processing.
setAttack
(x)Replace the attack attribute.
setDecay
(x)Replace the decay attribute.
setSustain
(x)Replace the sustain attribute.
setRelease
(x)Replace the sustain attribute.
setDur
(x)Replace the dur attribute.
setExp
(x)Sets an exponent factor to create exponential or logarithmic envelope.
ctrl
([map_list, title, wxnoserver])Opens a sliders window to control the parameters of the object.
Inherited from
PyoObject
__init__
([mul, add])__add__
(x)__radd__
(x)__iadd__
(x)__sub__
(x)__rsub__
(x)__isub__
(x)__mul__
(x)__rmul__
(x)__imul__
(x)__truediv__
(x)__rtruediv__
(x)__itruediv__
(x)__div__
(x)__rdiv__
(x)__idiv__
(x)__pow__
(x)__rpow__
(x)__mod__
(x)__neg__
()__lt__
(x)Return self<value.
__le__
(x)Return self<=value.
__eq__
(x)Return self==value.
__ne__
(x)Return self!=value.
__gt__
(x)Return self>value.
__ge__
(x)Return self>=value.
__do_comp__
(comp, mode[, default])isPlaying
([all])Returns True if the object is currently playing, otherwise, returns False.
isOutputting
([all])Returns True if the object is outputting.
get
([all])Return the first sample of the current buffer as a float.
play
([dur, delay])Start processing without sending samples to output.
out
([chnl, inc, dur, delay])Start processing and send samples to audio output beginning at chnl.
stop
([wait])Stop processing.
mix
([voices])Mix the object's audio streams into voices streams and return a Mix object.
range
(min, max)Adjust mul and add attributes according to a given range.
setMul
(x)Replace the mul attribute.
setAdd
(x)Replace the add attribute.
setSub
(x)Replace and inverse the add attribute.
setDiv
(x)Replace and inverse the mul attribute.
set
(attr, value[, port, callback])Replace any attribute with portamento.
ctrl
([map_list, title, wxnoserver])Opens a sliders window to control the parameters of the object.
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
PyoObject
_STREAM_TYPE
Inherited from
PyoObjectBase
_STREAM_TYPE
Private Methods:
Inherited from
PyoObject
_init_play
()_reset_from_set
([attr])Inherited from
PyoObjectBase
_autoplay
([dur, delay])_autostop
([wait])
- out(chnl=0, inc=1, dur=0, delay=0)[source]¶
Start processing and send samples to audio output beginning at chnl.
This method returns self, allowing it to be applied at the object creation.
- Args
- chnl: int, optional
Physical output assigned to the first audio stream of the object. Defaults to 0.
- inc: int, optional
Output channel increment value. Defaults to 1.
- dur: float, optional
Duration, in seconds, of the object’s activation. The default is 0 and means infinite duration.
- delay: float, optional
Delay, in seconds, before the object’s activation. Defaults to 0.
If chnl >= 0, successive streams increment the output number by inc and wrap around the global number of channels.
If chnl is negative, streams begin at 0, increment the output number by inc and wrap around the global number of channels. Then, the list of streams is scrambled.
If chnl is a list, successive values in the list will be assigned to successive streams.
- stop(wait=0)[source]¶
Stop processing.
This method returns self, allowing it to be applied at the object creation.
- Args
- wait: float, optional
Delay, in seconds, before the process is actually stopped. If autoStartChildren is activated in the Server, this value is propagated to the children objects. Defaults to 0.
Note
if the method setStopDelay(x) was called before calling stop(wait) with a positive wait value, the wait value won’t overwrite the value given to setStopDelay for the current object, but will be the one propagated to children objects. This allow to set a waiting time for a specific object with setStopDelay whithout changing the global delay time given to the stop method.
Fader and Adsr objects ignore waiting time given to the stop method because they already implement a delayed processing triggered by the stop call.
- setExp(x)[source]¶
Sets an exponent factor to create exponential or logarithmic envelope.
The default value is 1.0, which means linear segments. A value higher than 1.0 will produce exponential segments while a value between 0 and 1 will produce logarithmic segments. Must be > 0.0.
- Args
- x: float
new exp attribute.
- ctrl(map_list=None, title=None, wxnoserver=False)[source]¶
Opens a sliders window to control the parameters of the object. SLMap has a dataOnly attribute to identify parameters that don’t audio signal as control but only discrete values.
If a list of values are given to a parameter, a multisliders will be used to control each stream independently.
- Args
- map_list: list of SLMap objects, optional
Users defined set of parameters scaling. There is default scaling for each object that accept ctrl method.
- title: string, optional
Title of the window. If none is provided, the name of the class is used.
- wxnoserver: boolean, optional
With wxPython graphical toolkit, if True, tells the interpreter that there will be no server window.
If wxnoserver is set to True, the interpreter will not wait for the server GUI before showing the controller window.
- property attack¶
float. Duration of the attack phase in seconds.
- property decay¶
float. Duration of the decay phase in seconds.
- property sustain¶
float. Amplitude of the sustain phase.
- property release¶
float. Duration of the release phase in seconds.
- property dur¶
float. Total duration of the envelope.
- property exp¶
float. Exponent factor of the envelope.
Linseg¶
- class Linseg(list, loop=False, initToFirstVal=False, mul=1, add=0)[source]¶
Draw a series of line segments between specified break-points.
The play() method starts the envelope and is not called at the object creation time.
- Parent
- Args
- list: list of tuples
Points used to construct the line segments. Each tuple is a new point in the form (time, value).
Times are given in seconds and must be in increasing order.
- loop: boolean, optional
Looping mode. Defaults to False.
- initToFirstVal: boolean, optional
If True, audio buffer will be filled at initialization with the first value of the line. Defaults to False.
Note
The out() method is bypassed. Linseg’s signal can not be sent to audio outs.
Public Data Attributes:
float.
boolean.
Inherited from
PyoObject
mul
float or PyoObject.
add
float or PyoObject.
Public Methods:
__init__
(list[, loop, initToFirstVal, mul, add])out
([chnl, inc, dur, delay])Start processing and send samples to audio output beginning at chnl.
setList
(x)Replace the list attribute.
replace
(x)Alias for setList method.
getPoints
()setLoop
(x)Replace the loop attribute.
pause
()Toggles between play and stop mode without reset.
clear
()Resets the internal audio buffer to 0.
graph
([xlen, yrange, title, wxnoserver])Opens a grapher window to control the shape of the envelope.
Inherited from
PyoObject
__init__
([mul, add])__add__
(x)__radd__
(x)__iadd__
(x)__sub__
(x)__rsub__
(x)__isub__
(x)__mul__
(x)__rmul__
(x)__imul__
(x)__truediv__
(x)__rtruediv__
(x)__itruediv__
(x)__div__
(x)__rdiv__
(x)__idiv__
(x)__pow__
(x)__rpow__
(x)__mod__
(x)__neg__
()__lt__
(x)Return self<value.
__le__
(x)Return self<=value.
__eq__
(x)Return self==value.
__ne__
(x)Return self!=value.
__gt__
(x)Return self>value.
__ge__
(x)Return self>=value.
__do_comp__
(comp, mode[, default])isPlaying
([all])Returns True if the object is currently playing, otherwise, returns False.
isOutputting
([all])Returns True if the object is outputting.
get
([all])Return the first sample of the current buffer as a float.
play
([dur, delay])Start processing without sending samples to output.
out
([chnl, inc, dur, delay])Start processing and send samples to audio output beginning at chnl.
stop
([wait])Stop processing.
mix
([voices])Mix the object's audio streams into voices streams and return a Mix object.
range
(min, max)Adjust mul and add attributes according to a given range.
setMul
(x)Replace the mul attribute.
setAdd
(x)Replace the add attribute.
setSub
(x)Replace and inverse the add attribute.
setDiv
(x)Replace and inverse the mul attribute.
set
(attr, value[, port, callback])Replace any attribute with portamento.
ctrl
([map_list, title, wxnoserver])Opens a sliders window to control the parameters of the object.
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
PyoObject
_STREAM_TYPE
Inherited from
PyoObjectBase
_STREAM_TYPE
Private Methods:
Inherited from
PyoObject
_init_play
()_reset_from_set
([attr])Inherited from
PyoObjectBase
_autoplay
([dur, delay])_autostop
([wait])
- out(chnl=0, inc=1, dur=0, delay=0)[source]¶
Start processing and send samples to audio output beginning at chnl.
This method returns self, allowing it to be applied at the object creation.
- Args
- chnl: int, optional
Physical output assigned to the first audio stream of the object. Defaults to 0.
- inc: int, optional
Output channel increment value. Defaults to 1.
- dur: float, optional
Duration, in seconds, of the object’s activation. The default is 0 and means infinite duration.
- delay: float, optional
Delay, in seconds, before the object’s activation. Defaults to 0.
If chnl >= 0, successive streams increment the output number by inc and wrap around the global number of channels.
If chnl is negative, streams begin at 0, increment the output number by inc and wrap around the global number of channels. Then, the list of streams is scrambled.
If chnl is a list, successive values in the list will be assigned to successive streams.
- graph(xlen=None, yrange=None, 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
- xlen: float, optional
Set the maximum value of the X axis of the graph. If None, the maximum value is retrieve from the current list of points.
- yrange: tuple, optional
Set the min and max values of the Y axis of the graph. If None, min and max are retrieve from the current list of points.
- 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¶
float. List of points (time, value).
- property loop¶
boolean. Looping mode.
Expseg¶
- class Expseg(list, loop=False, exp=10, inverse=True, initToFirstVal=False, mul=1, add=0)[source]¶
Draw a series of exponential segments between specified break-points.
The play() method starts the envelope and is not called at the object creation time.
- Parent
- Args
- list: list of tuples
Points used to construct the line segments. Each tuple is a new point in the form (time, value).
Times are given in seconds and must be in increasing order.
- loop: boolean, optional
Looping mode. Defaults to False.
- exp: float, optional
Exponent factor. Used to control the slope of the curves. Defaults to 10.
- inverse: boolean, optional
If True, downward slope will be inversed. Useful to create biexponential curves. Defaults to True.
- initToFirstVal: boolean, optional
If True, audio buffer will be filled at initialization with the first value of the line. Defaults to False.
Note
The out() method is bypassed. Expseg’s signal can not be sent to audio outs.
Public Data Attributes:
float.
boolean.
float.
boolean.
Inherited from
PyoObject
mul
float or PyoObject.
add
float or PyoObject.
Public Methods:
__init__
(list[, loop, exp, inverse, ...])out
([chnl, inc, dur, delay])Start processing and send samples to audio output beginning at chnl.
setList
(x)Replace the list attribute.
setLoop
(x)Replace the loop attribute.
setExp
(x)Replace the exp attribute.
setInverse
(x)Replace the inverse attribute.
replace
(x)Alias for setList method.
pause
()Toggles between play and stop mode without reset.
clear
()Resets the internal audio buffer to 0.
getPoints
()graph
([xlen, yrange, title, wxnoserver])Opens a grapher window to control the shape of the envelope.
Inherited from
PyoObject
__init__
([mul, add])__add__
(x)__radd__
(x)__iadd__
(x)__sub__
(x)__rsub__
(x)__isub__
(x)__mul__
(x)__rmul__
(x)__imul__
(x)__truediv__
(x)__rtruediv__
(x)__itruediv__
(x)__div__
(x)__rdiv__
(x)__idiv__
(x)__pow__
(x)__rpow__
(x)__mod__
(x)__neg__
()__lt__
(x)Return self<value.
__le__
(x)Return self<=value.
__eq__
(x)Return self==value.
__ne__
(x)Return self!=value.
__gt__
(x)Return self>value.
__ge__
(x)Return self>=value.
__do_comp__
(comp, mode[, default])isPlaying
([all])Returns True if the object is currently playing, otherwise, returns False.
isOutputting
([all])Returns True if the object is outputting.
get
([all])Return the first sample of the current buffer as a float.
play
([dur, delay])Start processing without sending samples to output.
out
([chnl, inc, dur, delay])Start processing and send samples to audio output beginning at chnl.
stop
([wait])Stop processing.
mix
([voices])Mix the object's audio streams into voices streams and return a Mix object.
range
(min, max)Adjust mul and add attributes according to a given range.
setMul
(x)Replace the mul attribute.
setAdd
(x)Replace the add attribute.
setSub
(x)Replace and inverse the add attribute.
setDiv
(x)Replace and inverse the mul attribute.
set
(attr, value[, port, callback])Replace any attribute with portamento.
ctrl
([map_list, title, wxnoserver])Opens a sliders window to control the parameters of the object.
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
PyoObject
_STREAM_TYPE
Inherited from
PyoObjectBase
_STREAM_TYPE
Private Methods:
Inherited from
PyoObject
_init_play
()_reset_from_set
([attr])Inherited from
PyoObjectBase
_autoplay
([dur, delay])_autostop
([wait])
- out(chnl=0, inc=1, dur=0, delay=0)[source]¶
Start processing and send samples to audio output beginning at chnl.
This method returns self, allowing it to be applied at the object creation.
- Args
- chnl: int, optional
Physical output assigned to the first audio stream of the object. Defaults to 0.
- inc: int, optional
Output channel increment value. Defaults to 1.
- dur: float, optional
Duration, in seconds, of the object’s activation. The default is 0 and means infinite duration.
- delay: float, optional
Delay, in seconds, before the object’s activation. Defaults to 0.
If chnl >= 0, successive streams increment the output number by inc and wrap around the global number of channels.
If chnl is negative, streams begin at 0, increment the output number by inc and wrap around the global number of channels. Then, the list of streams is scrambled.
If chnl is a list, successive values in the list will be assigned to successive streams.
- graph(xlen=None, yrange=None, 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
- xlen: float, optional
Set the maximum value of the X axis of the graph. If None, the maximum value is retrieve from the current list of points. Defaults to None.
- yrange: tuple, optional
Set the min and max values of the Y axis of the graph. If None, min and max are retrieve from the current list of points. Defaults to None.
- 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¶
float. List of points (time, value).
- property loop¶
boolean. Looping mode.
- property exp¶
float. Exponent factor.
- property inverse¶
boolean. Inverse downward slope.
Sig¶
- class Sig(value, mul=1, add=0)[source]¶
Convert numeric value to PyoObject signal.
- Parent
- Args
- value: float or PyoObject
Numerical value to convert.
>>> import random >>> s = Server().boot() >>> s.start() >>> fr = Sig(value=400) >>> p = Port(fr, risetime=0.001, falltime=0.001) >>> a = SineLoop(freq=p, feedback=0.08, mul=.3).out() >>> b = SineLoop(freq=p*1.005, feedback=0.08, mul=.3).out(1) >>> def pick_new_freq(): ... fr.value = random.randrange(300,601,50) >>> pat = Pattern(function=pick_new_freq, time=0.5).play()
Public Data Attributes:
float or PyoObject.
Inherited from
PyoObject
mul
float or PyoObject.
add
float or PyoObject.
Public Methods:
__init__
(value[, mul, add])setValue
(x)Changes the value of the signal stream.
ctrl
([map_list, title, wxnoserver])Opens a sliders window to control the parameters of the object.
Inherited from
PyoObject
__init__
([mul, add])__add__
(x)__radd__
(x)__iadd__
(x)__sub__
(x)__rsub__
(x)__isub__
(x)__mul__
(x)__rmul__
(x)__imul__
(x)__truediv__
(x)__rtruediv__
(x)__itruediv__
(x)__div__
(x)__rdiv__
(x)__idiv__
(x)__pow__
(x)__rpow__
(x)__mod__
(x)__neg__
()__lt__
(x)Return self<value.
__le__
(x)Return self<=value.
__eq__
(x)Return self==value.
__ne__
(x)Return self!=value.
__gt__
(x)Return self>value.
__ge__
(x)Return self>=value.
__do_comp__
(comp, mode[, default])isPlaying
([all])Returns True if the object is currently playing, otherwise, returns False.
isOutputting
([all])Returns True if the object is outputting.
get
([all])Return the first sample of the current buffer as a float.
play
([dur, delay])Start processing without sending samples to output.
out
([chnl, inc, dur, delay])Start processing and send samples to audio output beginning at chnl.
stop
([wait])Stop processing.
mix
([voices])Mix the object's audio streams into voices streams and return a Mix object.
range
(min, max)Adjust mul and add attributes according to a given range.
setMul
(x)Replace the mul attribute.
setAdd
(x)Replace the add attribute.
setSub
(x)Replace and inverse the add attribute.
setDiv
(x)Replace and inverse the mul attribute.
set
(attr, value[, port, callback])Replace any attribute with portamento.
ctrl
([map_list, title, wxnoserver])Opens a sliders window to control the parameters of the object.
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
PyoObject
_STREAM_TYPE
Inherited from
PyoObjectBase
_STREAM_TYPE
Private Methods:
Inherited from
PyoObject
_init_play
()_reset_from_set
([attr])Inherited from
PyoObjectBase
_autoplay
([dur, delay])_autostop
([wait])
- setValue(x)[source]¶
Changes the value of the signal stream.
- Args
- x: float or PyoObject
Numerical value to convert.
- ctrl(map_list=None, title=None, wxnoserver=False)[source]¶
Opens a sliders window to control the parameters of the object. SLMap has a dataOnly attribute to identify parameters that don’t audio signal as control but only discrete values.
If a list of values are given to a parameter, a multisliders will be used to control each stream independently.
- Args
- map_list: list of SLMap objects, optional
Users defined set of parameters scaling. There is default scaling for each object that accept ctrl method.
- title: string, optional
Title of the window. If none is provided, the name of the class is used.
- wxnoserver: boolean, optional
With wxPython graphical toolkit, if True, tells the interpreter that there will be no server window.
If wxnoserver is set to True, the interpreter will not wait for the server GUI before showing the controller window.
- property value¶
float or PyoObject. Numerical value to convert.
SigTo¶
- class SigTo(value, time=0.025, init=0.0, mul=1, add=0)[source]¶
Convert numeric value to PyoObject signal with portamento.
When value is changed, a ramp is applied from the current value to the new value. Can be used with PyoObject to apply a linear portamento on an audio signal.
- Parent
- Args
- value: float or PyoObject
Numerical value to convert.
- time: float or PyoObject, optional
Ramp time, in seconds, to reach the new value. Defaults to 0.025.
- init: float, optional
Initial value of the internal memory. Defaults to 0.
Note
The out() method is bypassed. SigTo’s signal can not be sent to audio outs.
>>> import random >>> s = Server().boot() >>> s.start() >>> fr = SigTo(value=200, time=0.5, init=200) >>> a = SineLoop(freq=fr, feedback=0.08, mul=.3).out() >>> b = SineLoop(freq=fr*1.005, feedback=0.08, mul=.3).out(1) >>> def pick_new_freq(): ... fr.value = random.randrange(200,501,50) >>> pat = Pattern(function=pick_new_freq, time=1).play()
Public Data Attributes:
float or PyoObject.
floator PyoObject.
Inherited from
PyoObject
mul
float or PyoObject.
add
float or PyoObject.
Public Methods:
__init__
(value[, time, init, mul, add])setValue
(x)Changes the value of the signal stream.
setTime
(x)Changes the ramp time of the object.
ctrl
([map_list, title, wxnoserver])Opens a sliders window to control the parameters of the object.
Inherited from
PyoObject
__init__
([mul, add])__add__
(x)__radd__
(x)__iadd__
(x)__sub__
(x)__rsub__
(x)__isub__
(x)__mul__
(x)__rmul__
(x)__imul__
(x)__truediv__
(x)__rtruediv__
(x)__itruediv__
(x)__div__
(x)__rdiv__
(x)__idiv__
(x)__pow__
(x)__rpow__
(x)__mod__
(x)__neg__
()__lt__
(x)Return self<value.
__le__
(x)Return self<=value.
__eq__
(x)Return self==value.
__ne__
(x)Return self!=value.
__gt__
(x)Return self>value.
__ge__
(x)Return self>=value.
__do_comp__
(comp, mode[, default])isPlaying
([all])Returns True if the object is currently playing, otherwise, returns False.
isOutputting
([all])Returns True if the object is outputting.
get
([all])Return the first sample of the current buffer as a float.
play
([dur, delay])Start processing without sending samples to output.
out
([chnl, inc, dur, delay])Start processing and send samples to audio output beginning at chnl.
stop
([wait])Stop processing.
mix
([voices])Mix the object's audio streams into voices streams and return a Mix object.
range
(min, max)Adjust mul and add attributes according to a given range.
setMul
(x)Replace the mul attribute.
setAdd
(x)Replace the add attribute.
setSub
(x)Replace and inverse the add attribute.
setDiv
(x)Replace and inverse the mul attribute.
set
(attr, value[, port, callback])Replace any attribute with portamento.
ctrl
([map_list, title, wxnoserver])Opens a sliders window to control the parameters of the object.
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
PyoObject
_STREAM_TYPE
Inherited from
PyoObjectBase
_STREAM_TYPE
Private Methods:
Inherited from
PyoObject
_init_play
()_reset_from_set
([attr])Inherited from
PyoObjectBase
_autoplay
([dur, delay])_autostop
([wait])
- setValue(x)[source]¶
Changes the value of the signal stream.
- Args
- x: float or PyoObject
Numerical value to convert.
- setTime(x)[source]¶
Changes the ramp time of the object.
- Args
- x: float or PyoObject
New ramp time in seconds.
- ctrl(map_list=None, title=None, wxnoserver=False)[source]¶
Opens a sliders window to control the parameters of the object. SLMap has a dataOnly attribute to identify parameters that don’t audio signal as control but only discrete values.
If a list of values are given to a parameter, a multisliders will be used to control each stream independently.
- Args
- map_list: list of SLMap objects, optional
Users defined set of parameters scaling. There is default scaling for each object that accept ctrl method.
- title: string, optional
Title of the window. If none is provided, the name of the class is used.
- wxnoserver: boolean, optional
With wxPython graphical toolkit, if True, tells the interpreter that there will be no server window.
If wxnoserver is set to True, the interpreter will not wait for the server GUI before showing the controller window.
- property value¶
float or PyoObject. Numerical value to convert.
- property time¶
floator PyoObject. Ramp time in seconds.