Midi Handling

Objects to retrieve Midi informations for a specific Midi port and channel.

Objects creates and returns audio streams from the value in their Midi input.

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

Objects in this category

  • Bendin : Get the current value of the pitch bend controller.

  • CtlScan : Scan the Midi controller’s number in input.

  • CtlScan2 : Scan the Midi channel and controller number in input.

  • MidiAdsr : Midi triggered ADSR envelope generator.

  • MidiDelAdsr : Midi triggered ADSR envelope generator with pre-delay.

  • Midictl : Get the current value of a Midi controller.

  • Notein : Generates Midi note messages.

  • Programin : Get the current value of a program change Midi controller.

  • Touchin : Get the current value of an after-touch Midi controller.

  • RawMidi : Raw Midi handler.

  • MidiLinseg : Line segments trigger.

Bendin

class Bendin(brange=2, scale=0, channel=0, mul=1, add=0)[source]

Get the current value of the pitch bend controller.

Get the current value of the pitch bend controller and optionally maps it inside a specified range.

Parent

PyoObject

Args
brange: float, optional

Bipolar range of the pitch bend in semitones. Defaults to 2. -brange <= value < brange.

scale: int, optional
Output format. Defaults to 0.
  1. Midi

  2. transpo.

The transpo mode is useful if you want to transpose values that are in a frequency (Hz) format.

channel: int, optional

Midi channel. 0 means all channels. Defaults to 0.

Note

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

>>> s = Server().boot()
>>> s.start()
>>> notes = Notein(poly=10, scale=1, mul=.5)
>>> bend = Bendin(brange=2, scale=1)
>>> p = Port(notes['velocity'], .001, .5)
>>> b = Sine(freq=notes['pitch'] * bend, mul=p).out()
>>> c = Sine(freq=notes['pitch'] * bend * 0.997, mul=p).out()
>>> d = Sine(freq=notes['pitch'] * bend * 1.005, mul=p).out()

Public Data Attributes:

brange

float.

scale

int.

channel

int.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__([brange, scale, channel, mul, add])

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

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

setBrange(x)

Replace the brange attribute.

setScale(x)

Replace the scale attribute.

setChannel(x)

Replace the channel attribute.

setInterpolation(x)

Deprecated method.

ctrl([map_list, title, wxnoserver])

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

Inherited from PyoObject

__init__([mul, add])

__add__(x)

__radd__(x)

__iadd__(x)

__sub__(x)

__rsub__(x)

__isub__(x)

__mul__(x)

__rmul__(x)

__imul__(x)

__truediv__(x)

__rtruediv__(x)

__itruediv__(x)

__div__(x)

__rdiv__(x)

__idiv__(x)

__pow__(x)

__rpow__(x)

__mod__(x)

__neg__()

__lt__(x)

Return self<value.

__le__(x)

Return self<=value.

__eq__(x)

Return self==value.

__ne__(x)

Return self!=value.

__gt__(x)

Return self>value.

__ge__(x)

Return self>=value.

__do_comp__(comp, mode[, default])

isPlaying([all])

Returns True if the object is currently playing, otherwise, returns False.

isOutputting([all])

Returns True if the object is outputting.

get([all])

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

play([dur, delay])

Start processing without sending samples to output.

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

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

stop([wait])

Stop processing.

mix([voices])

Mix the object's audio streams into voices streams and return a Mix object.

range(min, max)

Adjust mul and add attributes according to a given range.

setMul(x)

Replace the mul attribute.

setAdd(x)

Replace the add attribute.

setSub(x)

Replace and inverse the add attribute.

setDiv(x)

Replace and inverse the mul attribute.

set(attr, value[, port, callback])

Replace any attribute with portamento.

ctrl([map_list, title, wxnoserver])

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

Inherited from PyoObjectBase

__init__()

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Data Attributes:

Inherited from PyoObject

_STREAM_TYPE

Inherited from PyoObjectBase

_STREAM_TYPE

Private Methods:

Inherited from PyoObject

_init_play()

_reset_from_set([attr])

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])


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

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

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

Args
chnl: int, optional

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

inc: int, optional

Output channel increment value. Defaults to 1.

dur: float, optional

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

delay: float, optional

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

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

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

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

setBrange(x)[source]

Replace the brange attribute.

Args
x: float

new brange attribute.

setScale(x)[source]

Replace the scale attribute.

Args
x: int

new scale attribute.

setChannel(x)[source]

Replace the channel attribute.

Args
x: int

new channel attribute.

setInterpolation(x)[source]

Deprecated method. If needed, use Port or SigTo to interpolate between values.

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 brange

float. Bipolar range of the pitch bend in semitones.

property scale

int. Output format. 0 = Midi, 1 = transpo.

property channel

int. Midi channel. 0 means all channels.

CtlScan

class CtlScan(function, toprint=True)[source]

Scan the Midi controller’s number in input.

Scan the Midi controller’s number in input and send it to a standard python function. Useful to implement a MidiLearn algorithm.

Parent

PyoObject

Args
function: Python function (can’t be a list)

Function to be called. The function must be declared with an argument for the controller number in input. Ex.:

def ctl_scan(ctlnum):

print(ctlnum)

toprint: boolean, optional

If True, controller number and value will be printed to the console.

Note

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

>>> s = Server()
>>> s.setMidiInputDevice(0) # enter your device number (see pm_list_devices())
>>> s.boot()
>>> s.start()
>>> def ctl_scan(ctlnum):
...     print(ctlnum)
>>> a = CtlScan(ctl_scan)

Public Data Attributes:

function

Python function.

toprint

boolean.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(function[, toprint])

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.

setSub(x)

Replace and inverse the add attribute.

setDiv(x)

Replace and inverse the mul attribute.

reset()

Resets the scanner.

setFunction(x)

Replace the function attribute.

setToprint(x)

Replace the toprint attribute.

Inherited from PyoObject

__init__([mul, add])

__add__(x)

__radd__(x)

__iadd__(x)

__sub__(x)

__rsub__(x)

__isub__(x)

__mul__(x)

__rmul__(x)

__imul__(x)

__truediv__(x)

__rtruediv__(x)

__itruediv__(x)

__div__(x)

__rdiv__(x)

__idiv__(x)

__pow__(x)

__rpow__(x)

__mod__(x)

__neg__()

__lt__(x)

Return self<value.

