SchedEventGroup#

class csoundengine.schedevent.SchedEventGroup(events)[source]#

Bases: BaseSchedEvent

Represents a group of scheduled events

These events can be controlled together, similar to a SynthGroup

Methods Summary

aliases()

automate(param, pairs[, mode, delay, overtake])

Automate any named parameter of this Synth

controlNames([aliases, aliased])

Returns a set of available table named parameters for this group

dynamicParamNames([aliases, aliased])

The set of all dynamic parameters accepted by this event

paramNames([aliases, aliased])

Set of all named parameters :rtype: frozenset[str]

paramValue(param)

Returns the parameter value for the given parameter

set([param, value, delay])

Set a value of a named parameter

stop([delay])

Stop this event

Methods Documentation

aliases()[source]#
Return type:

dict[str, str]

automate(param, pairs, mode='linear', delay=None, overtake=False)[source]#

Automate any named parameter of this Synth

This method will automate this synth’s pfields / param table, depending of how the instrument was defined.

Parameters:
  • param (str) – the name of the parameter to automate, or the param index

  • pairs (Union[Sequence[float], ndarray, tuple[ndarray, ndarray]]) – automation data as a flat array with the form [time0, value0, time1, value1, …]

  • mode – one of ‘linear’, ‘cos’. Determines the curve between values

  • delay (float) – when to start the automation

  • overtake – if True, do not use the first value in pairs but overtake the current value

Return type:

float

Returns:

the eventid of the automation event

controlNames(aliases=True, aliased=False)[source]#

Returns a set of available table named parameters for this group

Return type:

frozenset[str]

dynamicParamNames(aliases=True, aliased=False)[source]#

The set of all dynamic parameters accepted by this event

Return type:

frozenset[str]

Returns:

a set of the dynamic (modifiable) parameters accepted by this event

paramNames(aliases=True, aliased=False)[source]#

Set of all named parameters :rtype: frozenset[str]

See also

dynamicParams(), set(), automate()

paramValue(param)[source]#

Returns the parameter value for the given parameter

Within a group the first synth which has the given parameter will be used to determine the parameter value

Return type:

float | str | None

set(param='', value=0.0, delay=0.0, **kws)[source]#

Set a value of a named parameter

Parameters:
  • param – the parameter name. Can also be an unnamed param, like ‘p5’

  • value (float) – the value to set

  • delay – when to set this parameter

  • kws – the key should be a named parameter, or p5, p6, etc., if setting a parameter by index. Bear in mind that only parameters assigned to a control variable will see any modification

Return type:

None

Example

>>> from csoundengine import *
>>> s = Engine().session()
>>> s.defInstr('osc', r'''
... |kfreq, kamp|
... outch 1, oscili:a(kamp, kfreq)
... ''')
>>> synth = s.sched('osc', kfreq=1000, kamp=0.5)
>>> synth.set(kfreq=440)
>>> # Parameters can be given as index also:
>>> synth.set(p5=440, delay=2.5)
>>> # Multiple parameters can be set at a time
>>> synth.set(kfreq=442, kamp=0.1)
stop(delay=0.0)[source]#

Stop this event

Return type:

None