Routing¶
Set of objects to manage audio voice routing and spread of a sound signal into a stereo or multi-channel sound field.
Objects in this category¶
Mixer¶
- class Mixer(outs=2, chnls=1, time=0.025, mul=1, add=0)[source]¶
Audio mixer.
Mixer mixes multiple inputs to an arbitrary number of outputs with independant amplitude values per mixing channel and a user defined portamento applied on amplitude changes.
- Parent
- Args
- outs: int, optional
Number of outputs of the mixer. Available at initialization time only. Defaults to 2.
- chnls: int, optional
Number of channels per output. Available at initialization time only. Defaults to 1.
- time: float, optional
Duration, in seconds, of a portamento applied on a new amplitude value for a mixing channel. Defaults to 0.025.
Note
User can retrieve each of the output channels by calling the Mixer object with the desired channel between square brackets (see example).
>>> s = Server().boot() >>> s.start() >>> a = SfPlayer(SNDS_PATH+"/transparent.aif", loop=True, mul=.2) >>> b = FM(carrier=200, ratio=[.5013,.4998], index=6, mul=.2) >>> mm = Mixer(outs=3, chnls=2, time=.025) >>> fx1 = Disto(mm[0], drive=.9, slope=.9, mul=.1).out() >>> fx2 = Freeverb(mm[1], size=.8, damp=.8, mul=.5).out() >>> fx3 = Harmonizer(mm[2], transpo=1, feedback=.75, mul=.5).out() >>> mm.addInput(0, a) >>> mm.addInput(1, b) >>> mm.setAmp(0,0,.5) >>> mm.setAmp(0,1,.5) >>> mm.setAmp(1,2,.5) >>> mm.setAmp(1,1,.5)
Public Data Attributes:
float.
Inherited from
PyoObject
mul
float or PyoObject.
add
float or PyoObject.
Public Methods:
__init__
([outs, chnls, time, mul, add])__getitem__
(x)setTime
(x)Sets the portamento duration in seconds.
addInput
(voice, input)Adds an audio object in the mixer's inputs.
delInput
(voice)Removes an audio object from the mixer's inputs.
clear
()Remove all mixer's inputs at once.
setAmp
(vin, vout, amp)Sets the amplitude of a mixing channel.
getChannels
()Returns the Mixer's channels dictionary.
getKeys
()Returns the list of current keys in the Mixer's channels dictionary.
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])
- addInput(voice, input)[source]¶
Adds an audio object in the mixer’s inputs.
This method returns the key (voice argument or generated key if voice=None).
- Args
- voice: int or string
Key in the mixer dictionary for this input. If None, a unique key between 0 and 32767 will be automatically generated.
- input: PyoObject
Audio object to add to the mixer.
- delInput(voice)[source]¶
Removes an audio object from the mixer’s inputs.
- Args
- voice: int or string
Key in the mixer dictionary assigned to the input to remove.
- setAmp(vin, vout, amp)[source]¶
Sets the amplitude of a mixing channel.
- Args
- vin: int or string
Key in the mixer dictionary of the desired input.
- vout: int
Ouput channel where to send the signal.
- amp: float
Amplitude value for this mixing channel.
- 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 time¶
float. Portamento.
Pan¶
- class Pan(input, outs=2, pan=0.5, spread=0.5, mul=1, add=0)[source]¶
Cosinus panner with control on the spread factor.
- Parent
- Args
- input: PyoObject
Input signal to process.
- outs: int, optional
Number of channels on the panning circle. Available at initialization time only. Defaults to 2.
- pan: float or PyoObject
Position of the sound on the panning circle, between 0 and 1. Defaults to 0.5.
- spread: float or PyoObject
Amount of sound leaking to the surrounding channels, between 0 and 1. Defaults to 0.5.
Note
When used with two output channels, the algorithm used is the cosine/sine constant power panning law. The SPan object uses the square root of intensity constant power panning law.
Public Data Attributes:
PyoObject.
float or PyoObject.
float or PyoObject.
Inherited from
PyoObject
mul
float or PyoObject.
add
float or PyoObject.
Public Methods:
__init__
(input[, outs, pan, spread, mul, add])setInput
(x[, fadetime])Replace the input attribute.
setPan
(x)Replace the pan attribute.
setSpread
(x)Replace the spread attribute.
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])
- setInput(x, fadetime=0.05)[source]¶
Replace the input attribute.
- Args
- x: PyoObject
New signal to process.
- fadetime: float, optional
Crossfade time between old and new input. Default to 0.05.
- 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 input¶
PyoObject. Input signal to process.
- property pan¶
float or PyoObject. Position of the sound on the panning circle.
- property spread¶
float or PyoObject. Amount of sound leaking to the surrounding channels.
SPan¶
- class SPan(input, outs=2, pan=0.5, mul=1, add=0)[source]¶
Simple equal power panner.
- Parent
- Args
- input: PyoObject
Input signal to process.
- outs: int, optional
Number of channels on the panning circle. Available at initialization time only. Defaults to 2.
- pan: float or PyoObject
Position of the sound on the panning circle, between 0 and 1. Defaults to 0.5.
Note
When used with two output channels, the algorithm used is the square root of intensity constant power panning law. The Pan object uses the cosine/sine constant power panning law.
Public Data Attributes:
PyoObject.
float or PyoObject.
Inherited from
PyoObject
mul
float or PyoObject.
add
float or PyoObject.
Public Methods:
__init__
(input[, outs, pan, mul, add])setInput
(x[, fadetime])Replace the input attribute.
setPan
(x)Replace the pan attribute.
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])
- setInput(x, fadetime=0.05)[source]¶
Replace the input attribute.
- Args
- x: PyoObject
New signal to process.
- fadetime: float, optional
Crossfade time between old and new input. Default to 0.05.
- 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 input¶
PyoObject. Input signal to process.
- property pan¶
float or PyoObject. Position of the sound on the panning circle.
Selector¶
- class Selector(inputs, voice=0.0, mul=1, add=0)[source]¶
Audio selector.
Selector takes multiple PyoObjects in input and interpolates between them to generate a single output.
- Parent
- Args
- inputs: list of PyoObject
Audio objects to interpolate from.
- voice: float or PyoObject, optional
Voice position pointer, between 0 and len(inputs)-1. Defaults to 0.
>>> s = Server().boot() >>> s.start() >>> a = SfPlayer(SNDS_PATH + "/transparent.aif", speed=[.999,1], loop=True, mul=.3) >>> b = Noise(mul=.1) >>> c = SfPlayer(SNDS_PATH + "/accord.aif", speed=[.999,1], loop=True, mul=.5) >>> lf = Sine(freq=.1, add=1) >>> d = Selector(inputs=[a,b,c], voice=lf).out()
Public Data Attributes:
List of PyoObjects.
float or PyoObject.
Inherited from
PyoObject
mul
float or PyoObject.
add
float or PyoObject.
Public Methods:
__init__
(inputs[, voice, mul, add])setInputs
(x)Replace the inputs attribute.
setVoice
(x)Replace the voice attribute.
setMode
(x)Change the algorithm used to interpolate between inputs.
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])
- setMode(x)[source]¶
Change the algorithm used to interpolate between inputs.
if inputs are phase correlated you should use a linear fade.
- Args
- x: int {0, 1}
If 0 (the default) the equal power law is used to interpolate bewtween sources. If 1, linear fade is used instead.
- 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 inputs¶
List of PyoObjects. Audio objects to interpolate from.
- property voice¶
float or PyoObject. Voice position pointer.
Switch¶
- class Switch(input, outs=2, voice=0.0, mul=1, add=0)[source]¶
Audio switcher.
Switch takes an audio input and interpolates between multiple outputs.
User can retrieve the different streams by calling the output number between brackets. obj[0] retrieve the first stream, obj[outs-1] the last one.
- Parent
- Args
- input: PyoObject
Input signal to process.
- outs: int, optional
Number of outputs. Available at initialization time only. Defaults to 2.
- voice: float or PyoObject
Voice position pointer, between 0 and (outs-1) / len(input). Defaults to 0.
>>> s = Server(nchnls=2).boot() >>> s.start() >>> a = SfPlayer(SNDS_PATH + "/transparent.aif", speed=[.999,1], loop=True, mul=.3) >>> lf = Sine(freq=.25, mul=1, add=1) >>> b = Switch(a, outs=6, voice=lf) >>> c = WGVerb(b[0:2], feedback=.8).out() >>> d = Disto(b[2:4], drive=.9, mul=.1).out() >>> e = Delay(b[4:6], delay=.2, feedback=.6).out()
Public Data Attributes:
PyoObject.
float or PyoObject.
Inherited from
PyoObject
mul
float or PyoObject.
add
float or PyoObject.
Public Methods:
__init__
(input[, outs, voice, mul, add])setInput
(x[, fadetime])Replace the input attribute.
setVoice
(x)Replace the voice attribute.
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])
- setInput(x, fadetime=0.05)[source]¶
Replace the input attribute.
- Args
- x: PyoObject
New signal to process.
- fadetime: float, optional
Crossfade time between old and new input. Default to 0.05.
- 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 input¶
PyoObject. Input signal to process.
- property voice¶
float or PyoObject. Voice position pointer.
VoiceManager¶
- class VoiceManager(input, triggers=None, mul=1, add=0)[source]¶
Polyphony voice manager.
A trigger in input ask the object for a voice number and the object returns the first free one. The voice number is then disable until a trig comes at the same position in the list of triggers given at the argument triggers.
Usually, the trigger enabling the voice number will come from the process started with the object output. So, it’s common to leave the triggers argument to None and set the list of triggers afterward with the setTriggers method. The maximum number of voices generated by the object is the length of the trigger list.
If there is no free voice, the object outputs -1.0 continuously.
- Parent
- Args
- input: PyoObject
Trigger stream asking for new voice numbers.
- triggers: PyoObject or list of PyoObject, optional
List of mono PyoObject sending triggers. Can be a multi-streams PyoObject but not a mix of both.
Ordering in the list corresponds to voice numbers. Defaults to None.
>>> s = Server().boot() >>> s.start() >>> env = CosTable([(0,0),(100,1),(500,.5),(8192,0)]) >>> delta = RandDur(min=.05, max=.1) >>> vm = VoiceManager(Change(delta)) >>> sel = Select(vm, value=[0,1,2,3]) >>> pit = TrigChoice(sel, choice=[midiToHz(x) for x in [60,63,67,70,72]]) >>> amp = TrigEnv(sel, table=env, dur=.5, mul=.25) >>> synth1 = SineLoop(pit, feedback=.07, mul=amp).out() >>> vm.setTriggers(amp["trig"])
Public Data Attributes:
PyoObject.
list of PyoObject.
Inherited from
PyoObject
mul
float or PyoObject.
add
float or PyoObject.
Public Methods:
__init__
(input[, triggers, mul, add])setInput
(x[, fadetime])Replace the input attribute.
setTriggers
(x)Replace the triggers attribute.
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])
- setInput(x, fadetime=0.05)[source]¶
Replace the input attribute.
- Args
- x: PyoObject
New signal to process.
- fadetime: float, optional
Crossfade time between old and new input. Defaults to 0.05.
- setTriggers(x)[source]¶
Replace the triggers attribute.
- Args
- x: PyoObject or list of PyoObject
New triggers attribute.
- property input¶
PyoObject. Trigger stream asking for new voice numbers.
- property triggers¶
list of PyoObject. Trigger streams enabling voices.
HRTF¶
- class HRTF(input, azimuth=0.0, elevation=0.0, hrtfdata=None, mul=1, add=0)[source]¶
Head-Related Transfert Function 3D spatialization.
HRTF describes how a given sound wave input is filtered by the diffraction and reflection properties of the head, pinna, and torso, before the sound reaches the transduction machinery of the eardrum and inner ear.
This object takes a source signal and spatialises it in the 3D space around a listener by convolving the source with stored Head Related Impulse Response (HRIR) based filters. This works under ideal listening context, ie. when listening with headphones.
HRTF generates two outpout streams per input stream.
- Parent
- Args
- input: PyoObject
Input signal to process.
- azimuth: float or PyoObject, optional
Position of the sound on the horizontal plane, between -180 and 180 degrees. Defaults to 0.
- elevation: float or PyoObject, optional
Position of the sound on the vertical plane, between -40 and 90 degrees. Defaults to 0.
- hrtfdata: HRTFData, optional
Custom impulse responses dataset. Not used yet. Leave it to None.
Note
Currently, HRTF uses the HRIRs from Gardner and Martin at MIT lab.
http://alumni.media.mit.edu/~kdm/hrtfdoc/hrtfdoc.html
These impulses where recorded at a sampling rate of 44.1 kHz. They will probably work just as well at 48 kHz, but surely not at higher sampling rate.
There is plan to add the possibility for the user to load its own dataset in the future.
Public Data Attributes:
PyoObject.
float or PyoObject.
float or PyoObject.
Inherited from
PyoObject
mul
float or PyoObject.
add
float or PyoObject.
Public Methods:
__init__
(input[, azimuth, elevation, ...])setInput
(x[, fadetime])Replace the input attribute.
setAzimuth
(x)Replace the azimuth attribute.
setElevation
(x)Replace the elevation attribute.
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])
- setInput(x, fadetime=0.05)[source]¶
Replace the input attribute.
- Args
- x: PyoObject
New signal to process.
- fadetime: float, optional
Crossfade time between old and new input. Default to 0.05.
- setAzimuth(x)[source]¶
Replace the azimuth attribute.
- Args
- x: float or PyoObject
new azimuth attribute.
- setElevation(x)[source]¶
Replace the elevation attribute.
- Args
- x: float or PyoObject
new elevation 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 input¶
PyoObject. Input signal to process.
- property azimuth¶
float or PyoObject. Position of the sound on the horizontal plane.
- property elevation¶
float or PyoObject. Position of the sound on the vertical plane.
Binaural¶
- class Binaural(input, azimuth=0.0, elevation=0.0, azispan=0.0, elespan=0.0, mul=1, add=0)[source]¶
Binaural 3D spatialization.
Binaural object provides a realtime 3D spatialization over two channels by the mean of combining VBAP and HRTF algorithms.
VBAP is used to move the sound over a sixteen channels speaker setup without artifact and its result signals are then processed with Head-related Transfert Functions to mix them on a 3D sphere around a virtual head.
This treatment is better perceived when listened with headphones!
Binaural generates two outpout streams per input stream.
- Parent
- Args
- input: PyoObject
Input signal to process.
- azimuth: float or PyoObject
Position of the sound on the horizontal plane, between -180 and 180 degrees. Defaults to 0.
- elevation: float or PyoObject
Position of the sound on the vertical plane, between 0 and 90 degrees. Defaults to 0.
- azispan: float or PyoObject
Spreading of the sound on the horizontal plane, between 0 and 1. Defaults to 0.
- elespan: float or PyoObject
Spreading of the sound on the vertical plane, between 0 and 1. Defaults to 0.
Public Data Attributes:
PyoObject.
float or PyoObject.
float or PyoObject.
float or PyoObject.
float or PyoObject.
Inherited from
PyoObject
mul
float or PyoObject.
add
float or PyoObject.
Public Methods:
__init__
(input[, azimuth, elevation, ...])setInput
(x[, fadetime])Replace the input attribute.
setAzimuth
(x)Replace the azimuth attribute.
setElevation
(x)Replace the elevation attribute.
setAzispan
(x)Replace the azispan attribute.
setElespan
(x)Replace the elespan attribute.
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])
- setInput(x, fadetime=0.05)[source]¶
Replace the input attribute.
- Args
- x: PyoObject
New signal to process.
- fadetime: float, optional
Crossfade time between old and new input. Default to 0.05.
- setAzimuth(x)[source]¶
Replace the azimuth attribute.
- Args
- x: float or PyoObject
new azimuth attribute.
- setElevation(x)[source]¶
Replace the elevation attribute.
- Args
- x: float or PyoObject
new elevation attribute.
- setAzispan(x)[source]¶
Replace the azispan attribute.
- Args
- x: float or PyoObject
new azispan attribute.
- setElespan(x)[source]¶
Replace the elespan attribute.
- Args
- x: float or PyoObject
new elespan 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 input¶
PyoObject. Input signal to process.
- property azimuth¶
float or PyoObject. Position of the sound on the horizontal plane.
- property elevation¶
float or PyoObject. Position of the sound on the vertical plane.
- property azispan¶
float or PyoObject. Horizontal spanning.
- property elespan¶
float or PyoObject. Vertical spanning.