__le__(x)

Return self<=value.

__eq__(x)

Return self==value.

__ne__(x)

Return self!=value.

__gt__(x)

Return self>value.

__ge__(x)

Return self>=value.

__do_comp__(comp, mode[, default])

isPlaying([all])

Returns True if the object is currently playing, otherwise, returns False.

isOutputting([all])

Returns True if the object is outputting.

get([all])

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

play([dur, delay])

Start processing without sending samples to output.

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

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

stop([wait])

Stop processing.

mix([voices])

Mix the object's audio streams into voices streams and return a Mix object.

range(min, max)

Adjust mul and add attributes according to a given range.

setMul(x)

Replace the mul attribute.

setAdd(x)

Replace the add attribute.

setSub(x)

Replace and inverse the add attribute.

setDiv(x)

Replace and inverse the mul attribute.

set(attr, value[, port, callback])

Replace any attribute with portamento.

ctrl([map_list, title, wxnoserver])

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

Inherited from PyoObjectBase

__init__()

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Data Attributes:

Inherited from PyoObject

_STREAM_TYPE

Inherited from PyoObjectBase

_STREAM_TYPE

Private Methods:

Inherited from PyoObject

_init_play()

_reset_from_set([attr])

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])


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.

setSub(x)[source]

Replace and inverse the add attribute.

Args
x: float or PyoObject

New inversed add attribute.

setDiv(x)[source]

Replace and inverse the mul attribute.

Args
x: float or PyoObject

New inversed mul attribute.

reset()[source]

Resets the scanner.

setFunction(x)[source]

Replace the function attribute.

Args
x: Python function

new function attribute.

setToprint(x)[source]

Replace the toprint attribute.

Args
x: int

new toprint attribute.

property function

Python function. Function to be called.

property toprint

boolean. If True, prints values to the console.

CtlScan2

class CtlScan2(function, toprint=True)[source]

Scan the Midi channel and controller number in input.

Scan the Midi channel and controller number in input and send them to a standard python function. Useful to implement a MidiLearn algorithm.

Parent

PyoObject

Args
function: Python function (can’t be a list)

Function to be called. The function must be declared with two arguments, one for the controller number and one for the midi channel. Ex.:

def ctl_scan(ctlnum, midichnl):

print(ctlnum, midichnl)

toprint: boolean, optional

If True, controller number and value will be printed to the console.

Note

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

>>> s = Server()
>>> s.setMidiInputDevice(0) # enter your device number (see pm_list_devices())
>>> s.boot()
>>> s.start()
>>> def ctl_scan(ctlnum, midichnl):
...     print(ctlnum, midichnl)
>>> a = CtlScan2(ctl_scan)

Public Data Attributes:

function

Python function.

toprint

boolean.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(function[, toprint])

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.

setSub(x)

Replace and inverse the add attribute.

setDiv(x)

Replace and inverse the mul attribute.

reset()

Resets the scanner.

setFunction(x)

Replace the function attribute.

setToprint(x)

Replace the toprint attribute.

Inherited from PyoObject

__init__([mul, add])

__add__(x)

__radd__(x)

__iadd__(x)

__sub__(x)

__rsub__(x)

__isub__(x)

__mul__(x)

__rmul__(x)

__imul__(x)

__truediv__(x)

__rtruediv__(x)

__itruediv__(x)

__div__(x)

__rdiv__(x)

__idiv__(x)

__pow__(x)

__rpow__(x)

__mod__(x)

__neg__()

__lt__(x)

Return self<value.

__le__(x)

Return self<=value.

__eq__(x)

Return self==value.

__ne__(x)

Return self!=value.

__gt__(x)

Return self>value.

__ge__(x)

Return self>=value.

__do_comp__(comp, mode[, default])

isPlaying([all])

Returns True if the object is currently playing, otherwise, returns False.

isOutputting([all])

Returns True if the object is outputting.

get([all])

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

play([dur, delay])

Start processing without sending samples to output.

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

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

stop([wait])

Stop processing.

mix([voices])

Mix the object's audio streams into voices streams and return a Mix object.

range(min, max)

Adjust mul and add attributes according to a given range.

setMul(x)

Replace the mul attribute.

setAdd(x)

Replace the add attribute.

setSub(x)

Replace and inverse the add attribute.

setDiv(x)

Replace and inverse the mul attribute.

set(attr, value[, port, callback])

Replace any attribute with portamento.

ctrl([map_list, title, wxnoserver])

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

Inherited from PyoObjectBase

__init__()

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Data Attributes:

Inherited from PyoObject

_STREAM_TYPE

Inherited from PyoObjectBase

_STREAM_TYPE

Private Methods:

Inherited from PyoObject

_init_play()

_reset_from_set([attr])

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])


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.

setSub(x)[source]

Replace and inverse the add attribute.

Args
x: float or PyoObject

New inversed add attribute.

setDiv(x)[source]

Replace and inverse the mul attribute.

Args
x: float or PyoObject

New inversed mul attribute.

reset()[source]

Resets the scanner.

setFunction(x)[source]

Replace the function attribute.

Args
x: Python function

new function attribute.

setToprint(x)[source]

Replace the toprint attribute.

Args
x: int

new toprint attribute.

property function

Python function. Function to be called.

property toprint

boolean. If True, prints values to the console.

MidiAdsr

class MidiAdsr(input, attack=0.01, decay=0.05, sustain=0.7, release=0.1, mul=1, add=0)[source]

Midi triggered ADSR envelope generator.

Calculates the classical ADSR envelope using linear segments. The envelope starts when it receives a positive value in input, this value is used as the peak amplitude of the envelope. The sustain parameter is a fraction of the peak value and sets the real sustain value. A 0 in input (note off) starts the release part of the envelope.

Parent

PyoObject

Args
input: PyoObject

Input signal used to trigger the envelope. A positive value sets the peak amplitude and starts the envelope. A 0 starts the release part of the envelope.

attack: float, optional

Duration of the attack phase in seconds. Defaults to 0.01.

decay: float, optional

Duration of the decay phase in seconds. Defaults to 0.05.

sustain: float, optional

Amplitude of the sustain phase, as a fraction of the peak amplitude at the start of the envelope. Defaults to 0.7.

release: float, optional

Duration of the release phase in seconds. Defaults to 0.1.

Note

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

