Open Sound Control

Objects to manage values on an Open Sound Control port.

OscSend takes the first value of each buffersize and send it on an OSC port.

OscReceive creates and returns audio streams from the value in its input port.

The audio streams of these objects are essentially intended to be controls and can’t be sent to the output soundcard.

Note

These objects are available only if pyo is built with OSC (Open Sound Control) support.

OscDataReceive

class OscDataReceive(port, address, function)[source]

Receives data values over a network via the Open Sound Control protocol.

Uses the OSC protocol to receive data values from other softwares or other computers. When a message is received, the function given at the argument function is called with the current address destination in argument followed by a tuple of values.

Parent

PyoObject

Args
port: int

Port on which values are received. Sender should output on the same port. Unlike OscDataSend object, there can be only one port per OscDataReceive object. Available at initialization time only.

address: string

Address used on the port to identify values. Address is in the form of a Unix path (ex.: “/pitch”). There can be as many addresses as needed on a single port.

function: callable (can’t be a list)

This function will be called whenever a message with a known address is received. there can be only one function per OscDataReceive object. Available at initialization time only.

Note

The header of the callable given at function argument must be in this form:

def my_func(address, *args):
    ...

The out() method is bypassed. OscDataReceive has no audio signal.

OscDataReceive has no mul and add attributes.

>>> s = Server().boot()
>>> s.start()
>>> def pp(address, *args):
...     print(address)
...     print(args)
>>> r = OscDataReceive(9900, "/data/test", pp)
>>> # Send various types
>>> a = OscDataSend("fissif", 9900, "/data/test")
>>> msg = [3.14159, 1, "Hello", "world!", 2, 6.18]
>>> a.send(msg)
>>> # Send a blob
>>> b = OscDataSend("b", 9900, "/data/test")
>>> msg = [[chr(i) for i in range(10)]]
>>> b.send(msg)
>>> # Send a MIDI noteon on port 0
>>> c = OscDataSend("m", 9900, "/data/test")
>>> msg = [[0, 144, 60, 100]]
>>> c.send(msg)

Public Data Attributes:

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(port, address, function)

setMul(x)

Replace the mul attribute.

setAdd(x)

Replace the add attribute.

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

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

getAddresses()

Returns the addresses managed by the object.

addAddress(path)

Adds new address(es) to the object's handler.

delAddress(path)

Removes address(es) from the object's handler.

Inherited from PyoObject

__init__(port, address, function)

__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__(port, address, function)

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


setMul(x)[source]

Replace the mul attribute.

Args
x: float or PyoObject

New mul attribute.

setAdd(x)[source]

Replace the add attribute.

Args
x: float or PyoObject

New add 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.

getAddresses()[source]

Returns the addresses managed by the object.

addAddress(path)[source]

Adds new address(es) to the object’s handler.

Args
path: string or list of strings

New path(s) to receive from.

delAddress(path)[source]

Removes address(es) from the object’s handler.

Args
path: string or list of strings

Path(s) to remove.

OscDataSend

class OscDataSend(types, port, address, host='127.0.0.1')[source]

Sends data values over a network via the Open Sound Control protocol.

Uses the OSC protocol to share values to other softwares or other computers. Values are sent on the form of a list containing types elements.

Parent

PyoObject

Args
types: str

String specifying the types sequence of the message to be sent. Possible values are:

  • “i”: integer

  • “h”: long integer

  • “f”: float

  • “d”: double

  • “s” ; string

  • “b”: blob (list of chars)

  • “m”: MIDI packet (list of 4 bytes: [midi port, status, data1, data2])

  • “c”: char

  • “T”: True

  • “F”: False

  • “N”: None (nil)

The string “ssfi” indicates that the value to send will be a list containing two strings followed by a float and an integer.

port: int

Port on which values are sent. Receiver should listen on the same port.

address: string

Address used on the port to identify values. Address is in the form of a Unix path (ex.: ‘/pitch’).

host: string, optional

IP address of the target computer. The default, ‘127.0.0.1’, is the localhost.

Note

The out() method is bypassed. OscDataSend has no audio signal.

OscDataSend has no mul and add attributes.

