Utilities

Miscellaneous objects.

AToDB

class AToDB(input, mul=1, add=0)[source]

Returns the decibel equivalent of an amplitude value.

Returns the decibel equivalent of an amplitude value, 1 = 0 dB. The input values are internally clipped to 0.000001 so values less than or equal to 0.000001 return -120 dB.

Parent

PyoObject

Args
input: PyoObject

Input signal, amplitude value.

>>> s = Server().boot()
>>> s.start()
>>> # amplitude modulation of a notch around 1000 Hz, from -120 db to 0dB
>>> amp = Sine([1,1.5], mul=.5, add=.5)
>>> db = AToDB(amp)
>>> a = PinkNoise(.2)
>>> b = EQ(a, freq=1000, q=2, boost=db).out()

Public Data Attributes:

input

PyoObject.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(input[, mul, add])

setInput(x[, fadetime])

Replace the input attribute.

Inherited from PyoObject

__init__(input[, 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__(input[, mul, add])

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.

property input

PyoObject. Input signal to process.

Between

class Between(input, min=- 1.0, max=1.0, mul=1, add=0)[source]

Informs when an input signal is contained in a specified range.

Outputs a value of 1.0 if the input signal is greater or egal than min and less than max. Otherwise, outputs a value of 0.0.

Parent

PyoObject

Args
input: PyoObject

Input signal to process.

min: float or PyoObject, optional

Minimum range value. Defaults to 0.

max: float or PyoObject, optional

Maximum range value. Defaults to 1.

>>> s = Server().boot()
>>> s.start()
>>> ph = Phasor(freq=[7,8])
>>> tr = Between(ph, min=0, max=.25)
>>> amp = Port(tr, risetime=0.002, falltime=0.002, mul=.2)
>>> a = SineLoop(freq=[245,250], feedback=.1, mul=amp).out()

Public Data Attributes:

input

PyoObject.

min

float or PyoObject.

max

float or PyoObject.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(input[, min, max, mul, add])

setInput(x[, fadetime])

Replace the input attribute.

setMin(x)

Replace the min attribute.

setMax(x)

Replace the max attribute.

ctrl([map_list, title, wxnoserver])

Opens a sliders window to control the parameters of the object.

Inherited from PyoObject

__init__(input[, min, max, 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__(input[, min, max, mul, add])

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.

setMin(x)[source]

Replace the min attribute.

Args
x: float or PyoObject

New min attribute.

setMax(x)[source]

Replace the max attribute.

Args
x: float or PyoObject

New max 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 min

float or PyoObject. Minimum range value.

property max

float or PyoObject. Maximum range value.

CentsToTranspo

class CentsToTranspo(input, mul=1, add=0)[source]

Returns the transposition factor equivalent of a given cents value.

Returns the transposition factor equivalent of a given cents value, 0 cents = 1.

Parent

PyoObject

Args
input: PyoObject

Input signal, cents value.

>>> s = Server().boot()
>>> s.start()
>>> met = Metro(.125, poly=2).play()
>>> cts = TrigRandInt(met, max=12, mul=100)
>>> trans = CentsToTranspo(cts)
>>> sf = SfPlayer(SNDS_PATH+"/transparent.aif", loop=True, speed=trans, mul=.25).out()

Public Data Attributes:

input

PyoObject.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(input[, mul, add])

setInput(x[, fadetime])

Replace the input attribute.

Inherited from PyoObject

__init__(input[, 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__(input[, mul, add])

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.

property input

PyoObject. Input signal to process.

Clean_objects

class Clean_objects(time, *args)[source]

Stops and deletes PyoObjects after a given amount of time.

The start() method starts the thread timer (must be called).

Args
time: float

Time, in seconds, to wait before calling stop on the given objects and deleting them.

args: PyoObject(s)

Objects to delete. As much as desired, separated by commas.

>>> s = Server().boot()
>>> s.start()
>>> a = Noise(mul=.5).mix(2)
>>> b = Fader(fadein=.5, fadeout=1, dur=5).play()
>>> c = Biquad(a, freq=500, q=2, mul=b).out()
>>> dump = Clean_objects(6, a, b, c)
>>> dump.start()

Public Data Attributes:

Inherited from Thread

name

A string used for identification purposes only.

ident

Thread identifier of this thread or None if it has not been started.

native_id

Native integral thread ID of this thread, or None if it has not been started.

daemon

A boolean value indicating whether this thread is a daemon thread.

Public Methods:

__init__(time, *args)

This constructor should always be called with keyword arguments.

run()

Method representing the thread's activity.

Inherited from Thread

__init__(time, *args)

This constructor should always be called with keyword arguments.

__repr__()

Return repr(self).

start()

Start the thread's activity.

run()

Method representing the thread's activity.

join([timeout])

Wait until the thread terminates.

is_alive()

Return whether the thread is alive.

isDaemon()

setDaemon(daemonic)

getName()

setName(name)

Private Data Attributes:

Inherited from Thread

_initialized

Private Methods:

Inherited from Thread

_reset_internal_locks(is_alive)

_bootstrap()

_set_ident()

_set_native_id()

_set_tstate_lock()

Set a lock object which will be released by the interpreter when the underlying thread state (see pystate.h) gets deleted.

_bootstrap_inner()

_stop()

_delete()

Remove current thread from the dict of currently running threads.

_wait_for_tstate_lock([block, timeout])


run()[source]

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

Compare

class Compare(input, comp, mode='<', mul=1, add=0)[source]

Comparison object.

Compare evaluates a comparison between a PyoObject and a number or between two PyoObjects and outputs 1.0, as audio stream, if the comparison is true, otherwise outputs 0.0.

Parent

PyoObject

Args
input: PyoObject

Input signal.

comp: float or PyoObject

comparison signal.

mode: string, optional

Comparison operator as a string. Allowed operator are “<”, “<=”, “>”, “>=”, “==”, “!=”. Default to “<”.

>>> s = Server().boot()
>>> s.start()
>>> a = SineLoop(freq=[199,200], feedback=.1, mul=.2)
>>> b = SineLoop(freq=[149,150], feedback=.1, mul=.2)
>>> ph = Phasor(freq=1)
>>> ch = Compare(input=ph, comp=0.5, mode="<=")
>>> out = Selector(inputs=[a,b], voice=Port(ch)).out()

Public Data Attributes:

input

PyoObject.

comp

PyoObject.

mode

string.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(input, comp[, mode, mul, add])

out([chnl, inc, dur, delay])

Start processing and send samples to audio output beginning at chnl.

setInput(x[, fadetime])

Replace the input attribute.

setComp(x)

Replace the comp attribute.

setMode(x)

Replace the mode attribute.

Inherited from PyoObject

__init__(input, comp[, mode, 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__(input, comp[, mode, mul, add])

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.

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.

setComp(x)[source]

Replace the comp attribute.

Args
x: float or PyoObject

New comparison signal.

setMode(x)[source]

Replace the mode attribute.

Allowed operator are “<”, “<=”, “>”, “>=”, “==”, “!=”.

Args
x: string

New mode attribute.

property input

PyoObject. Input signal.

property comp

PyoObject. Comparison signal.

property mode

string. Comparison operator.

ControlRead

class ControlRead(filename, rate=1000, loop=False, interp=2, mul=1, add=0)[source]

Reads control values previously stored in text files.

Read sampled sound from a table, with optional looping mode.

Parent

PyoObject

Args
filename: string

Full path (without extension) used to create the files.

Usually the same filename as the one given to a ControlRec object to record automation.

The directory will be scaned and all files named “filename_xxx” will add a new stream in the object.

rate: int, optional

Rate at which the values are sampled. Defaults to 1000.

loop: boolean, optional

Looping mode, False means off, True means on. Defaults to False.

interp: int, optional
Choice of the interpolation method.
  1. no interpolation

  2. linear (default)

  3. cosinus

  4. cubic

Note

ControlRead will send a trigger signal at the end of the playback if loop is off or any time it wraps around if loop is on. User can retreive the trigger streams by calling obj[‘trig’]:

>>> rnds = ControlRead(home+"/freq_auto", loop=True)
>>> t = SndTable(SNDS_PATH+"/transparent.aif")
>>> loop = TrigEnv(rnds["trig"], t, dur=[.2,.3,.4,.5], mul=.5).out()

The out() method is bypassed. ControlRead’s signal can not be sent to audio outs.

See also

ControlRec

>>> s = Server().boot()
>>> s.start()
>>> rnds = ControlRead(SNDS_PATH+"/ControlRead_example_test", rate=100, loop=True)
>>> sines = SineLoop(freq=rnds, feedback=.05, mul=.15).out()

Public Data Attributes:

rate

int.

loop

boolean.

interp

int {1, 2, 3, 4}.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(filename[, rate, loop, interp, ...])

out([chnl, inc, dur, delay])

Start processing and send samples to audio output beginning at chnl.

setRate(x)

Replace the rate attribute.

setLoop(x)

Replace the loop attribute.

setInterp(x)

Replace the interp attribute.

Inherited from PyoObject

__init__(filename[, rate, loop, interp, ...])

__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__(filename[, rate, loop, interp, ...])

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.

setRate(x)[source]

Replace the rate attribute.

Args
x: int

new rate attribute.

setLoop(x)[source]

Replace the loop attribute.

Args
x: boolean

new loop attribute.

setInterp(x)[source]

Replace the interp attribute.

Args
x: int {1, 2, 3, 4}

new interp attribute.

property rate

int. Sampling frequency in cycles per second.

property loop

boolean. Looping mode.

property interp

int {1, 2, 3, 4}. Interpolation method.

ControlRec

class ControlRec(input, filename, rate=1000, dur=0.0)[source]

Records control values and writes them in a text file.

input parameter must be a valid PyoObject managing any number of streams, other parameters can’t be in list format. The user must call the write method to create text files on the disk.

Each line in the text files contains two values, the absolute time in seconds and the sampled value.

The play() method starts the recording and is not called at the object creation time.

Parent

PyoObject

Args
input: PyoObject

Input signal to sample.

filename: string

Full path (without extension) used to create the files.

“_000” will be added to file’s names with increasing digits according to the number of streams in input.

The same filename can be passed to a ControlRead object to read all related files.

rate: int, optional

Rate at which the input values are sampled. Defaults to 1000.

dur: float, optional

Duration of the recording, in seconds. If 0.0, the recording won’t stop until the end of the performance.

If greater than 0.0, the stop method is automatically called at the end of the recording.

Note

All parameters can only be set at intialization time.

The write() method must be called on the object to write the files on the disk.

The out() method is bypassed. ControlRec’s signal can not be sent to audio outs.

ControlRec has no mul and add attributes.

See also

ControlRead

>>> s = Server().boot()
>>> s.start()
>>> rnds = Randi(freq=[1,2], min=200, max=400)
>>> sines = SineLoop(freq=rnds, feedback=.05, mul=.2).out()
>>> home = os.path.expanduser('~')
>>> rec = ControlRec(rnds, home+"/test", rate=100, dur=4).play()
>>> # call rec.write() to save "test_000" and "test_001" in the home directory.
>>> def write_files():
...     sines.mul = 0
...     rec.write()
>>> call = CallAfter(function=write_files, time=4.5)

Public Data Attributes:

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(input, filename[, rate, dur])

out([chnl, inc, dur, delay])

Start processing and send samples to audio output beginning at chnl.

write()

Writes recorded values in text files on the disk.

Inherited from PyoObject

__init__(input, filename[, rate, dur])

__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__(input, filename[, rate, dur])

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.

write()[source]

Writes recorded values in text files on the disk.

DBToA

class DBToA(input, mul=1, add=0)[source]

Returns the amplitude equivalent of a decibel value.

Returns the amplitude equivalent of a decibel value, 0 dB = 1. The input values are internally clipped to -120 dB so -120 dB returns 0.

Parent

PyoObject

Args
input: PyoObject

Input signal, decibel value.

>>> s = Server().boot()
>>> s.start()
>>> # amplitude modulation 6 dB around -18 dB
>>> db = Sine(freq=1, phase=[0,.5], mul=6, add=-18)
>>> amp = DBToA(db)
>>> b = SineLoop(freq=[350,400], feedback=.1, mul=amp).out()

Public Data Attributes:

input

PyoObject.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(input[, mul, add])

setInput(x[, fadetime])

Replace the input attribute.

Inherited from PyoObject

__init__(input[, 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__(input[, mul, add])

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.

property input

PyoObject. Input signal to process.

Denorm

class Denorm(input, mul=1, add=0)[source]

Mixes low level noise to an input signal.

Mixes low level (~1e-24 for floats, and ~1e-60 for doubles) noise to a an input signal. Can be used before IIR filters and reverbs to avoid denormalized numbers which may otherwise result in significantly increased CPU usage.

Parent

PyoObject

Args
input: PyoObject

Input signal to process.

>>> s = Server().boot()
>>> s.start()
>>> amp = Linseg([(0,0),(2,1),(4,0)], loop=True).play()
>>> a = Sine(freq=[800,1000], mul=0.01*amp)
>>> den = Denorm(a)
>>> rev = Freeverb(den, size=.9).out()

Public Data Attributes:

input

PyoObject.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(input[, mul, add])

setInput(x[, fadetime])

Replace the input attribute.

Inherited from PyoObject

__init__(input[, 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__(input[, mul, add])

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.

property input

PyoObject. Input signal to filter.

FToM

class FToM(input, mul=1, add=0)[source]

Returns the midi note equivalent to a frequency in Hz.

Returns the midi note equivalent to a frequency in Hz, 440.0 (hz) = 69.

Parent

PyoObject

Args
input: PyoObject

Input signal as frequency in Hz.

>>> s = Server().boot()
>>> s.start()
>>> lfo = Sine([0.2,0.25], mul=300, add=600)
>>> src = SineLoop(freq=lfo, feedback=0.05)
>>> hz = Yin(src, minfreq=100, maxfreq=1000, cutoff=500)
>>> mid = FToM(hz)
>>> fr = Snap(mid, choice=[0,2,5,7,9], scale=1)
>>> freq = Port(fr, risetime=0.01, falltime=0.01)
>>> syn = SineLoop(freq, feedback=0.05, mul=0.3).out()

Public Data Attributes:

input

PyoObject.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(input[, mul, add])

setInput(x[, fadetime])

Replace the input attribute.

Inherited from PyoObject

__init__(input[, 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__(input[, mul, add])

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.

property input

PyoObject. Input signal to process.

Interp

class Interp(input, input2, interp=0.5, mul=1, add=0)[source]

Interpolates between two signals.

Parent

PyoObject

Args
input: PyoObject

First input signal.

input2: PyoObject

Second input signal.

interp: float or PyoObject, optional

Averaging value. 0 means only first signal, 1 means only second signal. Default to 0.5.

>>> s = Server().boot()
>>> s.start()
>>> sf = SfPlayer(SNDS_PATH + '/accord.aif', speed=[.99,1], loop=True, mul=.3)
>>> sf2 = SfPlayer(SNDS_PATH + '/transparent.aif', speed=[.99,1], loop=True, mul=.3)
>>> lfo = Osc(table=SquareTable(20), freq=5, mul=.5, add=.5)
>>> a = Interp(sf, sf2, lfo).out()

Public Data Attributes:

input

PyoObject.

input2

PyoObject.

interp

float or PyoObject.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(input, input2[, interp, mul, add])

setInput(x[, fadetime])

Replace the input attribute.

setInput2(x[, fadetime])

Replace the input2 attribute.

setInterp(x)

Replace the interp attribute.

ctrl([map_list, title, wxnoserver])

Opens a sliders window to control the parameters of the object.

Inherited from PyoObject

__init__(input, input2[, interp, 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__(input, input2[, interp, mul, add])

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.

setInput2(x, fadetime=0.05)[source]

Replace the input2 attribute.

Args
x: PyoObject

New signal to process.

fadetime: float, optional

Crossfade time between old and new input. Default to 0.05.

setInterp(x)[source]

Replace the interp attribute.

Args
x: float or PyoObject

New interp 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. First input signal.

property input2

PyoObject. Second input signal.

property interp

float or PyoObject. Averaging value.

MToF

class MToF(input, mul=1, add=0)[source]

Returns the frequency (Hz) equivalent to a midi note.

Returns the frequency (Hz) equivalent to a midi note, 60 = 261.62556530066814 Hz.

Parent

PyoObject

Args
input: PyoObject

Input signal as midi note.

>>> s = Server().boot()
>>> s.start()
>>> met = Metro(.125, poly=2).play()
>>> mid = TrigChoice(met, choice=[60, 63, 67, 70], port=.005)
>>> hz = MToF(mid)
>>> syn = SineLoop(freq=hz, feedback=.07, mul=.2).out()

Public Data Attributes:

input

PyoObject.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(input[, mul, add])

setInput(x[, fadetime])

Replace the input attribute.

Inherited from PyoObject

__init__(input[, 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__(input[, mul, add])

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.

property input

PyoObject. Input signal to process.

MToT

class MToT(input, centralkey=60.0, mul=1, add=0)[source]

Returns the transposition factor equivalent to a midi note.

Returns the transposition factor equivalent to a midi note. If the midi note equal the centralkey argument, the output is 1.0.

Parent

PyoObject

Args
input: PyoObject

Input signal as midi note.

centralkey: float, optional

The midi note that returns a transposition factor of 1, that is to say no transposition. Defaults to 60.

>>> s = Server().boot()
>>> s.start()
>>> tsnd = SndTable(SNDS_PATH+"/accord.aif")
>>> tenv = CosTable([(0,0), (100,1), (1000,.5), (8192,0)])
>>> met = Metro(.125, poly=2).play()
>>> amp = TrigEnv(met, table=tenv, dur=.25, mul=.7)
>>> mid = TrigChoice(met, choice=[43, 45, 60, 63], port=.0025)
>>> sp = MToT(mid)
>>> snd = Osc(tsnd, freq=tsnd.getRate()/sp, mul=amp).out()

Public Data Attributes:

input

PyoObject.

centralkey

float.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(input[, centralkey, mul, add])

setInput(x[, fadetime])

Replace the input attribute.

setCentralKey(x)

Replace the centralkey attribute.

Inherited from PyoObject

__init__(input[, centralkey, 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__(input[, centralkey, mul, add])

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.

setCentralKey(x)[source]

Replace the centralkey attribute.

Args
x: float

New centralkey attribute.

property input

PyoObject. Input signal to process.

property centralkey

float. The midi note that returns no transposition.

NoteinRead

class NoteinRead(filename, loop=False, mul=1, add=0)[source]

Reads Notein values previously stored in text files.

Parent

PyoObject

Args
filename: string

Full path (without extension) used to create the files.

Usually the same filename as the one given to a NoteinRec object to record automation.

The directory will be scaned and all files named “filename_xxx” will add a new stream in the object.

loop: boolean, optional

Looping mode, False means off, True means on. Defaults to False.

Note

NoteinRead will send a trigger signal at the end of the playback if loop is off or any time it wraps around if loop is on. User can retreive the trigger streams by calling obj[‘trig’]:

>>> notes = NoteinRead(home+"/notes_rec", loop=True)
>>> t = SndTable(SNDS_PATH+"/transparent.aif")
>>> loop = TrigEnv(notes["trig"], t, dur=[.2,.3,.4,.5], mul=.25).out()

The out() method is bypassed. NoteinRead’s signal can not be sent to audio outs.

See also

NoteinRec

>>> s = Server().boot()
>>> s.start()
>>> notes = NoteinRead(SNDS_PATH+"/NoteinRead_example_test", loop=True)
>>> amps = Port(notes['velocity'], 0.001, 0.45, mul=.3)
>>> sines = SineLoop(freq=MToF(notes['pitch']), feedback=.05, mul=amps).out()

Public Data Attributes:

loop

boolean.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(filename[, loop, mul, add])

__getitem__(str)

get([identifier, all])

Return the first sample of the current buffer as a float.

out([chnl, inc, dur, delay])

Start processing and send samples to audio output beginning at chnl.

setLoop(x)

Replace the loop attribute.

Inherited from PyoObject

__init__(filename[, loop, 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([identifier, 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__(filename[, loop, mul, add])

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__(str)

__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])


get(identifier='pitch', all=False)[source]

Return the first sample of the current buffer as a float.

Can be used to convert audio stream to usable Python data.

“pitch” or “velocity” must be given to identifier to specify which stream to get value from.

Args
identifier: string {“pitch”, “velocity”}

Address string parameter identifying audio stream. Defaults to “pitch”.

all: boolean, optional

If True, the first value of each object’s stream will be returned as a list.

If False, only the value of the first object’s stream will be returned as a float.

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.

setLoop(x)[source]

Replace the loop attribute.

Args
x: boolean

new loop attribute.

property loop

boolean. Looping mode.

NoteinRec

class NoteinRec(input, filename)[source]

Records Notein inputs and writes them in a text file.

input parameter must be a Notein object managing any number of streams, other parameters can’t be in list format. The user must call the write method to create text files on the disk.

Each line in the text files contains three values, the absolute time in seconds, the Midi pitch and the normalized velocity.

The play() method starts the recording and is not called at the object creation time.

Parent

PyoObject

Args
input: Notein

Notein signal to sample.

filename: string

Full path (without extension) used to create the files.

“_000” will be added to file’s names with increasing digits according to the number of streams in input.

The same filename can be passed to a NoteinRead object to read all related files.

Note

All parameters can only be set at intialization time.

The write method must be called on the object to write the files on the disk.

The out() method is bypassed. NoteinRec’s signal can not be sent to audio outs.

NoteinRec has no mul and add attributes.

See also

NoteinRead

>>> s = Server().boot()
>>> s.start()
>>> notes = Notein(poly=2)
>>> home = os.path.expanduser('~')
>>> rec = NoteinRec(notes, home+"/test").play()
>>> # call rec.write() to save "test_000" and "test_001" in the home directory.

Public Data Attributes:

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(input, filename)

out([chnl, inc, dur, delay])

Start processing and send samples to audio output beginning at chnl.

write()

Writes recorded values in text files on the disk.

Inherited from PyoObject

__init__(input, filename)

__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__(input, filename)

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.

write()[source]

Writes recorded values in text files on the disk.

Print

class Print(input, method=0, interval=0.25, message='')[source]

Print PyoObject’s current value.

Parent

PyoObject

Args
input: PyoObject

Input signal to filter.

method: int {0, 1}, optional

There is two methods to set when a value is printed (Defaults to 0): 0. at a periodic interval. 1. everytime the value changed.

interval: float, optional

Interval, in seconds, between each print. Used by method 0. Defaults to 0.25.

message: str, optional

Message to print before the current value. Defaults to “”.

Note

The out() method is bypassed. Print’s signal can not be sent to audio outs.

Print has no mul and add attributes.

>>> s = Server().boot()
>>> s.start()
>>> a = SfPlayer(SNDS_PATH + '/transparent.aif', loop=True, mul=.3).out()
>>> b = Follower(a)
>>> p = Print(b, method=0, interval=.1, message="RMS")

Public Data Attributes:

input

PyoObject.

method

int.

interval

float.

message

str.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(input[, method, interval, message])

setInput(x[, fadetime])

Replace the input attribute.

setMethod(x)

Replace the method attribute.

setInterval(x)

Replace the interval attribute.

setMessage(x)

Replace the message attribute.

out([chnl, inc, dur, delay])

Start processing and send samples to audio output beginning at chnl.

Inherited from PyoObject

__init__(input[, method, interval, message])

__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__(input[, method, interval, message])

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.

setMethod(x)[source]

Replace the method attribute.

Args
x: int {0, 1}

New method attribute.

setInterval(x)[source]

Replace the interval attribute.

Args
x: float

New interval attribute.

setMessage(x)[source]

Replace the message attribute.

Args
x: str

New message attribute.

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.

property input

PyoObject. Input signal.

property method

int. Controls when a value is printed.

property interval

float. For method 0, interval, in seconds, between each print.

property message

str. Message to print before the current value.

Record

class Record(input, filename, chnls=2, fileformat=0, sampletype=0, buffering=4, quality=0.4)[source]

Writes input sound in an audio file on the disk.

input parameter must be a valid PyoObject or an addition of PyoObjects, parameters can’t be in list format.

Parent

PyoObject

Args
input: PyoObject

Input signal to record.

filename: string

Full path of the file to create.

chnls: int, optional

Number of channels in the audio file. Defaults to 2.

fileformat: int, optional

Format type of the audio file. Defaults to 0.

Record will first try to set the format from the filename extension.

If it’s not possible, it uses the fileformat parameter. Supported formats are:
  1. WAV - Microsoft WAV format (little endian) {.wav, .wave}

  2. AIFF - Apple/SGI AIFF format (big endian) {.aif, .aiff}

  3. AU - Sun/NeXT AU format (big endian) {.au}

  4. RAW - RAW PCM data {no extension}

  5. SD2 - Sound Designer 2 {.sd2}

  6. FLAC - FLAC lossless file format {.flac}

  7. CAF - Core Audio File format {.caf}

  8. OGG - Xiph OGG container {.ogg}

sampletype: int, optional

Bit depth encoding of the audio file.

SD2 and FLAC only support 16 or 24 bit int. Supported types are:
  1. 16 bits int (default)

  2. 24 bits int

  3. 32 bits int

  4. 32 bits float

  5. 64 bits float

  6. U-Law encoded

  7. A-Law encoded

buffering: int, optional

Number of bufferSize to wait before writing samples to disk.

High buffering uses more memory but improves performance. Defaults to 4.

quality: float, optional

The encoding quality value, between 0.0 (lowest quality) and 1.0 (highest quality). This argument has an effect only with FLAC and OGG compressed formats. Defaults to 0.4.

Note

All parameters can only be set at intialization time.

The stop() method must be called on the object to close the file properly.

The out() method is bypassed. Record’s signal can not be sent to audio outs.

Record has no mul and add attributes.

>>> s = Server().boot()
>>> s.start()
>>> from random import uniform
>>> import os
>>> t = HarmTable([1, 0, 0, .2, 0, 0, 0, .1, 0, 0, .05])
>>> amp = Fader(fadein=.05, fadeout=2, dur=4, mul=.05).play()
>>> osc = Osc(t, freq=[uniform(350,360) for i in range(10)], mul=amp).out()
>>> home = os.path.expanduser('~')
>>> # Records an audio file called "example_synth.aif" in the home folder
>>> rec = Record(osc, filename=home+"/example_synth.aif", fileformat=1, sampletype=1)
>>> clean = Clean_objects(4.5, rec)
>>> clean.start()

Public Data Attributes:

input

PyoObject.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(input, filename[, chnls, ...])

out([chnl, inc, dur, delay])

Start processing and send samples to audio output beginning at chnl.

setInput(x[, fadetime])

Replace the input attribute.

Inherited from PyoObject

__init__(input, filename[, chnls, ...])

__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__(input, filename[, chnls, ...])

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.

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.

property input

PyoObject. Input signal to filter.

SampHold

class SampHold(input, controlsig, value=0.0, mul=1, add=0)[source]

Performs a sample-and-hold operation on its input.

SampHold performs a sample-and-hold operation on its input according to the value of controlsig. If controlsig equals value, the input is sampled and held until next sampling.

Parent

PyoObject

Args
input: PyoObject

Input signal.

controlsig: PyoObject

Controls when to sample the signal.

value: float or PyoObject, optional

Sampling target value. Default to 0.0.

>>> s = Server().boot()
>>> s.start()
>>> a = Noise(500,1000)
>>> b = Sine([3,4])
>>> c = SampHold(input=a, controlsig=b, value=0)
>>> d = Sine(c, mul=.2).out()

Public Data Attributes:

input

PyoObject.

controlsig

PyoObject.

value

float or PyoObject.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(input, controlsig[, value, mul, add])

setInput(x[, fadetime])

Replace the input attribute.

setControlsig(x[, fadetime])

Replace the controlsig attribute.

setValue(x)

Replace the value attribute.

Inherited from PyoObject

__init__(input, controlsig[, value, 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__(input, controlsig[, value, mul, add])

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.

setControlsig(x, fadetime=0.05)[source]

Replace the controlsig attribute.

Args
x: PyoObject

New control signal.

fadetime: float, optional

Crossfade time between old and new input. Default to 0.05.

setValue(x)[source]

Replace the value attribute.

Args
x: float or PyoObject

New value attribute.

property input

PyoObject. Input signal.

property controlsig

PyoObject. Control signal.

property value

float or PyoObject. Target value.

Scale

class Scale(input, inmin=0, inmax=1, outmin=0, outmax=1, exp=1, mul=1, add=0)[source]

Maps an input range of audio values to an output range.

Scale maps an input range of audio values to an output range. The ranges can be specified with min and max reversed for invert-mapping. If specified, the mapping can also be exponential.

Parent

PyoObject

Args
input: PyoObject

Input signal to process.

inmin: float or PyoObject, optional

Minimum input value. Defaults to 0.

inmax: float or PyoObject, optional

Maximum input value. Defaults to 1.

outmin: float or PyoObject, optional

Minimum output value. Defaults to 0.

outmax: float or PyoObject, optional

Maximum output value. Defaults to 1.

exp: float or PyoObject, optional

Exponent value, specifies the nature of the scaling curve. Values between 0 and 1 give a reversed curve. Defaults to 1.0.

>>> s = Server().boot()
>>> s.start()
>>> met = Metro(.125, poly=2).play()
>>> rnd = TrigRand(met, min=0, max=1, port=.005)
>>> omlf = Sine(.5, mul=700, add=1000)
>>> fr = Scale(rnd, inmin=0, inmax=1, outmin=250, outmax=omlf, exp=1)
>>> amp = TrigEnv(met, table=HannTable(), dur=.25, mul=.2)
>>> out = SineLoop(fr, feedback=.07, mul=amp).out()

Public Data Attributes:

input

PyoObject.

inmin

float or PyoObject.

inmax

float or PyoObject.

outmin

float or PyoObject.

outmax

float or PyoObject.

exp

float or PyoObject.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(input[, inmin, inmax, outmin, ...])

setInput(x[, fadetime])

Replace the input attribute.

setInMin(x)

Replace the inmin attribute.

setInMax(x)

Replace the inmax attribute.

setOutMin(x)

Replace the outmin attribute.

setOutMax(x)

Replace the outmax attribute.

setExp(x)

Replace the exp attribute.

ctrl([map_list, title, wxnoserver])

Opens a sliders window to control the parameters of the object.

Inherited from PyoObject

__init__(input[, inmin, inmax, outmin, ...])

__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__(input[, inmin, inmax, outmin, ...])

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.

setInMin(x)[source]

Replace the inmin attribute.

Args
x: float or PyoObject

New inmin attribute.

setInMax(x)[source]

Replace the inmax attribute.

Args
x: float or PyoObject

New inmax attribute.

setOutMin(x)[source]

Replace the outmin attribute.

Args
x: float or PyoObject

New outmin attribute.

setOutMax(x)[source]

Replace the outmax attribute.

Args
x: float or PyoObject

New outmax attribute.

setExp(x)[source]

Replace the exp attribute.

Args
x: float or PyoObject

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 input

PyoObject. Input signal to process.

property inmin

float or PyoObject. Minimum input value.

property inmax

float or PyoObject. Maximum input value.

property outmin

float or PyoObject. Minimum output value.

property outmax

float or PyoObject. Maximum output value.

property exp

float or PyoObject. Exponent value (nature of the scaling curve).

Snap

class Snap(input, choice, scale=0, mul=1, add=0)[source]

Snap input values on a user’s defined midi scale.

Snap takes an audio input of floating-point values from 0 to 127 and output the nearest value in the choice parameter. choice can be defined on any number of octaves and the real snapping values will be automatically expended. The object will take care of the input octave range. According to scale parameter, output can be in midi notes, hertz or transposition factor (centralkey = 60).

Parent

PyoObject

Args
input: PyoObject

Incoming Midi notes as an audio stream.

choice: list of floats

Possible values, as midi notes, for output.

scale: int {0, 1, 2}, optional
Pitch output format.
  1. MIDI (default)

  2. Hertz

  3. transposition factor

In the transpo mode, the central key (the key where there is no transposition) is 60.

>>> s = Server().boot()
>>> s.start()
>>> wav = SquareTable()
>>> env = CosTable([(0,0), (100,1), (500,.3), (8191,0)])
>>> met = Metro(.125, 8).play()
>>> amp = TrigEnv(met, table=env, mul=.2)
>>> pit = TrigXnoiseMidi(met, dist=4, x1=20, mrange=(48,84))
>>> hertz = Snap(pit, choice=[0,2,3,5,7,8,10], scale=1)
>>> a = Osc(table=wav, freq=hertz, phase=0, mul=amp).out()

Public Data Attributes:

input

PyoObject.

choice

list of floats.

scale

int.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(input, choice[, scale, mul, add])

setInput(x[, fadetime])

Replace the input attribute.

setChoice(x)

Replace the choice attribute.

setScale(x)

Replace the scale attribute.

Inherited from PyoObject

__init__(input, choice[, scale, 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__(input, choice[, scale, mul, add])

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.

setChoice(x)[source]

Replace the choice attribute.

Args
x: list of floats

new choice attribute.

setScale(x)[source]

Replace the scale attribute.

Possible values are:
  1. Midi notes

  2. Hertz

  3. transposition factor (centralkey = 60)

Args
x: int {0, 1, 2}

new scale attribute.

property input

PyoObject. Audio signal to transform.

property choice

list of floats. Possible values.

property scale

int. Output format.

TranspoToCents

class TranspoToCents(input, mul=1, add=0)[source]

Returns the cents value equivalent of a transposition factor.

Returns the cents value equivalent of a transposition factor, 1 = 0 cents.

Parent

PyoObject

Args
input: PyoObject

Input signal, transposition factor.

>>> s = Server().boot()
>>> s.start()
>>> met = Metro(.125, poly=2).play()
>>> trans = TrigChoice(met, choice=[.25,.5,.5,.75,1,1.25,1.5])
>>> semi = TranspoToCents(trans, mul=0.01)
>>> sf = SfPlayer(SNDS_PATH+"/transparent.aif", loop=True, mul=.3).out()
>>> harm = Harmonizer(sf, transpo=semi).out()

Public Data Attributes:

input

PyoObject.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(input[, mul, add])

setInput(x[, fadetime])

Replace the input attribute.

Inherited from PyoObject

__init__(input[, 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__(input[, mul, add])

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.

property input

PyoObject. Input signal to process.

TrackHold

class TrackHold(input, controlsig, value=0.0, mul=1, add=0)[source]

Performs a track-and-hold operation on its input.

TrackHold lets pass the signal in input without modification but hold a sample according to the value of controlsig. If controlsig equals value, the input is sampled and held, otherwise, it passes thru.

Parent

PyoObject

Args
input: PyoObject

Input signal.

controlsig: PyoObject

Controls when to sample the signal.

value: float or PyoObject, optional

Sampling target value. Default to 0.0.

>>> s = Server().boot()
>>> s.start()
>>> ph = Phasor([3,4])
>>> lf = Sine(.2, mul=.5, add=.5)
>>> th = TrackHold(lf, ph > 0.5, 1, mul=500, add=300)
>>> a = Sine(th, mul=.3).out()

Public Data Attributes:

input

PyoObject.

controlsig

PyoObject.

value

float or PyoObject.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(input, controlsig[, value, mul, add])

setInput(x[, fadetime])

Replace the input attribute.

setControlsig(x[, fadetime])

Replace the controlsig attribute.

setValue(x)

Replace the value attribute.

Inherited from PyoObject

__init__(input, controlsig[, value, 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__(input, controlsig[, value, mul, add])

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.

setControlsig(x, fadetime=0.05)[source]

Replace the controlsig attribute.

Args
x: PyoObject

New control signal.

fadetime: float, optional

Crossfade time between old and new input. Default to 0.05.

setValue(x)[source]

Replace the value attribute.

Args
x: float or PyoObject

New value attribute.

property input

PyoObject. Input signal.

property controlsig

PyoObject. Control signal.

property value

float or PyoObject. Target value.

Resample

class Resample(input, mode=1, mul=1, add=0)[source]

Realtime upsampling or downsampling of an audio signal.

This object should be used in the context of a resampling block created with the Server’s methods beginResamplingBlock and EndResamplingBlock.

If used inside the block, it will resample its input signal according to the resampling factor given to beginResamplingFactor. If the factor is a negative value, the new virtual sampling rate will be current sr / abs(factor). If the factor is a postive value, the new virtual sampling rate will be current sr * factor.

If used after endResamplingBlock, it will resample its input signal to the current sampling rate of the server.

The mode argument specifies the interpolation/decimation mode used internally.

Parent

PyoObject

Args
input: PyoObject

Input signal to resample.

mode: int, optional

The interpolation/decimation mode. Defaults to 1. For the upsampling process, possible values are:

  • 0: zero-padding

  • 1: sample-and-hold

  • 2 or higher: the formula mode * resampling factor gives the FIR lowpass kernel length used to interpolate.

For the downsampling process, possible values are:

  • 0 or 1: discard extra samples

  • 2 or higher: the formula mode * abs(resampling factor) gives the FIR lowpass kernel length used for the decimation.

>>> s = Server().boot()
>>> s.start()
>>> drv = Sine(.5, phase=[0, 0.5], mul=0.49, add=0.5)
>>> sig = SfPlayer(SNDS_PATH+"/transparent.aif", loop=True)
>>> s.beginResamplingBlock(8)
>>> sigup = Resample(sig, mode=32)
>>> drvup = Resample(drv, mode=1)
>>> disto = Disto(sigup, drive=drvup, mul=0.5)
>>> s.endResamplingBlock()
>>> sigdown = Resample(disto, mode=32, mul=0.4).out()

Public Data Attributes:

mode

int.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(input[, mode, mul, add])

setMode(x)

Replace the mode attribute.

Inherited from PyoObject

__init__(input[, mode, 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__(input[, mode, mul, add])

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]

Replace the mode attribute.

Args
x: int

New mode attribute.

property mode

int. The interpolation/decimation mode.