As of version 0.8.0, exponential or logarithmic envelopes can be created with the exponent factor (see setExp() method).

>>> s = Server().boot()
>>> s.start()
>>> mid = Notein(scale=1)
>>> env = MidiAdsr(mid['velocity'], attack=.005, decay=.1, sustain=.4, release=1)
>>> a = SineLoop(freq=mid['pitch'], feedback=.1, mul=env).out()
>>> b = SineLoop(freq=mid['pitch']*1.005, feedback=.1, mul=env).out(1)

Public Data Attributes:

attack

float.

decay

float.

sustain

float.

release

float.

exp

float.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(input[, attack, decay, sustain, ...])

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

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

setInput(x[, fadetime])

Replace the input attribute.

setAttack(x)

Replace the attack attribute.

setDecay(x)

Replace the decay attribute.

setSustain(x)

Replace the sustain attribute.

setRelease(x)

Replace the sustain attribute.

setExp(x)

Sets an exponent factor to create exponential or logarithmic envelopes.

ctrl([map_list, title, wxnoserver])

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

Inherited from PyoObject

__init__([mul, add])

__add__(x)

__radd__(x)

__iadd__(x)

__sub__(x)

__rsub__(x)

__isub__(x)

__mul__(x)

__rmul__(x)

__imul__(x)

__truediv__(x)

__rtruediv__(x)

__itruediv__(x)

__div__(x)

__rdiv__(x)

__idiv__(x)

__pow__(x)

__rpow__(x)

__mod__(x)

__neg__()

__lt__(x)

Return self<value.

__le__(x)

Return self<=value.

__eq__(x)

Return self==value.

__ne__(x)

Return self!=value.

__gt__(x)

Return self>value.

__ge__(x)

Return self>=value.

__do_comp__(comp, mode[, default])

isPlaying([all])

Returns True if the object is currently playing, otherwise, returns False.

isOutputting([all])

Returns True if the object is outputting.

get([all])

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

play([dur, delay])

Start processing without sending samples to output.

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

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

stop([wait])

Stop processing.

mix([voices])

Mix the object's audio streams into voices streams and return a Mix object.

range(min, max)

Adjust mul and add attributes according to a given range.

setMul(x)

Replace the mul attribute.

setAdd(x)

Replace the add attribute.

setSub(x)

Replace and inverse the add attribute.

setDiv(x)

Replace and inverse the mul attribute.

set(attr, value[, port, callback])

Replace any attribute with portamento.

ctrl([map_list, title, wxnoserver])

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

Inherited from PyoObjectBase

__init__()

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Data Attributes:

Inherited from PyoObject

_STREAM_TYPE

Inherited from PyoObjectBase

_STREAM_TYPE

Private Methods:

Inherited from PyoObject

_init_play()

_reset_from_set([attr])

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])


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

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

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

Args
chnl: int, optional

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

inc: int, optional

Output channel increment value. Defaults to 1.

dur: float, optional

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

delay: float, optional

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

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

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

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

setInput(x, fadetime=0.05)[source]

Replace the input attribute.

Args
x: PyoObject

New signal used to trigger the envelope.

fadetime: float, optional

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

setAttack(x)[source]

Replace the attack attribute.

Args
x: float

new attack attribute.

setDecay(x)[source]

Replace the decay attribute.

Args
x: float

new decay attribute.

setSustain(x)[source]

Replace the sustain attribute.

Args
x: float

new sustain attribute.

setRelease(x)[source]

Replace the sustain attribute.

Args
x: float

new sustain attribute.

setExp(x)[source]

Sets an exponent factor to create exponential or logarithmic envelopes.

The default value is 1.0, which means linear segments. A value higher than 1.0 will produce exponential segments while a value between 0 and 1 will produce logarithmic segments. Must be > 0.0.

Args
x: float

new exp attribute.

ctrl(map_list=None, title=None, wxnoserver=False)[source]

Opens a sliders window to control the parameters of the object. SLMap has a dataOnly attribute to identify parameters that don’t audio signal as control but only discrete values.

If a list of values are given to a parameter, a multisliders will be used to control each stream independently.

Args
map_list: list of SLMap objects, optional

Users defined set of parameters scaling. There is default scaling for each object that accept ctrl method.

title: string, optional

Title of the window. If none is provided, the name of the class is used.

wxnoserver: boolean, optional

With wxPython graphical toolkit, if True, tells the interpreter that there will be no server window.

If wxnoserver is set to True, the interpreter will not wait for the server GUI before showing the controller window.

property attack

float. Duration of the attack phase in seconds.

property decay

float. Duration of the decay phase in seconds.

property sustain

float. Amplitude of the sustain phase, as fraction of the peak amplitude.

property release

float. Duration of the release phase in seconds.

property exp

float. Exponent factor of the envelope.

MidiDelAdsr

class MidiDelAdsr(input, delay=0, attack=0.01, decay=0.05, sustain=0.7, release=0.1, mul=1, add=0)[source]

Midi triggered ADSR envelope generator with pre-delay.

Calculates the classical ADSR envelope using linear segments. The envelope starts after delay seconds when it receives a positive value in input, this value is used as the peak amplitude of the envelope. The sustain parameter is a fraction of the peak value and sets the real sustain value. A 0 in input (note off) starts the release part of the envelope.

Parent

PyoObject

Args
input: PyoObject

Input signal used to trigger the envelope. A positive value sets the peak amplitude and starts the envelope. A 0 starts the release part of the envelope.

delay: float, optional

Duration of the delay phase, before calling the envelope in seconds. Defaults to 0.

attack: float, optional

Duration of the attack phase in seconds. Defaults to 0.01.

decay: float, optional

Duration of the decay phase in seconds. Defaults to 0.05.

sustain: float, optional

Amplitude of the sustain phase, as a fraction of the peak amplitude at the start of the envelope. Defaults to 0.7.

release: float, optional

Duration of the release phase in seconds. Defaults to 0.1.

Note

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

As of version 0.8.0, exponential or logarithmic envelopes can be created with the exponent factor (see setExp() method).

>>> s = Server().boot()
>>> s.start()
>>> mid = Notein(scale=1)
>>> env = MidiDelAdsr(mid['velocity'], delay=.25, attack=.005, decay=.1, sustain=.4, release=1)
>>> a = SineLoop(freq=mid['pitch'], feedback=.1, mul=env).out()
>>> b = SineLoop(freq=mid['pitch']*1.005, feedback=.1, mul=env).out(1)