>>> s = Server().boot()
>>> s.start()
>>> def pp(address, *args):
...     print(address)
...     print(args)
>>> r = OscDataReceive(9900, "/data/test", pp)
>>> # Send various types
>>> a = OscDataSend("fissif", 9900, "/data/test")
>>> msg = [3.14159, 1, "Hello", "world!", 2, 6.18]
>>> a.send(msg)
>>> # Send a blob
>>> b = OscDataSend("b", 9900, "/data/test")
>>> msg = [[chr(i) for i in range(10)]]
>>> b.send(msg)
>>> # Send a MIDI noteon on port 0
>>> c = OscDataSend("m", 9900, "/data/test")
>>> msg = [[0, 144, 60, 100]]
>>> c.send(msg)

Public Data Attributes:

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(types, port, address[, host])

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

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

setMul(x)

Replace the mul attribute.

setAdd(x)

Replace the add attribute.

getAddresses()

Returns the addresses managed by the object.

addAddress(types, port, address[, host])

Adds new address(es) to the object's handler.

delAddress(path)

Removes address(es) from the object's handler.

send(msg[, address])

Method used to send msg values as a list.

Inherited from PyoObject

__init__(types, port, address[, host])

__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__(types, port, address[, host])

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.

setMul(x)[source]

Replace the mul attribute.

Args
x: float or PyoObject

New mul attribute.

setAdd(x)[source]

Replace the add attribute.

Args
x: float or PyoObject

New add attribute.

getAddresses()[source]

Returns the addresses managed by the object.

addAddress(types, port, address, host='127.0.0.1')[source]

Adds new address(es) to the object’s handler.

Args
types: str

String specifying the types sequence of the message to be sent. Possible values are: - “i”: integer - “h”: long integer - “f”: float - “d”: double - “s” ; string - “b”: blob (list of chars) - “m”: MIDI packet (list of 4 bytes: [midi port, status, data1, data2]) - “c”: char - “T”: True - “F”: False - “N”: None (nil)

The string “ssfi” indicates that the value to send will be a list containing two strings followed by a float and an integer.

port: int

Port on which values are sent. Receiver should listen on the same port.

address: string

Address used on the port to identify values. Address is in the form of a Unix path (ex.: ‘/pitch’).

host: string, optional

IP address of the target computer. The default, ‘127.0.0.1’, is the localhost.

delAddress(path)[source]

Removes address(es) from the object’s handler.

Args
path: string or list of strings

Path(s) to remove.

send(msg, address=None)[source]

Method used to send msg values as a list.

Args
msg: list

List of values to send. Types of values in list must be of the kind defined of types argument given at the object’s initialization.

address: string, optional

Address destination to send values. If None, values will be sent to all addresses managed by the object.

OscListReceive

class OscListReceive(port, address, num=8, mul=1, add=0)[source]

Receives list of values over a network via the Open Sound Control protocol.

Uses the OSC protocol to receive list of floating-point values from other softwares or other computers. The list are converted into audio streams. Get values at the beginning of each buffersize and fill buffers with them.

Parent

PyoObject

Args
port: int

Port on which values are received. Sender should output on the same port. Unlike OscSend object, there can be only one port per OscListReceive object. Available at initialization time only.

address: string

Address used on the port to identify values. Address is in the form of a Unix path (ex.: ‘/pitch’).

num: int, optional

Length of the lists in input. The object will generate num audio streams per given address. Available at initialization time only. This value can’t be a list. That means all addresses managed by an OscListReceive object are of the same length. Defaults to 8.

Note

Audio streams are accessed with the address string parameter. The user should call :

OscReceive[‘/pitch’] to retreive list of streams named ‘/pitch’.

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

>>> s = Server().boot()
>>> s.start()
>>> # 8 oscillators
>>> a = OscListReceive(port=10001, address=['/pitch', '/amp'], num=8)
>>> b = Sine(freq=a['/pitch'], mul=a['/amp']).mix(2).out()

Public Data Attributes:

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(port, address[, num, mul, add])

__getitem__(i)

getAddresses()

Returns the addresses managed by the object.

addAddress(path[, mul, add])

Adds new address(es) to the object's handler.

delAddress(path)

Removes address(es) from the object's handler.

setInterpolation(x)

Activate/Deactivate interpolation.

setValue(path, value)

Sets value for a given address.

get([identifier, all])

Return the first list of samples of the current buffer as floats.

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.

Inherited from PyoObject