Public Data Attributes:

delay

float.

attack

float.

decay

float.

sustain

float.

release

float.

exp

float.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(input[, delay, attack, decay, ...])

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

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

setInput(x[, fadetime])

Replace the input attribute.

setDelay(x)

Replace the delay attribute.

setAttack(x)

Replace the attack attribute.

setDecay(x)

Replace the decay attribute.

setSustain(x)

Replace the sustain attribute.

setRelease(x)

Replace the sustain attribute.

setExp(x)

Sets an exponent factor to create exponential or logarithmic envelope.

ctrl([map_list, title, wxnoserver])

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

Inherited from PyoObject

__init__([mul, add])

__add__(x)

__radd__(x)

__iadd__(x)

__sub__(x)

__rsub__(x)

__isub__(x)

__mul__(x)

__rmul__(x)

__imul__(x)

__truediv__(x)

__rtruediv__(x)

__itruediv__(x)

__div__(x)

__rdiv__(x)

__idiv__(x)

__pow__(x)

__rpow__(x)

__mod__(x)

__neg__()

__lt__(x)

Return self<value.

__le__(x)

Return self<=value.

__eq__(x)

Return self==value.

__ne__(x)

Return self!=value.

__gt__(x)

Return self>value.

__ge__(x)

Return self>=value.

__do_comp__(comp, mode[, default])

isPlaying([all])

Returns True if the object is currently playing, otherwise, returns False.

isOutputting([all])

Returns True if the object is outputting.

get([all])

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

play([dur, delay])

Start processing without sending samples to output.

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

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

stop([wait])

Stop processing.

mix([voices])

Mix the object's audio streams into voices streams and return a Mix object.

range(min, max)

Adjust mul and add attributes according to a given range.

setMul(x)

Replace the mul attribute.

setAdd(x)

Replace the add attribute.

setSub(x)

Replace and inverse the add attribute.

setDiv(x)

Replace and inverse the mul attribute.

set(attr, value[, port, callback])

Replace any attribute with portamento.

ctrl([map_list, title, wxnoserver])

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

Inherited from PyoObjectBase

__init__()

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Data Attributes:

Inherited from PyoObject

_STREAM_TYPE

Inherited from PyoObjectBase

_STREAM_TYPE

Private Methods:

Inherited from PyoObject

_init_play()

_reset_from_set([attr])

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])


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

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

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

Args
chnl: int, optional

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

inc: int, optional

Output channel increment value. Defaults to 1.

dur: float, optional

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

delay: float, optional

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

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

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

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

setInput(x, fadetime=0.05)[source]

Replace the input attribute.

Args
x: PyoObject

New signal used to trigger the envelope.

fadetime: float, optional

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

setDelay(x)[source]

Replace the delay attribute.

Args
x: float

new delay attribute.

setAttack(x)[source]

Replace the attack attribute.

Args
x: float

new attack attribute.

setDecay(x)[source]

Replace the decay attribute.

Args
x: float

new decay attribute.

setSustain(x)[source]

Replace the sustain attribute.

Args
x: float

new sustain attribute.

setRelease(x)[source]

Replace the sustain attribute.

Args
x: float

new sustain attribute.

setExp(x)[source]

Sets an exponent factor to create exponential or logarithmic envelope.

The default value is 1.0, which means linear segments. A value higher than 1.0 will produce exponential segments while a value between 0 and 1 will produce logarithmic segments. Must be > 0.0.

Args
x: float

new exp attribute.

ctrl(map_list=None, title=None, wxnoserver=False)[source]

Opens a sliders window to control the parameters of the object. SLMap has a dataOnly attribute to identify parameters that don’t audio signal as control but only discrete values.

If a list of values are given to a parameter, a multisliders will be used to control each stream independently.

Args
map_list: list of SLMap objects, optional

Users defined set of parameters scaling. There is default scaling for each object that accept ctrl method.

title: string, optional

Title of the window. If none is provided, the name of the class is used.

wxnoserver: boolean, optional

With wxPython graphical toolkit, if True, tells the interpreter that there will be no server window.

If wxnoserver is set to True, the interpreter will not wait for the server GUI before showing the controller window.

property delay

float. Duration of the delay phase in seconds.

property attack

float. Duration of the attack phase in seconds.

property decay

float. Duration of the decay phase in seconds.

property sustain

float. Amplitude of the sustain phase, as fraction of the peak amplitude.

property release

float. Duration of the release phase in seconds.

property exp

float. Exponent factor of the envelope.

Midictl

class Midictl(ctlnumber, minscale=0, maxscale=1, init=0, channel=0, mul=1, add=0)[source]

Get the current value of a Midi controller.

Get the current value of a controller and optionally map it inside a specified range.

Parent

PyoObject

Args
ctlnumber: int

Controller number.

minscale: float, optional

Low range value for mapping. Defaults to 0.

maxscale: float, optional

High range value for mapping. Defaults to 1.

init: float, optional

Initial value. Defaults to 0.

channel: int, optional

Midi channel. 0 means all channels. Defaults to 0.

Note

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

>>> s = Server().boot()
>>> s.start()
>>> m = Midictl(ctlnumber=[107,102], minscale=250, maxscale=1000)
>>> p = Port(m, .02)
>>> a = Sine(freq=p, mul=.3).out()
>>> a1 = Sine(freq=p*1.25, mul=.3).out()
>>> a2 = Sine(freq=p*1.5, mul=.3).out()

Public Data Attributes:

ctlnumber

int.

minscale

float.

maxscale

float.

channel

int.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(ctlnumber[, minscale, maxscale, ...])

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

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

setCtlNumber(x)

Replace the ctlnumber attribute.

setMinScale(x)

Replace the minscale attribute.

setMaxScale(x)

Replace the maxscale attribute.

setChannel(x)

Replace the channel attribute.

setValue(x)

Reset audio stream to value in argument.

setInterpolation(x)

Deprecated method.

ctrl([map_list, title, wxnoserver])

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

Inherited from PyoObject

__init__([mul, add])

__add__(x)

__radd__(x)

__iadd__(x)

__sub__(x)

__rsub__(x)

__isub__(x)

__mul__(x)

__rmul__(x)

__imul__(x)

__truediv__(x)

__rtruediv__(x)

__itruediv__(x)

__div__(x)

__rdiv__(x)

__idiv__(x)

__pow__(x)

__rpow__(x)

__mod__(x)

__neg__()

__lt__(x)

Return self<value.

__le__(x)

Return self<=value.

__eq__(x)

Return self==value.

__ne__(x)

Return self!=value.

__gt__(x)

Return self>value.

__ge__(x)

Return self>=value.

__do_comp__(comp, mode[, default])

isPlaying([all])

Returns True if the object is currently playing, otherwise, returns False.

isOutputting([all])

Returns True if the object is outputting.

get([all])

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

play([dur, delay])

Start processing without sending samples to output.

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

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

stop([wait])

Stop processing.

mix([voices])

Mix the object's audio streams into voices streams and return a Mix object.

range(min, max)

Adjust mul and add attributes according to a given range.

setMul(x)

Replace the mul attribute.

setAdd(x)

Replace the add attribute.

setSub(x)

Replace and inverse the add attribute.

setDiv(x)

Replace and inverse the mul attribute.

set(attr, value[, port, callback])

Replace any attribute with portamento.

ctrl([map_list, title, wxnoserver])

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

Inherited from PyoObjectBase

__init__()

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Data Attributes:

Inherited from PyoObject

_STREAM_TYPE

Inherited from PyoObjectBase

_STREAM_TYPE

Private Methods:

Inherited from PyoObject

_init_play()

_reset_from_set([attr])

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])


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

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

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

Args
chnl: int, optional

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

inc: int, optional

Output channel increment value. Defaults to 1.

dur: float, optional

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

delay: float, optional

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

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

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

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

setCtlNumber(x)[source]

Replace the ctlnumber attribute.

Args
x: int

new ctlnumber attribute.

setMinScale(x)[source]

Replace the minscale attribute.

Args
x: float

new minscale attribute.

setMaxScale(x)[source]

Replace the maxscale attribute.

Args
x: float

new maxscale attribute.

setChannel(x)[source]

Replace the channel attribute.

Args
x: int

new channel attribute.

setValue(x)[source]

Reset audio stream to value in argument.

Args
x: float

new current value.

setInterpolation(x)[source]

Deprecated method. If needed, use Port or SigTo to interpolate between values.

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 ctlnumber

int. Controller number.

property minscale

float. Minimum value for scaling.

property maxscale

float. Maximum value for scaling.

property channel

int. Midi channel. 0 means all channels.

Notein

class Notein(poly=10, scale=0, first=0, last=127, channel=0, mul=1, add=0)[source]

Generates Midi note messages.

From a Midi device, takes the notes in the range defined with first and last parameters, and outputs up to poly noteon - noteoff streams in the scale format (Midi, hertz or transpo).

Parent

PyoObject

Args
poly: int, optional

Number of streams of polyphony generated. Defaults to 10.

scale: int, optional
Pitch output format.
  1. Midi

  2. Hertz

  3. transpo

In the transpo mode, the default central key (the key where there is no transposition) is (first + last) / 2.

The central key can be changed with the setCentralKey method.

first: int, optional

Lowest Midi value. Defaults to 0.

last: int, optional

Highest Midi value. Defaults to 127.

channel: int, optional

Midi channel. 0 means all channels. Defaults to 0.

Note

Pitch and velocity are two separated set of streams. The user should call :

Notein[‘pitch’] to retrieve pitch streams.
Notein[‘velocity’] to retrieve velocity streams.

Velocity is automatically scaled between 0 and 1.

Notein also outputs trigger streams on noteon and noteoff. These streams can be retrieved with :

Notein[‘trigon’] to retrieve noteon trigger streams.
Notein[‘trigoff’] to retrieve noteoff trigger streams.

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

>>> s = Server().boot()
>>> s.start()
>>> notes = Notein(poly=10, scale=1, mul=.5)
>>> p = Port(notes['velocity'], .001, .5)
>>> b = Sine(freq=notes['pitch'], mul=p).out()
>>> c = Sine(freq=notes['pitch'] * 0.997, mul=p).out()
>>> d = Sine(freq=notes['pitch'] * 1.005, mul=p).out()

Public Data Attributes:

scale

int.

first

int.

last

int.

channel

int.

holdmode

int.

firstVelocity

int.

lastVelocity

int.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__([poly, scale, first, last, ...])

__getitem__(str)

setScale(x)

Replace the scale attribute.

setFirst(x)

Replace the first attribute.

setLast(x)

Replace the last attribute.

setChannel(x)

Replace the channel attribute.

setCentralKey(x)

Set the midi key where there is no transposition.

setStealing(x)

Activates the stealing mode if True.

setHoldmode(x)

Sets the key mode.

sendAllNotesOff()

setFirstVelocity(x)

Replace the firstVelocity attribute.

setLastVelocity(x)

Replace the lastVelocity attribute.

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.

ctrl([map_list, title, wxnoserver])

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

keyboard([title, wxnoserver])

Opens a virtual midi keyboard for this object.

Inherited from PyoObject

__init__([mul, add])

__add__(x)

__radd__(x)

__iadd__(x)

__sub__(x)

__rsub__(x)

__isub__(x)

__mul__(x)

__rmul__(x)

__imul__(x)

__truediv__(x)

__rtruediv__(x)

__itruediv__(x)

__div__(x)

__rdiv__(x)

__idiv__(x)

__pow__(x)

__rpow__(x)

__mod__(x)

__neg__()

__lt__(x)

Return self<value.

__le__(x)

Return self<=value.

__eq__(x)

Return self==value.

__ne__(x)

Return self!=value.

__gt__(x)

Return self>value.

__ge__(x)

Return self>=value.

__do_comp__(comp, mode[, default])

isPlaying([all])

Returns True if the object is currently playing, otherwise, returns False.

isOutputting([all])

Returns True if the object is outputting.

get([all])

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

play([dur, delay])

Start processing without sending samples to output.

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

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

stop([wait])

Stop processing.

mix([voices])

Mix the object's audio streams into voices streams and return a Mix object.

range(min, max)

Adjust mul and add attributes according to a given range.

setMul(x)

Replace the mul attribute.

setAdd(x)

Replace the add attribute.

setSub(x)

Replace and inverse the add attribute.

setDiv(x)

Replace and inverse the mul attribute.

set(attr, value[, port, callback])

Replace any attribute with portamento.