__init__(port, address[, num, 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 list of samples of the current buffer as floats.

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__(port, address[, num, 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])


getAddresses()[source]

Returns the addresses managed by the object.

addAddress(path, mul=1, add=0)[source]

Adds new address(es) to the object’s handler.

Args
path: string or list of strings

New path(s) to receive from.

mul: float or PyoObject

Multiplication factor. Defaults to 1.

add: float or PyoObject

Addition factor. Defaults to 0.

delAddress(path)[source]

Removes address(es) from the object’s handler.

Args
path: string or list of strings

Path(s) to remove.

setInterpolation(x)[source]

Activate/Deactivate interpolation. Activated by default.

Args
x: boolean

True activates the interpolation, False deactivates it.

setValue(path, value)[source]

Sets value for a given address.

Args
path: string

Address to which the value should be attributed.

value: list of floats

List of values to attribute to the given address.

get(identifier=None, all=False)[source]

Return the first list of samples of the current buffer as floats.

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

Address as string must be given to identifier to specify which stream to get value from.

Args
identifier: string

Address string parameter identifying audio stream. Defaults to None, useful when all is True to retreive all streams values.

all: boolean, optional

If True, the first list of values of each object’s stream will be returned as a list of lists. Otherwise, only the the list of the object’s identifier will be returned as a list of floats. Defaults to False.

play(dur=0, delay=0)[source]

Start processing without sending samples to output. This method is called automatically at the object creation.

This method returns self, allowing it to be applied at the object creation.

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

out(chnl=0, inc=1, dur=0, delay=0)[source]

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

This method returns self, allowing it to be applied at the object creation.

Args
chnl: int, optional

Physical output assigned to the first audio stream of the object. Defaults to 0.

inc: int, optional

Output channel increment value. Defaults to 1.

dur: float, optional

Duration, in seconds, of the object’s activation. The default is 0 and means infinite duration.

delay: float, optional

Delay, in seconds, before the object’s activation. Defaults to 0.

If chnl >= 0, successive streams increment the output number by inc and wrap around the global number of channels.

If chnl is negative, streams begin at 0, increment the output number by inc and wrap around the global number of channels. Then, the list of streams is scrambled.

If chnl is a list, successive values in the list will be assigned to successive streams.

stop(wait=0)[source]

Stop processing.

This method returns self, allowing it to be applied at the object creation.

Args
wait: float, optional

Delay, in seconds, before the process is actually stopped. If autoStartChildren is activated in the Server, this value is propagated to the children objects. Defaults to 0.

Note

if the method setStopDelay(x) was called before calling stop(wait) with a positive wait value, the wait value won’t overwrite the value given to setStopDelay for the current object, but will be the one propagated to children objects. This allow to set a waiting time for a specific object with setStopDelay whithout changing the global delay time given to the stop method.

Fader and Adsr objects ignore waiting time given to the stop method because they already implement a delayed processing triggered by the stop call.

OscReceive

class OscReceive(port, address, mul=1, add=0)[source]

Receives values over a network via the Open Sound Control protocol.

Uses the OSC protocol to receive values from other softwares or other computers. Get a value at the beginning of each buffersize and fill its buffer with it.

Parent

PyoObject

Args
port: int

Port on which values are received. Sender should output on the same port.

Unlike OscSend object, there can be only one port per OscReceive object.

Available at initialization time only.

address: string

Address used on the port to identify values. Address is in the form of a Unix path (ex.: ‘/pitch’).

Note

Audio streams are accessed with the address string parameter. The user should call :

OscReceive[‘/pitch’] to retreive stream named ‘/pitch’.

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

>>> s = Server().boot()
>>> s.start()
>>> a = OscReceive(port=10001, address=['/pitch', '/amp'])
>>> b = Sine(freq=a['/pitch'], mul=a['/amp']).mix(2).out()

Public Data Attributes:

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(port, address[, mul, add])

__getitem__(i)

getAddresses()

Returns the addresses managed by the object.

addAddress(path[, mul, add])

Adds new address(es) to the object's handler.

delAddress(path)

Removes address(es) from the object's handler.

setInterpolation(x)

Activate/Deactivate interpolation.

setValue(path, value)

Sets value for a given address.

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.

Inherited from PyoObject

__init__(port, address[, 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__(port, address[, 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])


getAddresses()[source]

Returns the addresses managed by the object.

addAddress(path, mul=1, add=0)[source]

Adds new address(es) to the object’s handler.

Args
path: string or list of strings

New path(s) to receive from.

mul: float or PyoObject

Multiplication factor. Defaults to 1.

add: float or PyoObject

Addition factor. Defaults to 0.

delAddress(path)[source]

Removes address(es) from the object’s handler.

Args
path: string or list of strings

Path(s) to remove.

setInterpolation(x)[source]

Activate/Deactivate interpolation. Activated by default.

Args
x: boolean

True activates the interpolation, False deactivates it.

setValue(path, value)[source]

Sets value for a given address.

Args
path: string

Address to which the value should be attributed.

value: float

Value to attribute to the given address.

get(identifier=None, 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.

Address as string must be given to identifier to specify which stream to get value from.

Args
identifier: string

Address string parameter identifying audio stream. Defaults to None, useful when all is True to retreive all streams values.

all: boolean, optional

If True, the first value of each object’s stream will be returned as a list. Otherwise, only the value of the first object’s stream will be returned as a float. Defaults to False.

play(dur=0, delay=0)[source]

Start processing without sending samples to output. This method is called automatically at the object creation.

This method returns self, allowing it to be applied at the object creation.

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

out(chnl=0, inc=1, dur=0, delay=0)[source]

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

This method returns self, allowing it to be applied at the object creation.

Args
chnl: int, optional

Physical output assigned to the first audio stream of the object. Defaults to 0.

inc: int, optional

Output channel increment value. Defaults to 1.

dur: float, optional

Duration, in seconds, of the object’s activation. The default is 0 and means infinite duration.

delay: float, optional

Delay, in seconds, before the object’s activation. Defaults to 0.

If chnl >= 0, successive streams increment the output number by inc and wrap around the global number of channels.

If chnl is negative, streams begin at 0, increment the output number by inc and wrap around the global number of channels. Then, the list of streams is scrambled.

If chnl is a list, successive values in the list will be assigned to successive streams.

stop(wait=0)[source]

Stop processing.

This method returns self, allowing it to be applied at the object creation.

Args
wait: float, optional

Delay, in seconds, before the process is actually stopped. If autoStartChildren is activated in the Server, this value is propagated to the children objects. Defaults to 0.

Note

if the method setStopDelay(x) was called before calling stop(wait) with a positive wait value, the wait value won’t overwrite the value given to setStopDelay for the current object, but will be the one propagated to children objects. This allow to set a waiting time for a specific object with setStopDelay whithout changing the global delay time given to the stop method.

Fader and Adsr objects ignore waiting time given to the stop method because they already implement a delayed processing triggered by the stop call.

OscSend

class OscSend(input, port, address, host='127.0.0.1')[source]

Sends values over a network via the Open Sound Control protocol.

Uses the OSC protocol to share values to other softwares or other computers. Only the first value of each input buffersize will be sent on the OSC port.

Parent

PyoObject

Args
input: PyoObject

Input signal.

port: int

Port on which values are sent. Receiver should listen on the same port.

address: string

Address used on the port to identify values. Address is in the form of a Unix path (ex.: ‘/pitch’).

host: string, optional

IP address of the target computer. The default, ‘127.0.0.1’, is the localhost.

Note

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

OscSend has no mul and add attributes.

>>> s = Server().boot()
>>> s.start()
>>> a = Sine(freq=[1,1.5], mul=[100,.1], add=[600, .1])
>>> b = OscSend(a, port=10001, address=['/pitch','/amp'])

Public Data Attributes:

input

PyoObject.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(input, port, address[, host])

setInput(x[, fadetime])

Replace the input attribute.

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

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

setMul(x)

Replace the mul attribute.

setAdd(x)

Replace the add attribute.

setBufferRate(x)

Sets how many buffers to wait before sending a new value.

Inherited from PyoObject

__init__(input, port, address[, host])

__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, port, address[, host])

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.

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.

setMul(x)[source]

Replace the mul attribute.

Args
x: float or PyoObject

New mul attribute.

setAdd(x)[source]

Replace the add attribute.

Args
x: float or PyoObject

New add attribute.

setBufferRate(x)[source]

Sets how many buffers to wait before sending a new value.

Args
x: int

Changes the data output frequency in multiples of the buffer size. Should be greater or equal to 1.

property input

PyoObject. Input signal.