ctrl([map_list, title, wxnoserver])

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

Inherited from PyoObjectBase

__init__()

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Data Attributes:

Inherited from PyoObject

_STREAM_TYPE

Inherited from PyoObjectBase

_STREAM_TYPE

Private Methods:

_newNote(note)

Inherited from PyoObject

_init_play()

_reset_from_set([attr])

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])


setScale(x)[source]

Replace the scale attribute.

Args
x: int

new scale attribute. 0 = midi, 1 = hertz, 2 = transpo.

setFirst(x)[source]

Replace the first attribute.

Args
x: int

new first attribute, between 0 and 127.

setLast(x)[source]

Replace the last attribute.

Args
x: int

new last attribute, between 0 and 127.

setChannel(x)[source]

Replace the channel attribute.

Args
x: int

new channel attribute.

setCentralKey(x)[source]

Set the midi key where there is no transposition.

Used for transpo conversion. This value must be greater than or equal to first and lower than or equal to last.

Args
x: int

new centralkey value.

setStealing(x)[source]

Activates the stealing mode if True. Defaults to False.

In stealing mode, a new note will overwrite the oldest one according to the polyphony. In non-stealing mode, if the polyphony is already full, the new notes will be ignored.

Args
x: boolean

True for stealing mode, False for non-stealing.

setHoldmode(x)[source]

Sets the key mode. Defaults to 0.

Controls the behaviour of an incoming Midi note.

Args
x: int

0 := no hold (default) 1 := hold mode, new noteon event will be activate

until the next noteon event with the same pitch, velocity sensitive

2 := onoff mode, new noteon event will be activate

until the next noteon event with the same pitch, noteon velocity is set to 127

3 := single key hold mode, new noteon event will be activate

until any next noteon event, if next noteon event has the same pitch a noteoff event will be sent, velocity sensitive

4 := single key onoff mode, new noteon event will be activate

until any next noteon event, if next noteon event has the same pitch a noteoff event will be sent, noteon velocity is set to 127

setFirstVelocity(x)[source]

Replace the firstVelocity attribute.

Args
x: int

new firstVelocity attribute.

setLastVelocity(x)[source]

Replace the lastVelocity attribute.

Args
x: int

new lastVelocity attribute.

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.

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

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.

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.

keyboard(title='Notein keyboard', wxnoserver=False)[source]

Opens a virtual midi keyboard for this object.

When this window has the keyboard’s focus, the user can play chromatic notes, over two octaves, following this layout:

  2   3     5   6   7     9   0
q   w   e r   t   y   u i   o   p
  s   d     g   h   j     l   ;
z   x   c v   b   n   m ,   .   /
Args
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 scale

int. Output format. 0 = midi, 1 = hertz, 2 = transpo.

property first

int. Lowest midi value.

property last

int. Highest midi value.

property channel

int. Midi channel. 0 means all channels.

property holdmode

int. Hold mode. 0 = no hold, 1 = hold, 2 = onoff, 3 = single key hold, 4 = single key onoff.

property firstVelocity

int. Lowest midi velocity.

property lastVelocity

int. Highest midi velocity.

Programin

class Programin(channel=0, mul=1, add=0)[source]

Get the current value of a program change Midi controller.

Get the current value of a program change Midi controller.

Parent

PyoObject

Args
channel: int, optional

Midi channel. 0 means all channels. Defaults to 0.

Note

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

>>> s = Server().boot()
>>> s.start()
>>> notes = Notein(poly=10, scale=1, mul=.5)
>>> pchg = Programin(mul=1./12, add=1)
>>> p = Port(notes['velocity'], .001, .5)
>>> b = Sine(freq=notes['pitch'] * pchg, mul=p).out()
>>> c = Sine(freq=notes['pitch'] * pchg * 0.997, mul=p).out()
>>> d = Sine(freq=notes['pitch'] * pchg * 1.005, mul=p).out()

Public Data Attributes:

channel

int.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__([channel, mul, add])

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

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

setChannel(x)

Replace the channel attribute.

ctrl([map_list, title, wxnoserver])

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

Inherited from PyoObject

__init__([mul, add])

__add__(x)

__radd__(x)

__iadd__(x)

__sub__(x)

__rsub__(x)

__isub__(x)

__mul__(x)

__rmul__(x)

__imul__(x)

__truediv__(x)

__rtruediv__(x)

__itruediv__(x)

__div__(x)

__rdiv__(x)

__idiv__(x)

__pow__(x)

__rpow__(x)

__mod__(x)

__neg__()

__lt__(x)

Return self<value.

__le__(x)

Return self<=value.

__eq__(x)

Return self==value.

__ne__(x)

Return self!=value.

__gt__(x)

Return self>value.

__ge__(x)

Return self>=value.

__do_comp__(comp, mode[, default])

isPlaying([all])

Returns True if the object is currently playing, otherwise, returns False.

isOutputting([all])

Returns True if the object is outputting.

get([all])

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

play([dur, delay])

Start processing without sending samples to output.

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

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

stop([wait])

Stop processing.

mix([voices])

Mix the object's audio streams into voices streams and return a Mix object.

range(min, max)

Adjust mul and add attributes according to a given range.

setMul(x)

Replace the mul attribute.

setAdd(x)

Replace the add attribute.

setSub(x)

Replace and inverse the add attribute.

setDiv(x)

Replace and inverse the mul attribute.

set(attr, value[, port, callback])

Replace any attribute with portamento.

ctrl([map_list, title, wxnoserver])

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

Inherited from PyoObjectBase

__init__()

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Data Attributes:

Inherited from PyoObject

_STREAM_TYPE

Inherited from PyoObjectBase

_STREAM_TYPE

Private Methods:

Inherited from PyoObject

_init_play()

_reset_from_set([attr])

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])


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.

setChannel(x)[source]

Replace the channel attribute.

Args
x: int

new channel 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 channel

int. Midi channel. 0 means all channels.

Touchin

class Touchin(minscale=0, maxscale=1, init=0, channel=0, mul=1, add=0)[source]

Get the current value of an after-touch Midi controller.

Get the current value of an after-touch Midi controller and optionally maps it inside a specified range.

Parent

PyoObject

Args
minscale: float, optional

Low range value for mapping. Defaults to 0.

maxscale: float, optional

High range value for mapping. Defaults to 1.

init: float, optional

Initial value. Defaults to 0.

channel: int, optional

Midi channel. 0 means all channels. Defaults to 0.

Note

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

>>> s = Server().boot()
>>> s.start()
>>> notes = Notein(poly=10, scale=1, mul=.5)
>>> touch = Touchin(minscale=1, maxscale=2, init=1)
>>> p = Port(notes['velocity'], .001, .5)
>>> b = Sine(freq=notes['pitch'] * touch, mul=p).out()
>>> c = Sine(freq=notes['pitch'] * touch * 0.997, mul=p).out()
>>> d = Sine(freq=notes['pitch'] * touch * 1.005, mul=p).out()

Public Data Attributes:

minscale

float.

maxscale

float.

channel

int.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__([minscale, maxscale, init, ...])

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

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

setMinScale(x)

Replace the minscale attribute.

setMaxScale(x)

Replace the maxscale attribute.

setChannel(x)

Replace the channel attribute.

setInterpolation(x)

Deprecated method.

ctrl([map_list, title, wxnoserver])

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

Inherited from PyoObject

__init__([mul, add])

__add__(x)

__radd__(x)

__iadd__(x)

__sub__(x)

__rsub__(x)

__isub__(x)

__mul__(x)

__rmul__(x)

__imul__(x)

__truediv__(x)

__rtruediv__(x)

__itruediv__(x)

__div__(x)

__rdiv__(x)

__idiv__(x)

__pow__(x)

__rpow__(x)

__mod__(x)

__neg__()

__lt__(x)

Return self<value.

__le__(x)

Return self<=value.

__eq__(x)

Return self==value.

__ne__(x)

Return self!=value.

__gt__(x)

Return self>value.

__ge__(x)

Return self>=value.

__do_comp__(comp, mode[, default])

isPlaying([all])

Returns True if the object is currently playing, otherwise, returns False.

isOutputting([all])

Returns True if the object is outputting.

get([all])

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

play([dur, delay])

Start processing without sending samples to output.

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

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

stop([wait])

Stop processing.

mix([voices])

Mix the object's audio streams into voices streams and return a Mix object.

range(min, max)

Adjust mul and add attributes according to a given range.

setMul(x)

Replace the mul attribute.

setAdd(x)

Replace the add attribute.

setSub(x)

Replace and inverse the add attribute.

setDiv(x)

Replace and inverse the mul attribute.

set(attr, value[, port, callback])

Replace any attribute with portamento.

ctrl([map_list, title, wxnoserver])

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

Inherited from PyoObjectBase

__init__()

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Data Attributes:

Inherited from PyoObject

_STREAM_TYPE

Inherited from PyoObjectBase

_STREAM_TYPE

Private Methods:

Inherited from PyoObject

_init_play()

_reset_from_set([attr])

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])


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

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

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

Args
chnl: int, optional

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

inc: int, optional

Output channel increment value. Defaults to 1.

dur: float, optional

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

delay: float, optional

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

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

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

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

setMinScale(x)[source]

Replace the minscale attribute.

Args
x: float

new minscale attribute.

setMaxScale(x)[source]

Replace the maxscale attribute.

Args
x: float

new maxscale attribute.

setChannel(x)[source]

Replace the channel attribute.

Args
x: int

new channel attribute.

setInterpolation(x)[source]

Deprecated method. If needed, use Port or SigTo to interpolate between values.

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 minscale

float. Minimum value for scaling.

property maxscale

float. Maximum value for scaling.

property channel

int. Midi channel. 0 means all channels.

RawMidi

class RawMidi(function)[source]

Raw Midi handler.

This object calls a python function for each raw midi data (status, data1, data2) event for further processing in Python.

Parent

PyoObject

Args
function: Python function (can’t be a list)

Function to be called. The function must be declared with three arguments, one for the status byte and two for the data bytes. Ex.:

def event(status, data1, data2):

print(status, data1, data2)

Note

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

>>> s = Server()
>>> s.setMidiInputDevice(99) # opens all devices
>>> s.boot()
>>> s.start()
>>> def event(status, data1, data2):
...     print(status, data1, data2)
>>> a = RawMidi(event)

Public Data Attributes:

function

Python function.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(function)

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.

setSub(x)

Replace and inverse the add attribute.

setDiv(x)

Replace and inverse the mul attribute.

setFunction(x)

Replace the function attribute.

Inherited from PyoObject

__init__([mul, add])

__add__(x)

__radd__(x)

__iadd__(x)

__sub__(x)

__rsub__(x)

__isub__(x)

__mul__(x)

__rmul__(x)

__imul__(x)

__truediv__(x)

__rtruediv__(x)

__itruediv__(x)

__div__(x)

__rdiv__(x)

__idiv__(x)

__pow__(x)

__rpow__(x)

__mod__(x)

__neg__()

__lt__(x)

Return self<value.

__le__(x)

Return self<=value.

__eq__(x)

Return self==value.

__ne__(x)

Return self!=value.

__gt__(x)

Return self>value.

__ge__(x)

Return self>=value.

__do_comp__(comp, mode[, default])

isPlaying([all])

Returns True if the object is currently playing, otherwise, returns False.

isOutputting([all])

Returns True if the object is outputting.

get([all])

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

play([dur, delay])

Start processing without sending samples to output.

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

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

stop([wait])

Stop processing.

mix([voices])

Mix the object's audio streams into voices streams and return a Mix object.

range(min, max)

Adjust mul and add attributes according to a given range.

setMul(x)

Replace the mul attribute.

setAdd(x)

Replace the add attribute.

setSub(x)

Replace and inverse the add attribute.

setDiv(x)

Replace and inverse the mul attribute.

set(attr, value[, port, callback])

Replace any attribute with portamento.

ctrl([map_list, title, wxnoserver])

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

Inherited from PyoObjectBase

__init__()

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Data Attributes:

Inherited from PyoObject

_STREAM_TYPE

Inherited from PyoObjectBase

_STREAM_TYPE

Private Methods:

Inherited from PyoObject

_init_play()

_reset_from_set([attr])

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])


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.

setSub(x)[source]

Replace and inverse the add attribute.

Args
x: float or PyoObject

New inversed add attribute.

setDiv(x)[source]

Replace and inverse the mul attribute.

Args
x: float or PyoObject

New inversed mul attribute.

setFunction(x)[source]

Replace the function attribute.

Args
x: Python function

new function attribute.

property function

Python function. Function to be called.

MidiLinseg

class MidiLinseg(input, list, hold=1, mul=1, add=0)[source]

Line segments trigger.

MidiLinseg starts reading a break-points line segments each time it receives a positive value in its input parameter.

Parent

PyoObject

Args
input: PyoObject

Input signal used to trigger the envelope. A positive value sets the peak amplitude and starts the envelope. A 0 starts the release part of the envelope.

list: list of tuples

Points used to construct the line segments. Each tuple is a new point in the form (time, value).

Times are given in seconds and must be in increasing order.

hold: int, optional

The point, starting at 0, acting as the sustain point. The envelope will hold this value as long as the input signal is positive. The release part is the remaining points. Defaults to 1.

Note

MidiLinseg will send a trigger signal at the end of the playback. User can retreive the trigger streams by calling obj[‘trig’]. Useful to synchronize other processes.

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

>>> s = Server().boot()
>>> s.start()
>>> mid = Notein(scale=1)
>>> env = [(0,0), (0.1,1), (0.2,0.5), (0.4,0.7), (0.5,0.3), (1,1), (2,0)]
>>> env = MidiLinseg(mid['velocity'], env, hold=4)
>>> a = SineLoop(freq=mid['pitch'], feedback=.1, mul=env).out()
>>> b = SineLoop(freq=mid['pitch']*1.005, feedback=.1, mul=env).out(1)

Public Data Attributes:

input

PyoObject.

list

list of tuples.

hold

int.

Inherited from PyoObject

mul

float or PyoObject.

add

float or PyoObject.

Public Methods:

__init__(input, list[, hold, 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.

setList(x)

Replace the list attribute.

replace(x)

Alias for setList method.

setHold(x)

Replace the hold attribute.

getPoints()

ctrl([map_list, title, wxnoserver])

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

graph([xlen, yrange, title, wxnoserver])

Opens a grapher window to control the shape of the envelope.

Inherited from PyoObject

__init__([mul, add])

__add__(x)

__radd__(x)

__iadd__(x)

__sub__(x)

__rsub__(x)

__isub__(x)

__mul__(x)

__rmul__(x)

__imul__(x)

__truediv__(x)

__rtruediv__(x)

__itruediv__(x)

__div__(x)

__rdiv__(x)

__idiv__(x)

__pow__(x)

__rpow__(x)

__mod__(x)

__neg__()

__lt__(x)

Return self<value.

__le__(x)

Return self<=value.

__eq__(x)

Return self==value.

__ne__(x)

Return self!=value.

__gt__(x)

Return self>value.

__ge__(x)

Return self>=value.

__do_comp__(comp, mode[, default])

isPlaying([all])

Returns True if the object is currently playing, otherwise, returns False.

isOutputting([all])

Returns True if the object is outputting.

get([all])

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

play([dur, delay])

Start processing without sending samples to output.

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

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

stop([wait])

Stop processing.

mix([voices])

Mix the object's audio streams into voices streams and return a Mix object.

range(min, max)

Adjust mul and add attributes according to a given range.

setMul(x)

Replace the mul attribute.

setAdd(x)

Replace the add attribute.

setSub(x)

Replace and inverse the add attribute.

setDiv(x)

Replace and inverse the mul attribute.

set(attr, value[, port, callback])

Replace any attribute with portamento.

ctrl([map_list, title, wxnoserver])

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

Inherited from PyoObjectBase

__init__()

dump()

Print infos about the current state of the object.

getBaseObjects()

Return a list of Stream objects managed by the instance.

getServer()

Return a reference to the current Server object.

getSamplingRate()

Return the current sampling rate (samples per second), as a float.

getBufferSize()

Return the current buffer size (samples per buffer), as an integer.

allowAutoStart([switch])

When autoStartChildren is activated in the Server, call this method with False as argument to stop the propagation of play/out/stop methods to and from this object.

useWaitTimeOnStop()

When autoStartChildren is activated in the Server, call this method to force an object given to the mul attribute of another object to use the wait time from the stop method instead of being stopped immediately.

addLinkedObject(x)

When autoStartChildren is activated in the Server, use this method to explicitly add an object in a dsp chain, which is generally controlled by the last object of the chain.

setStopDelay(x)

Set a specific waiting time when calling the stop method on this object.

getStopDelay()

Return the waiting time applied when calling the stop method on this object.

__iter__()

__next__()

next()

Alias for __next__ method.

__getitem__(i)

__setitem__(i, x)

__len__()

__repr__()

Return repr(self).

__dir__()

Default dir() implementation.

Private Data Attributes:

Inherited from PyoObject

_STREAM_TYPE

Inherited from PyoObjectBase

_STREAM_TYPE

Private Methods:

Inherited from PyoObject

_init_play()

_reset_from_set([attr])

Inherited from PyoObjectBase

_autoplay([dur, delay])

_autostop([wait])


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

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

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

Args
chnl: int, optional

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

inc: int, optional

Output channel increment value. Defaults to 1.

dur: float, optional

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

delay: float, optional

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

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

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

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

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.

setList(x)[source]

Replace the list attribute.

Args
x: list of tuples

new list attribute.

replace(x)[source]

Alias for setList method.

Args
x: list of tuples

new list attribute.

setHold(x)[source]

Replace the hold attribute.

Args
x: int

new hold 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.

graph(xlen=None, yrange=None, title=None, wxnoserver=False)[source]

Opens a grapher window to control the shape of the envelope.

When editing the grapher with the mouse, the new set of points will be send to the object on mouse up.

Ctrl+C with focus on the grapher will copy the list of points to the clipboard, giving an easy way to insert the new shape in a script.

Args
xlen: float, optional

Set the maximum value of the X axis of the graph. If None, the maximum value is retrieve from the current list of points. Defaults to None.

yrange: tuple, optional

Set the min and max values of the Y axis of the graph. If None, min and max are retrieve from the current list of points. Defaults to None.

title: string, optional

Title of the window. If none is provided, the name of the class is used.

wxnoserver: boolean, optional

With wxPython graphical toolkit, if True, tells the interpreter that there will be no server window.

If wxnoserver is set to True, the interpreter will not wait for the server GUI before showing the controller window.

property input

PyoObject. Audio trigger signal.

property list

list of tuples. Points used to construct the line segments.

property hold

int. The sustain point.